mantelHaenszel {difR}  R Documentation 
MantelHaenszel DIF statistic
Description
Calculates MantelHaenszel statistics for DIF detection.
Usage
mantelHaenszel(data, member, match = "score", correct = TRUE, exact = FALSE,
anchor = 1:ncol(data))
Arguments
data 
numeric: the data matrix (one row per subject, one column per item). 
member 
numeric: the vector of group membership with zero and one entries only. See Details. 
match 
specifies the type of matching criterion. Can be either 
correct 
logical: should the continuity correction be used? (default is 
exact 
logical: should an exact test be computed? (default is 
anchor 
a vector of integer values specifying which items (all by default) are currently considered as anchor (DIF free) items. See Details. 
Details
This command basically computes the MantelHaenszel (1959) statistic in the specific framework of differential item
functioning. It forms the basic command of difMH
and is specifically designed for this call.
The data are passed through the data
argument, with one row per subject and one column per item.
Missing values are allowed for item responses (not for group membership) but must be coded as NA
values. They
are discarded from sumscore computation.
The vector of group membership, specified with member
argument, must hold only zeros and ones, a value of zero
corresponding to the reference group and a value of one to the focal group.
The matching criterion can be either the test score or any other continuous or discrete variable to be passed in the mantelHaenszel
function. This is specified by the match
argument. By default, it takes the value "score"
and the test score (i.e. raw score) is computed. The second option is to assign to match
a vector of continuous or discrete numeric values, which acts as the matching criterion. Note that for consistency this vector should not belong to the data
matrix.
By default, the continuity correction factor 0.5 is used (Holland and Thayer, 1988). One can nevertheless remove it by
specifying correct=FALSE
.
By default, the asymptotic MantelHaenszel statistic is computed. However, the exact statistics and related Pvalues can be obtained by specifying the logical argument exact
to TRUE
. See Agresti (1990, 1992) for further details about exact inference.
Option anchor
sets the items which are considered as anchor items for computing MantelHaenszel statistics. Items
other than the anchor items and the tested item are discarded. anchor
must hold integer values specifying the column numbers of the corresponding anchor items. It is primarily designed to perform item purification.
In addition to the MantelHaenszel statistics to identify DIF items, mantelHaenszel
computes the estimates of the
common odds ratio \alpha_{MH}
which are used for measuring the effect size of the items (Holland and Thayer, 1985, 1988). They are returned in the resAlpha
argument of the output list. Moreover, the logarithm of
\alpha_{MH}
, say \lambda_{MH}
, is asymptotically distributed and its variance is computed and returned into
the varLambda
argument. Note that this variance is the one proposed by Philips and Holland (1987), since it seems
the most accurate expression for the variance of \lambda_{MH}
(Penfield and Camilli, 2007).
Value
A list with several arguments:
resMH 
the vector of the MantelHaenszel DIF statistics (either asymptotic or exact). 
resAlpha 
the vector of the (asymptotic) MantelHaenszel estimates of the common odds ratios. Returned only if

varLambda 
the (asymptotic) variance of the 
Pval 
the exact Pvalues of the MH test. Returned only if 
match 
a character string, either 
Author(s)
Sebastien Beland
Collectif pour le Developpement et les Applications en Mesure et Evaluation (Cdame)
Universite du Quebec a Montreal
sebastien.beland.1@hotmail.com, http://www.cdame.uqam.ca/
David Magis
Department of Psychology, University of Liege
Research Group of Quantitative Psychology and Individual Differences, KU Leuven
David.Magis@uliege.be, http://ppw.kuleuven.be/okp/home/
Gilles Raiche
Collectif pour le Developpement et les Applications en Mesure et Evaluation (Cdame)
Universite du Quebec a Montreal
raiche.gilles@uqam.ca, http://www.cdame.uqam.ca/
References
Agresti, A. (1990). Categorical data analysis. New York: Wiley.
Agresti, A. (1992). A survey of exact inference for contingency tables. Statistical Science, 7, 131177. doi: 10.1214/ss/1177011454
Holland, P. W. and Thayer, D. T. (1985). An alternative definition of the ETS delta scale of item difficulty. Research Report RR8543. Princeton, NJ: Educational Testing Service.
Holland, P. W. and Thayer, D. T. (1988). Differential item performance and the MantelHaenszel procedure. In H. Wainer and H. I. Braun (Ed.), Test validity. Hillsdale, NJ: Lawrence Erlbaum Associates.
Magis, D., Beland, S., Tuerlinckx, F. and De Boeck, P. (2010). A general framework and an R package for the detection of dichotomous differential item functioning. Behavior Research Methods, 42, 847862. doi: 10.3758/BRM.42.3.847
Mantel, N. and Haenszel, W. (1959). Statistical aspects of the analysis of data from retrospective studies of disease. Journal of the National Cancer Institute, 22, 719748.
Penfield, R. D., and Camilli, G. (2007). Differential item functioning and item bias. In C. R. Rao and S. Sinharray (Eds.), Handbook of Statistics 26: Psychometrics (pp. 125167). Amsterdam, The Netherlands: Elsevier.
Philips, A., and Holland, P. W. (1987). Estimators of the MantelHaenszel log oddsratio estimate. Biometrics, 43, 425431. doi: 10.2307/2531824
See Also
Examples
## Not run:
# Loading of the verbal data
data(verbal)
# With and without continuity correction
mantelHaenszel(verbal[,1:24], verbal[,26])
mantelHaenszel(verbal[,1:24], verbal[,26], correct = FALSE)
# Exact test
mantelHaenszel(verbal[,1:24], verbal[,26], exact = TRUE)
# Removing item 6 from the set of anchor items
mantelHaenszel(verbal[,1:24], verbal[,26], anchor = c(1:5,7:24))
## End(Not run)