#############################################################################
# EXAMPLE 1: Reading data set | pairwise estimation Rasch model
#############################################################################
data(data.read)
dat <- data.read
#*** Model 1: no constraint on item difficulties
mod1 <- sirt::rasch.pairwise(dat)
summary(mod1)
#*** Model 2: sum constraint on item difficulties
mod2 <- sirt::rasch.pairwise(dat, zerosum=TRUE)
summary(mod2)
if (FALSE) {
#** obtain standard errors by bootstrap
mod2$item$b # extract item difficulties
# Bootstrap of item difficulties
boot_pw <- function(data, indices ){
dd <- data[ indices, ] # bootstrap of indices
mod <- sirt::rasch.pairwise( dat=dd, zerosum=TRUE, progress=FALSE)
return(mod$item$b)
}
set.seed(986)
library(boot)
bmod2 <- boot::boot(data=dat, statistic=boot_pw, R=999 )
print(bmod2)
summary(bmod2)
# quantiles for bootstrap sample (and confidence interval)
apply(bmod2$t, 2, stats::quantile, probs=c(.025, .5, .975) )
}
Run the code above in your browser using DataLab