Learn R Programming

pscl (version 0.5)

constrain.legis: constrain legislators' ideal points in analysis of roll call data

Description

Sets constraints on specified legislators for ideal point estimation by generating appropriate priors and start values.

Usage

constrain.legis(obj, dropList = list(codes = "notInLegis", lop = 0),
                 x, d = 1)

Arguments

obj
an object of class rollcall.
dropList
a list (or alist) indicating which voting decisions, legislators and/or roll calls are to be excluded from the subsequent analysis; see
x
a list containing elements with names matching legislators found in dimnames(object$votes)[[1]] (but after any subseting specified by dropList). Each element must be a ve
d
the number of dimensions for which to set up the priors and start values.

Value

  • a list with elements:
  • xpprior means for ideal points. A matrix of dimensions number of legislators in rc by d.
  • xpvprior meansprecisions for ideal points. A matrix of dimensions number of legislators in rc by d.
  • bpprior means for item parameters. A matrix of dimensions number of items or votes in rc by d+1.
  • bpvprior meansprecisions for item parameters. A matrix of dimensions number of items or votes in rc by d+1.
  • xstartstart values for ideal points. A matrix of dimensions number of legislators in rc by d.
  • bstartstart values for ideal points. A matrix of dimensions number of items or votes in rc by d+1.

Details

constrain.items and its cousin, constrain.legis are usefully thougt of as pre-processor functions, generating priors and start values for both the item parameters and the ideal points.

For the legislators specified in x, the prior mean for each dimension is set to the specified value and the prior precision for each dimension is set to 1e12 (i.e., a near-degenerate spike prior). For the other legislators, the priors on their ideal points are set to a mean of 0 and precision .01. All of the item parameter priors are set to mean 0, precision 0.01.

Start values are also generated for both ideal points and item parameters. The start values for the legislators specified in x are set to the values specified in x. The list resulting from constrain.legis can then be given as the value for the parameters priors and startvals when ideal is run. constrain.legis requires that d+1 constraints be specified; if the constrained ideal points points are linearly independent, then the parameters of the item-response model are (at least locally) identified. For instance, when fitting a 1 dimensional model, constraining the ideal points of two legislators is sufficient to globally identify the model parameters.

dropRollCall is first called to generate the desired roll call matrix. The entries of the roll call matrix are mapped to c(0,1,NA) using the codes component of the rollcall object. See the discussion in the documentation of ideal for details on the generation of start values.

See Also

rollcall, ideal, constrain.items

Examples

Run this code
data(s109)
cl <- constrain.legis(s109,
                      x=list("KENNEDY (D MA)"=-1,
                        "ENZI (R WY)"=1),
                      d=1)

## short run for examples
id1Constrained <- ideal(s109,
                       d=1,
                       priors=cl,      ## use cl
                       startvals=cl,   ## use cl
                       maxiter=1000,
                       burnin=100,
                       thin=10)
summary(id1Constrained)

cl2 <- constrain.legis(s109,
                       x=list("KENNEDY (D MA)"=c(-1,0),
                         "ENZI (R WY)"=c(1,0),
                         "CHAFEE (R RI)"=c(0,-.5)),
                       d=2)

## too long for examples
id2Constrained <- ideal(s109,
                        d=2,
                        priors=cl2,      ## priors (w constraints)
                        startvals=cl2,   ## start value (w constraints)
                        store.item=TRUE,
                        maxiter=5000,
                        burnin=500,
                        thin=25)
## short run for examples
id2Constrained <- ideal(s109,
                        d=2,
                        priors=cl2,      ## priors (w constraints)
                        startvals=cl2,   ## start value (w constraints)
                        store.item=TRUE,
                        maxiter=500,
                        burnin=100,
                        thin=10)
summary(id2Constrained,include.items=TRUE)

Run the code above in your browser using DataLab