| ddfMLR | R Documentation | 
Performs DDF detection procedure for nominal data based on multinomial log-linear regression model and likelihood ratio test of a submodel.
ddfMLR(Data, group, focal.name, key, type = "both", match = "zscore", anchor = NULL,
       purify = FALSE, nrIter = 10, p.adjust.method = "none",
       alpha = 0.05, parametrization)
| Data | data.frame or matrix: dataset which rows represent
unscored examinee answers (nominal) and columns correspond to the
items. In addition,  | 
| group | numeric or character: a dichotomous vector of the same
length as  | 
| focal.name | numeric or character: indicates the level of
 | 
| key | character: the answer key. Each element corresponds to the correct answer of one item. | 
| type | character: type of DDF to be tested. Either
 | 
| match | numeric or character: matching criterion to be used as
an estimate of trait. Can be either  | 
| anchor | numeric or character: specification of DDF free
items. Either  | 
| purify | logical: should the item purification be applied?
(default is  | 
| nrIter | numeric: the maximal number of iterations in the item purification (default is 10). | 
| p.adjust.method | character: method for multiple comparison
correction. Possible values are  | 
| alpha | numeric: significance level (default is 0.05). | 
| parametrization | deprecated. Use
 | 
Performs DDF detection procedure for nominal data based on
multinomial log-linear regression model and likelihood ratio test
of submodel. Probability of selection the k-th category
(distractor) is
P(y = k) = exp((a_k + a_kDif * g) * (x - b_k - b_kDif * g))) / (1 + \sum exp((a_l + a_lDif * g) * (x - b_l - b_lDif * g))), 
where x is by default standardized total score (also called
Z-score) and g is a group membership. Parameters a_k
and b_k are discrimination and difficulty for the k-th
category. Terms a_kDif and b_kDif then represent
differences between two groups (reference and focal) in relevant
parameters. Probability of correct answer (specified in argument
key) is
P(y = k) = 1/(1 + \sum exp((a_l + a_lDif * g)*(x - b_l - b_lDif * g))). 
Parameters are estimated via neural networks. For more details see
multinom.
Missing values are allowed but discarded for item estimation. They
must be coded as NA for both, Data and group
arguments.
The ddfMLR() function returns an object of class
"ddfMLR". The output including values of the test
statistics, p-values, and items marked as DDF is displayed by the
print() method.
A list of class "ddfMLR" with the following arguments:
Svalthe values of likelihood ratio test statistics.
mlrPARthe estimates of final model.
mlrSEstandard errors of the estimates of final model.
parM0the estimates of null model.
parM1the estimates of alternative model.
llM0log-likelihood of null model.
llM1log-likelihood of alternative model.
AIC0AIC of null model.
AIC1AIC of alternative model.
BIC0BIC of null model.
BIC1BIC of alternative model.
DDFitemseither the column identifiers of the items which were detected as DDF, or
"No DDF item detected" in case no item was detected as DDF.
typecharacter: type of DDF that was tested.
anchorDIF free items specified by the anchor and purify.
purificationpurify value.
nrPurnumber of iterations in item purification process. Returned only if purify
is TRUE.
ddfPura binary matrix with one row per iteration of item purification and one column per item.
"1" in i-th row and j-th column means that j-th item was identified as DDF in i-th iteration. Returned only
if purify is TRUE.
conv.purilogical indicating whether item purification process converged before the maximal number
nrIter of iterations. Returned only if purify is TRUE.
p.adjust.methodcharacter: method for multiple comparison correction which was applied.
pvalthe p-values by likelihood ratio test.
adj.pvalthe adjusted p-values by likelihood ratio test using p.adjust.method.
dfthe degress of freedom of likelihood ratio test.
alphanumeric: significance level.
Datathe data matrix.
groupthe vector of group membership.
group.nameslevels of grouping variable.
keykey of correct answers.
matchmatching criterion.
For an object of class "ddfMLR" several methods are available (e.g. methods(class = "ddfMLR")).
Adela Hladka (nee Drabinova) 
Institute of Computer Science of the Czech Academy of Sciences 
Faculty of Mathematics and Physics, Charles University 
hladka@cs.cas.cz 
Patricia Martinkova 
Institute of Computer Science of the Czech Academy of Sciences 
martinkova@cs.cas.cz 
Agresti, A. (2010). Analysis of ordinal categorical data. Second edition. John Wiley & Sons.
Hladka, A. (2021). Statistical models for detection of differential item functioning. Dissertation thesis. Faculty of Mathematics and Physics, Charles University.
Hladka, A. & Martinkova, P. (2020). difNLR: Generalized logistic regression models for DIF and DDF detection. The R Journal, 12(1), 300–323, \Sexpr[results=rd]{tools:::Rd_expr_doi("10.32614/RJ-2020-014")}.
plot.ddfMLR for graphical representation of item characteristic curves. 
coef.ddfMLR for extraction of item parameters with their standard errors. 
logLik.ddfMLR, AIC.ddfMLR, BIC.ddfMLR
for extraction of log-likelihood and information criteria. 
p.adjust for multiple comparison corrections. 
multinom for estimation function using neural networks.
## Not run: 
# loading data
data(GMATtest, GMATkey)
Data <- GMATtest[, 1:20] # items
group <- GMATtest[, "group"] # group membership variable
key <- GMATkey # correct answers
# testing both DDF effects
(x <- ddfMLR(Data, group, focal.name = 1, key))
# graphical devices
plot(x, item = "Item1", group.names = c("Group 1", "Group 2"))
plot(x, item = x$DDFitems)
plot(x, item = 1)
# estimated parameters
coef(x)
coef(x, SE = TRUE)
coef(x, SE = TRUE, simplify = TRUE)
# AIC, BIC, log-likelihood
AIC(x)
BIC(x)
logLik(x)
# AIC, BIC, log-likelihood for the first item
AIC(x, item = 1)
BIC(x, item = 1)
logLik(x, item = 1)
# testing both DDF effects with Benjamini-Hochberg adjustment method
ddfMLR(Data, group, focal.name = 1, key, p.adjust.method = "BH")
# testing both DDF effects with item purification
ddfMLR(Data, group, focal.name = 1, key, purify = TRUE)
# testing uniform DDF effects
ddfMLR(Data, group, focal.name = 1, key, type = "udif")
# testing non-uniform DDF effects
ddfMLR(Data, group, focal.name = 1, key, type = "nudif")
# testing both DDF effects with total score as matching criterion
ddfMLR(Data, group, focal.name = 1, key, match = "score")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.