adjustExtreme {deltaPlotR} | R Documentation |
Adjusting the proportions of correct responses for extreme cases
Description
This command modifies the proportions of correct responses when these equal either zero or one, for compatibility with the Delta plot.
Usage
adjustExtreme(data = NULL, group = NULL, focal.name = NULL, prop,
method = "constraint", const.range = c(0.001, 0.999), nrAdd = 1)
Arguments
data |
numeric: the data matrix: one row per subject, one column per item, with possible entries 0, 1 or NA. Default value is |
group |
numeric or character: a vector of the same length as |
focal.name |
numeric or character: the value used in the |
prop |
numeric: a matrix with one row per item and two columns. The first column holds the percentage of correct responses for each item in the reference group, and the second column holds the same percentages but for the focal group. |
method |
character: the method used to modify the extreme proportions. Possible values are |
const.range |
numeric: a vector of two constraining proportions. Default values are 0.001 and 0.999. Ignored if |
nrAdd |
integer: the number of successes and the number of failures to add to the data in order to adjust the proportions. Default value is 1. Ignored if |
Details
The Delta plot method requires the computation of the proportions o correct responses per item and per group. However, these proportions must be stricly greater than zero and smaller than one, since they are transformed onto z-scores. Thus, extreme proportions must be adjusted for proper use of the Delta plot.
Two approaches are currently implemented and set to adjustExtreme
by the method
argument.
The first method is the constraint method and is set by method="constraint"
. It simply consists in constraining the proportions within a specified range of values in (0,1). This restricted range of values is set by the const.range
argument and takes the default value c(0.001, 0.999)
.
The second method is the so-called add method and is specified by method="add"
. It consists in rabitrarily
adding some successes and the same number of failures to the data, in order to get a modified proportion of successes.
This number of extra successes is set by the nrAdd argument, with default value one. In sum, by default one success one failure is added to the item responses, so that the newly computed proportion of successes is not extreme anymore, yet close to the original value. This default values refers to the so-called Laplace rule (see e.g. Jaynes, 2003).
The input arguments are: the data matrix of item responses (ith possible entries 0, 1 and NA
for missing data),
the vector of group memebership and the numeric (or character) value coding for the focal group. By default they take the
NULL
value so they can be left unassigned, but then only the "constraint" method can be applied. In any case, the
matrix of proportions of correct responses per item and per group of respondents must be specified through the
prop
argument.
Value
A list with the following arguments:
adj.prop |
the restricted proportions, in the same format as the input |
method |
the value of the |
range |
the value of the |
nrAdd |
the value of the |
Author(s)
David Magis
Post-doc Fellow of the National Funds for Scientific Research (FNRS, Belgium)
University of Liege
David.Magis@ulg.ac.be, http://ppw.kuleuven.be/okp/home/
Bruno Facon
Professor, Department of Psychology
Universite Lille-Nord de France
bruno.facon@univ-lille3.fr,
References
Angoff, W. H. and Ford, S. F. (1973). Item-race interaction on a test of scholastic aptitude. Journal of Educational Measurement, 10, 95-106.
Jaynes, E.T. (2003). Probability theory: The logic of science. Cambridge, UK: Cambridge University Press.
Magis, D., and Facon, B. (2012). Angoff's Delta method revisited: improving the DIF detection under small samples. British Journal of Mathematical and Statistical Psychology, 65, 302-321.
Magis, D. and Facon, B. (2014). deltaPlotR: An R Package for Differential Item Functioning Analysis with Angoff's Delta Plot. Journal of Statistical Software, Code Snippets, 59(1), 1-19. URL http://www.jstatsoft.org/v59/c01/
See Also
Examples
# Loading of the verbal data
data(verbal)
attach(verbal)
# Excluding the "Anger" variable
verbal <- verbal[colnames(verbal)!="Anger"]
# Computing the proportions of correct answers per group
prop <- matrix(NA, 24, 2)
for (i in 1:24){
prop[i,1] <- mean(verbal[verbal[,25]==0,i], na.rm=TRUE)
prop[i,2] <- mean(verbal[verbal[,25]==1,i], na.rm=TRUE)
}
# "constraint" method
adjustExtreme(data=verbal[,1:24], group=verbal[,25], focal.name=1, prop=prop)
# "constraint" method with differently specified range
adjustExtreme(data=verbal[,1:24], group=verbal[,25], focal.name=1, prop=prop,
const.range=c(0.01,0.99))
# "add" method
adjustExtreme(data=verbal[,1:24], group=verbal[,25], focal.name=1, prop=prop,
method="add")
# "add" method with different number of successes added
adjustExtreme(data=verbal[,1:24], group=verbal[,25], focal.name=1, prop=prop,
method="add", nrAdd=2)
# "constraint" method because of lack of provided data
adjustExtreme(prop=prop)