Learn R Programming

difNLR (version 1.3.7)

predict.difNLR: Predicted values for an object of "difNLR" class.

Description

S3 method for predictions from the model used in the object if "difNLR" class.

Usage

# S3 method for difNLR
predict(
  object,
  item = "all",
  match,
  group,
  interval = "none",
  level = 0.95,
  ...
)

Arguments

object

an object of "difNLR" class.

item

numeric or character: either character "all" to apply for all converged items (default), or a vector of item names (column names of Data), or item identifiers (integers specifying the column number).

match

numeric: matching criterion for new observations.

group

numeric: group membership for new observations.

interval

character: type of interval calculation, either "none" (default) or "confidence" for confidence interval.

level

numeric: confidence level.

...

other generic parameters for predict() function.

References

Drabinova, A. & Martinkova, P. (2017). Detection of differential item functioning with nonlinear regression: A non-IRT approach accounting for guessing. Journal of Educational Measurement, 54(4), 498--517, 10.1111/jedm.12158.

Hladka, A. & Martinkova, P. (2020). difNLR: Generalized logistic regression models for DIF and DDF detection. The R journal, 12(1), 300--323, 10.32614/RJ-2020-014.

Swaminathan, H. & Rogers, H. J. (1990). Detecting differential item functioning using logistic regression procedures. Journal of Educational Measurement, 27(4), 361--370, 10.1111/j.1745-3984.1990.tb00754.x

See Also

difNLR for DIF detection among binary data using generalized logistic regression model. predict for generic function for prediction.

Examples

Run this code
# 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