if (FALSE) {
# simulate some data
N <- 1000
J <- 20 # number of items
a <- matrix(rlnorm(J,.2,.3))
d <- rnorm(J)
theta <- matrix(rnorm(N))
dat_pre <- simdata(a, d, itemtype = '2PL', Theta = theta)
# first 3 cases decrease by 1/2
theta2 <- theta - c(1/2, 1/2, 1/2, numeric(N-3))
dat_post <- simdata(a, d, itemtype = '2PL', Theta = theta2)
mod <- mirt(dat_pre)
# all changes using fitted model from pre data
RCI(mod, predat=dat_pre, postdat=dat_post)
# single response pattern change using EAP information
RCI(mod, predat=dat_pre[1,], postdat=dat_post[1,])
# WLE estimator with Fisher information for SE (see Jabrayilov et al. 2016)
RCI(mod, predat = dat_pre[1,], postdat = dat_post[1,],
method = 'WLE', Fisher = TRUE)
# multiple respondents
RCI(mod, predat = dat_pre[1:6,], postdat = dat_post[1:6,])
# include large-sample z-type cutoffs
RCI(mod, predat = dat_pre[1:6,], postdat = dat_post[1:6,],
cutoffs = c(-1.96, 1.96))
######
# CTT version by omitting IRT model (easiest to use complete dataset)
RCI(predat = dat_pre, postdat = dat_post)
# CTT version with pre-computed information
RCI(predat = dat_pre[1:6,], postdat = dat_post[1:6,],
rxx.pre=.6, rxx.post=.6, SD.pre=2, SD.post=3,
cutoffs = c(-1.96, 1.96))
# just pre-test rxx
RCI(predat = dat_pre[1:6,], postdat = dat_post[1:6,],
rxx.pre=.6, SD.pre=2, rxx.method = 'pre')
############################
# Example where individuals take completely different item set pre-post
# but prior calibration has been performed to equate the items
dat <- key2binary(SAT12,
key = c(1,4,5,2,3,1,2,1,3,1,2,4,2,1,5,3,4,4,1,4,3,3,4,1,3,5,1,3,1,5,4,5))
mod <- mirt(dat)
# with N=5 individuals under investigation
predat <- postdat <- dat[1:5,]
predat[, 17:32] <- NA
postdat[, 1:16] <- NA
head(predat)
head(postdat)
RCI(mod, predat, postdat)
}
Run the code above in your browser using DataLab