#make some data
set.seed(1234)
a <- matrix(rlnorm(20, meanlog=0, sdlog = .1),ncol=1)
d <- matrix(rnorm(20),ncol=1)
items <- rep('dich', 20)
data <- simdata(a,d, 2000, items)
x <- mirt(data, 1)
raschfit <- mirt(data, 1, itemtype='Rasch')
fit <- itemfit(x)
fit
itemfit(x, empirical.plot = 1) #empirical item plot
itemfit(x, empirical.plot = 1, empirical.CI = .99) #empirical item plot with 99% CI's
#method='ML' agrees better with eRm package
itemfit(raschfit, method = 'ML') #infit and outfit stats
#same as above, but inputting ML estimates instead
Theta <- fscores(raschfit, method = 'ML', full.scores=TRUE, scores.only=TRUE)
itemfit(raschfit, Theta=Theta)
#similar example to Kang and Chen 2007
a <- matrix(c(.8,.4,.7, .8, .4, .7, 1, 1, 1, 1))
d <- matrix(rep(c(2.0,0.0,-1,-1.5),10), ncol=4, byrow=TRUE)
dat <- simdata(a,d,2000, itemtype = rep('graded', 10)) - 1
head(dat)
mod <- mirt(dat, 1)
itemfit(mod)
mod2 <- mirt(dat, 1, 'Rasch')
itemfit(mod2)
#massive list of tables
tables <- itemfit(mod, S_X2.tables = TRUE)
#observed and expected total score patterns for item 1 (post collapsing)
tables$O[[1]]
tables$E[[1]]
Run the code above in your browser using DataLab