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