# NOT RUN {
data(s109)
f <- system.file("extdata","id1.rda",package="pscl")
load(f)
id1sum <- summary(id1,include.beta=TRUE)
suspect1 <- id1sum$bSig[[1]]=="95<!-- % CI overlaps 0" -->
close60 <- id1sum$bResults[[1]][,"Yea"] < 60
close40 <- id1sum$bResults[[1]][,"Yea"] > 40
suspect <- suspect1 & close60 & close40
id1sum$bResults[[1]][suspect,]
suspectVotes <- dimnames(id1sum$bResults[[1]][suspect,])[[1]]
## constraints on 2d model,
## close rollcall poorly fit by 1d model
## serves as reference item for 2nd dimension
cl <- constrain.items(s109,
x=list("2-150"=c(0,7),
"2-169"=c(7,0)),
d=2)
id1Constrained <- ideal(s109,
d=2,
meanzero=TRUE,
priors=cl,
startvals=cl,
maxiter=1e5,
burnin=1e3,
thin=1e2)
summary(id1Constrained,include.beta=TRUE)
# }
Run the code above in your browser using DataLab