##from rdm, item parameters denote 4 item 1PL test, cut score at x=2
##only print marginal indices
params<-matrix(c(1,1,1,1,-2,1,0,1,0,0,0,0),4,3)
rdm<-sim(params, rnorm(100))
class.Lee(2, params, rdm = rdm)$Marginal
##or from 40 quadrature points and weights, 2 cut scores
quad <- normal.qu(40)
class.Lee(c(2,3), params, quadrature = quad, D = 1)$Marginal
#example of Lee.poly.P with same binary responses
theta.hat <- MLE(rdm, params)
Pij <- array(NA,dim = c(100,2,4))
Pi1 <- irf(params, theta.hat)$f
Pij[,2,] <- Pi1
Pij[,1,] <- 1-Pi1
Lee.poly.P(c(2,3), theta.hat, Pij)$Marginal
Run the code above in your browser using DataLab