head(Attitude)
df <- expand.table(Attitude)
itemstats(df)
if (FALSE) {
# estimate SSLM with estimated " latitude of acceptance" (rho)
mod.rho <- mirt(df, 1, itemtype = 'sslm')
coef(mod.rho)
coef(mod.rho, simplify=TRUE) # slope-intercept-log_rho
coef(mod.rho, simplify=TRUE, IRTpars=TRUE) # discrimination-difficulty-rho
plot(mod.rho)
plot(mod.rho, type = 'trace')
# without estimating rho, and fixing to rho^2 = 1 (hence,
# log_rho = -exp(1) = -2.718282 in order to obtain (exp(exp(log_rho))) = 1)
syntax <- "Theta = 1-8
FIXED = (1-8, log_rho1)
START = (1-8, log_rho1, -2.71828)"
mod <- mirt(df, syntax, itemtype = 'sslm') # model found in Andrich (1988)
coef(mod)
coef(mod, simplify=TRUE) # slope-intercept-log_rho
coef(mod, simplify=TRUE, IRTpars=TRUE) # discrimination-difficulty-rho
plot(mod)
plot(mod, type = 'trace') # notice that all curves have a fixed height of .5
# goodness of fit (less constrained model fits better)
anova(mod, mod.rho) # original model fits much worse
M2(mod)
M2(mod.rho)
itemfit(mod, p.adjust='fdr')
itemfit(mod.rho, p.adjust='fdr')
}
Run the code above in your browser using DataLab