Scott Desposato's Homepage
Code and Data


Computer Code


  • Legislator Ideal Points in WinBUGS from R - simulation code. This R code will randomly generate legislator ideal points, bill yea/nay locations, and roll-call votes. It will then call BUGS using R2WinBUGS and estimate ideal points using a standard item-response model. It them makes some graphs and such in R. This may make your life easier as you start using WinBUGS to model roll-call votes. Steps: 1) Install Winbugs 2) Install R and the R2WinBUGS package 3) create appropriate directories (see code for directory names - change or create identicaly paths) 3.5) Place leg.bug in whatever directory is appropriate 4) Copy and paste the legsim.R code into the R console 5) when it fails, persist or just email me. Files you need: legsim.R - the R code to run WinBUGS and leg.bug a modified version of an example on Simon Jackman's website.

  • An excell spreadsheet for comparing party-switching payoffs as discussed in Desposato, 2005

  • R code to compare equilibrium graphs as discussed in Desposato, 2005

  • R Code for estimating conditional logit with unobserved choice set variation. Crude but it works. Like most things on this page. This is just for simulations but the likelihood function is there and could easily be tweaked for an application - I can do it for you if there are any problems.

  • An xlisp algorithm for 2-dimensional MDS using SWA flight times

  • An xlisp algorithm for simulating Congressional elections

  • SAS/IML Code for estimating legislators ideal points via homogeneity analysis by alternating least squares, with bootstrapping algorithm


    Data


  • Legislative Representation in Brazil, 1991-1998,

  • Election Results, NY, 1898

  • Election Results, NY, 1898, Fixed Colum

  • Representation in Authoritarian Brazil: Roll-call votes from the Chamber of Deputies, 1964-1985.

  • Data from the Michaelson and Morley speed of light experiments, for use in the R tutorials.

  • Data from "Parties for Rent" article on party-switching in Brazil and Stata code to run models and generate predicted values and R code to generate confidence intervales for predicted values and Errata and predicted probabilities and confidence intervals.

  • Data from "Governmental Centralization and Party Affiliation: Legislator Strategies in Brazil and Japan", 2009 APSR, with Ethan Scheiner. Brazil data and code. Japan data (National and Subnational) and code.

    Homepage: http://swd.ucsd.edu
    Email: swd@ucsd.edu