S3 method for predictions from the model used in the
object of "difORD" class.
Usage
# S3 method for class 'difORD'
predict(object, item = "all", match, group, type = "category", ...)Arguments
- object
an object of
"difORD"class.- item
numeric or character: either character
"all"to apply for all converged items (default), or a vector of item names (column names ofData), or item identifiers (integers specifying the column number).- match
numeric: matching criterion for new observations.
- group
numeric: group membership for new observations.
- type
character: type of probability to be computed. Either
"category"for category probabilities or"cumulative"for cumulative probabilities. Cumulative probabilities are available only for cumulative logit model.- ...
other generic parameters for
predict()function.
References
Hladka, A. & Martinkova, P. (2020). difNLR: Generalized logistic regression models for DIF and DDF detection. The R Journal, 12(1), 300–323, doi:10.32614/RJ-2020-014 .
Author
Adela Hladka (nee Drabinova)
Institute of Computer Science of the Czech Academy of Sciences
hladka@cs.cas.cz
Patricia Martinkova
Institute of Computer Science of the Czech Academy of Sciences
martinkova@cs.cas.cz
Examples
if (FALSE) { # \dontrun{
# loading data
data(Anxiety, package = "ShinyItemAnalysis")
Data <- Anxiety[, paste0("R", 1:29)] # items
group <- Anxiety[, "gender"] # group membership variable
# testing both DIF effects with cumulative logit model
(x <- difORD(Data, group, focal.name = 1, model = "cumulative"))
# fitted values
predict(x, item = "R6")
# predicted values
predict(x, item = "R6", match = 0, group = c(0, 1))
predict(x, item = "R6", match = 0, group = c(0, 1), type = "cumulative")
predict(x, item = c("R6", "R7"), match = 0, group = c(0, 1))
# testing both DIF effects with adjacent category logit model
(x <- difORD(Data, group, focal.name = 1, model = "adjacent"))
# fitted values
predict(x, item = "R6")
# predicted values
predict(x, item = "R6", match = 0, group = c(0, 1))
predict(x, item = c("R6", "R7"), match = 0, group = c(0, 1))
} # }
