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

View source: R/restrict.ideal.r

constrain.legisR Documentation

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 dropRollCall for details.

x

a list containing elements with names partially matching legislators found in dimnames(object$votes)[[1]] (but after any sub-setting specified by dropList). Each element must be a vector containing d elements, specifying the value to which the ideal point should be constrained in each of d dimensions. x must have at least d+1 components; i.e., supplying a necessary (but not sufficient) set of constraints for global identification of the parameters of a d-dimensional item-response model, see Details.

d

the number of dimensions for which to set up the priors and start values.

Details

constrain.items and its cousin, constrain.legis are usefully thought of as “pre-processor” functions, implementing identification constraints for the ideal point model by 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, and, for all practical purposes, constraining that parameter to a fixed value). For the other legislators, the priors on their ideal points are set to a mean of 0 and a small precision of .01, corresponding to a prior variance of 100, or a prior 95 percent confidence interval of -20 to 20. 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 named 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.

Value

a list with elements:

xp

prior means for ideal points. A matrix of dimensions number of legislators in rc by d.

xpv

prior meansprecisions for ideal points. A matrix of dimensions number of legislators in rc by d.

bp

prior means for item parameters. A matrix of dimensions number of items or votes in rc by d+1.

bpv

prior meansprecisions for item parameters. A matrix of dimensions number of items or votes in rc by d+1.

x

start values for ideal points. A matrix of dimensions number of legislators in rc by d.

b

start values for ideal points. A matrix of dimensions number of items or votes in rc by d+1.

See Also

rollcall, ideal, constrain.items. See pmatch on how supplied names are matched against the names in the rollcall object.

Examples

data(s109)
cl <- constrain.legis(s109,
                      x=list("KENNEDY"=-1,
                        "ENZI"=1),
                      d=1)

## Not run: 
## too long for examples
id1Constrained <- ideal(s109,
                       d=1,
                       priors=cl,      ## use cl
                       startvals=cl,   ## use cl
                       maxiter=5000,
                       burnin=500,
                       thin=25)
summary(id1Constrained)

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


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)
summary(id2Constrained,include.items=TRUE)

## End(Not run)

pscl documentation built on May 29, 2024, 9:09 a.m.