# NOT RUN {
# Loading data based on GMAT
data(GMAT)
Data <- GMAT[, 1:20]
group <- GMAT[, "group"]
# 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
# Predicted values for new observations - various z-scores and groups
new.match <- rep(c(-1, 0, 1), 2)
new.group <- rep(c(0, 1), each = 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")
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab