Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/adjustExtreme.R

This command modifies the proportions of correct responses when these equal either zero or one, for compatibility with the Delta plot.

1 2 |

`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 |

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.

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 |

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,

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/

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | ```
# 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)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.