#############################################################################
# EXAMPLE 1: 1PL model, sim.rasch data
#############################################################################
data(sim.rasch)
# estimate Rasch model
mod1 <- tam.mml(resp=sim.rasch[1:500,1:10])
# standard error estimation
se1 <- tam.se( mod1 )
# proportion of standard errors estimated by 'tam.se' and 'tam.mml'
prop1 <- se1$xsi$se / mod1$xsi$se
## > summary( prop1 )
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 1.030 1.034 1.035 1.036 1.039 1.042
## => standard errors estimated by tam.se are a bit larger
#############################################################################
# EXAMPLE 2: Standard errors differential item functioning
#############################################################################
data(data.ex08)
formulaA <- ~ item*female
resp <- data.ex08[["resp"]]
facets <- as.data.frame( data.ex08[["facets"]] )
# investigate DIF
mod <- tam.mml.mfr( resp= resp , facets= facets , formulaA = formulaA )
summary(mod)
# estimate standard errors
semod <- tam.se(mod)
prop1 <- semod$xsi$se / mod$xsi$se
summary(prop1)
# plot differences in standard errors
plot( mod$xsi$se , semod$xsi$se , pch=16 , xlim=c(0,.15) , ylim=c(0,.15) ,
xlab="Standard error 'tam.mml'" , ylab="Standard error 'tam.se'" )
lines( c(-6,6) , c(-6,6) , col="gray")
round( cbind( mod$xsi , semod$xsi[,-1] ) , 3 )
## xsi se.xsi N est se
## I0001 -1.956 0.092 500 -1.956 0.095
## I0002 -1.669 0.085 500 -1.669 0.088
## [...]
## I0010 2.515 0.108 500 2.515 0.110
## female1 -0.091 0.025 500 -0.091 0.041
## I0001:female1 -0.051 0.070 500 -0.051 0.071
## I0002:female1 0.085 0.067 500 0.085 0.068
## [...]
## I0009:female1 -0.019 0.068 500 -0.019 0.068
##
# => The largest discrepancy in standard errors is observed for the
# main female effect (.041 in 'tam.se' instead of .025 in 'tam.mml')
Run the code above in your browser using DataLab