data(s109)
cl <- constrain.legis(s109,
x=list("KENNEDY"=-1,
"ENZI"=1),
d=1)
if (FALSE) {
## 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)
}
Run the code above in your browser using DataLab