if (FALSE) {
# Numerical example with 400 persons and 4 items
# presented twice, thus 8 virtual items
# Data y generated under the assumption that shift parameter equals 0
# (no change from time point 1 to 2)
# design matrix W used only for example data generation
# (not used for estimating in change_test function)
W <- rbind(c(1,0,0,0,0),
c(0,1,0,0,0),
c(0,0,1,0,0),
c(0,0,0,1,0),
c(1,0,0,0,1),
c(0,1,0,0,1),
c(0,0,1,0,1),
c(0,0,0,1,1))
# eta Parameter, first 4 are nuisance, i.e. , easiness parameters of the 4 items
# at time point 1, last one is the shift parameter.
eta <- c(-2,-1,1,2,0)
y <- eRm::sim.rasch(persons = rnorm(400), items = colSums(eta * t(W)))
res <- change_test(data = y)
res$test # test statistics
res$df # degrees of freedoms
res$pvalue # p-values
}
Run the code above in your browser using DataLab