if (FALSE) {
# loading data
data(GMAT)
Data <- GMAT[, 1:20] # items
group <- GMAT[, "group"] # group membership variable
# testing both DIF effects using likelihood-ratio test and
# 3PL model with fixed guessing for groups
(x <- difNLR(Data, group, focal.name = 1, model = "3PLcg"))
# predicted values
summary(predict(x))
predict(x, item = 1)
predict(x, item = "Item1")
# predicted values for new observations - average score
predict(x, item = 1, match = 0, group = 0) # reference group
predict(x, item = 1, match = 0, group = 1) # focal group
predict(x, item = 1, match = 0, group = c(0, 1)) # both groups
# predicted values for new observations - various Z-scores and groups
new.match <- rep(c(-1, 0, 1), each = 2)
new.group <- rep(c(0, 1), 3)
predict(x, item = 1, match = new.match, group = new.group)
# predicted values for new observations with confidence intervals
predict(x, item = 1, match = new.match, group = new.group, interval = "confidence")
predict(x, item = c(2, 4), match = new.match, group = new.group, interval = "confidence")
}
Run the code above in your browser using DataLab