# Loading the 'tcals' parameters 
 data(tcals)
 
 # Selecting item parameters only
 tcals <- as.matrix(tcals[,1:4])
 # Creation of a response pattern (tcals item parameters,
 # true ability level 0)
 set.seed(1)
 x <- rbinom(85, 1, Pi(0, tcals)$Pi)
 # ML estimation
 th <- thetaEst(tcals, x, method="ML")
 c(th, semTheta(th, tcals, method="ML"))
 # BM estimation, standard normal prior distribution
 th <- thetaEst(tcals, x)
 c(th, semTheta(th, tcals))
 # BM estimation, uniform prior distribution upon range [-2,2]
 th <- thetaEst(tcals, x, method="BM", priorDist="unif",
                priorPar=c(-2,2))
 c(th, semTheta(th, tcals, method="BM", priorDist="unif",
		    priorPar=c(-2,2)))
 # BM estimation, Jeffreys' prior distribution  
 th <- thetaEst(tcals, x, method="BM", priorDist="Jeffreys")
 c(th, semTheta(th, tcals, method="BM", priorDist="Jeffreys"))
 # EAP estimation, standard normal prior distribution
 th <- thetaEst(tcals, x, method="EAP")
 c(th, semTheta(th, tcals, x, method="EAP"))
 # EAP estimation, uniform prior distribution upon range [-2,2]
 th <- thetaEst(tcals, x, method="EAP", priorDist="unif",
                priorPar=c(-2,2))
 c(th, semTheta(th, tcals, x, method="EAP", priorDist="unif",
		    priorPar=c(-2,2)))
 # EAP estimation, Jeffreys' prior distribution  
 th <- thetaEst(tcals, x, method="EAP", priorDist="Jeffreys")
 c(th, semTheta(th, tcals, x, method="EAP", priorDist="Jeffreys"))
 # WL estimation
 th <- thetaEst(tcals, x, method="WL")
 c(th, semTheta(th, tcals, method="WL"))Run the code above in your browser using DataLab