Title: | Differential Functioning of Items and Tests |
---|---|
Description: | A set of functions to perform Raju, van der Linden and Fleer's (1995, <doi:10.1177/014662169501900405>) Differential Functioning of Items and Tests (DFIT) analyses. It includes functions to use the Monte Carlo Item Parameter Replication approach (Oshima, Raju, & Nanda, 2006, <doi:10.1111/j.1745-3984.2006.00001.x>) for obtaining the associated statistical significance tests cut-off points. They may also be used for a priori and post-hoc power calculations (Cervantes, 2017, <doi:10.18637/jss.v076.i05>). |
Authors: | Victor H. Cervantes <[email protected]> |
Maintainer: | Victor H. Cervantes <[email protected]> |
License: | GPL (>= 2) |
Version: | 1.2 |
Built: | 2025-02-19 04:44:57 UTC |
Source: | https://github.com/herulor/dfit |
Calculates the asymptotic variance for difficulty parameter estimates under the 1pl model
Ase1pl( itemParameters, distribution = "norm", distributionParameters = list(mean = 0, sd = 1), logistic = TRUE, sampleSize = 1, subdivisions = 5000 )
Ase1pl( itemParameters, distribution = "norm", distributionParameters = list(mean = 0, sd = 1), logistic = TRUE, sampleSize = 1, subdivisions = 5000 )
itemParameters |
A matrix or vector containing the item difficulties. |
distribution |
A string character indicating the generic name for the assumed distribution. |
distributionParameters |
A list of extra parameters for the distribution function. |
logistic |
A logical indicating whether the logistic or the normal metric should be used. |
sampleSize |
A value indicating the sample size. |
subdivisions |
A numeric value stating the maximum number of subdivisions for adaptive quadrature. |
ase A list containing the asymptotic variances for each item
Victor H. Cervantes <vhcervantesb at unal.edu.co>
Li, Y. & Lissitz, R. (2004). Applications of the analytically derived standard errors of Item Response Theory item parameter estimates. Journal of educational measurement, 41(2), 85–117. doi:10.1111/j.1745-3984.2004.tb01109.x
Calculates the asymptotic covariance matrix of item parameter estimates under the 2pl model
Ase2pl( itemParameters, distribution = "norm", distributionParameters = list(mean = 0, sd = 1), logistic = TRUE, sampleSize = 1, subdivisions = 5000 )
Ase2pl( itemParameters, distribution = "norm", distributionParameters = list(mean = 0, sd = 1), logistic = TRUE, sampleSize = 1, subdivisions = 5000 )
itemParameters |
A matrix or vector containing the item difficulties. |
distribution |
A string character indicating the generic name for the assumed distribution. |
distributionParameters |
A list of extra parameters for the distribution function. |
logistic |
A logical indicating whether the logistic or the normal metric should be used. |
sampleSize |
A value indicating the sample size. |
subdivisions |
A numeric value stating the maximum number of subdivisions for adaptive quadrature. |
ase A list containing the asymptotic matrices for each item
Victor H. Cervantes <vhcervantesb at unal.edu.co>
Li, Y. & Lissitz, R. (2004). Applications of the analytically derived standard errors of Item Response Theory item parameter estimates. Journal of educational measurement, 41(2), 85–117. doi:10.1111/j.1745-3984.2004.tb01109.x
Calculates the asymptotic covariance matrix of item parameter estimates under the 3pl model
Ase3pl( itemParameters, distribution = "norm", distributionParameters = list(mean = 0, sd = 1), logistic = TRUE, sampleSize = 1, subdivisions = 5000 )
Ase3pl( itemParameters, distribution = "norm", distributionParameters = list(mean = 0, sd = 1), logistic = TRUE, sampleSize = 1, subdivisions = 5000 )
itemParameters |
A matrix or vector containing the item difficulties. |
distribution |
A string character indicating the generic name for the assumed distribution. |
distributionParameters |
A list of extra parameters for the distribution function. |
logistic |
A logical indicating whether the logistic or the normal metric should be used. |
sampleSize |
A value indicating the sample size. |
subdivisions |
A numeric value stating the maximum number of subdivisions for adaptive quadrature. |
ase A list containing the asymptotic matrices for each item
Victor H. Cervantes <vhcervantesb at unal.edu.co>
Li, Y. & Lissitz, R. (2004). Applications of the analytically derived standard errors of Item Response Theory item parameter estimates. Journal of educational measurement, 41(2), 85–117. doi:10.1111/j.1745-3984.2004.tb01109.x
Calculates the asymptotic covariance matrices for item parameters according with the IRT model.
AseIrt( itemParameters, distribution = "norm", distributionParameters = list(mean = 0, sd = 1), logistic = TRUE, sampleSize = 1, irtModel = "3pl", subdivisions = 5000 )
AseIrt( itemParameters, distribution = "norm", distributionParameters = list(mean = 0, sd = 1), logistic = TRUE, sampleSize = 1, irtModel = "3pl", subdivisions = 5000 )
itemParameters |
A matrix or vector containing the item difficulties. |
distribution |
A string character indicating the generic name for the assumed distribution. Defaults to 'norm' for normal distribution. |
distributionParameters |
A list of extra parameters for the distribution function. |
logistic |
A logical indicating whether the logistic or the normal metric should be used. |
sampleSize |
A value indicating the sample size. |
irtModel |
A string stating the IRT model for all items. |
subdivisions |
A numeric value stating the maximum number of subdivisions for adaptive quadrature. |
ase A list containing the asymptotic matrices for each item
Victor H. Cervantes <vhcervantesb at unal.edu.co>
Li, Y. & Lissitz, R. (2004). Applications of the analytically derived standard errors of Item Response Theory item parameter estimates. Journal of educational measurement, 41(2), 85–117. doi:10.1111/j.1745-3984.2004.tb01109.x
# # Not run # # # # data(dichotomousItemParameters) # # threePlParameters <- dichotomousItemParameters # # isNot3Pl <- ((dichotomousItemParameters[['focal']][, 3] == 0) | # # (dichotomousItemParameters[['reference']][, 3] == 0)) # # # # threePlParameters[['focal']] <- threePlParameters[['focal']][!isNot3Pl, ] # # threePlParameters[['reference']] <- threePlParameters[['reference']][!isNot3Pl, ] # # threePlParameters[['focal']][, 3] <- threePlParameters[['focal']][, 3] + 0.1 # # threePlParameters[['reference']][, 3] <- threePlParameters[['reference']][, 3] + 0.1 # # threePlParameters[['focal']][, 2] <- threePlParameters[['focal']][, 2] + 1.5 # # threePlParameters[['reference']][, 2] <- threePlParameters[['reference']][, 2] + 1.5 # # threePlParameters[['focal']] <- threePlParameters[['focal']][-c(12, 16, 28), ] # # threePlParameters[['reference']] <- threePlParameters[['reference']][-c(12, 16, 28), ] # # # # threePlAse <- list() # # threePlAse[["focal"]] <- AseIrt(itemParameters = threePlParameters[["focal"]], # # logistic = TRUE, # # sampleSize = 10000, # # irtModel = "3pl") # # threePlAse[["reference"]] <- AseIrt(itemParameters = threePlParameters[["reference"]], # # logistic = TRUE, # # sampleSize = 15000, # # irtModel = "3pl")
# # Not run # # # # data(dichotomousItemParameters) # # threePlParameters <- dichotomousItemParameters # # isNot3Pl <- ((dichotomousItemParameters[['focal']][, 3] == 0) | # # (dichotomousItemParameters[['reference']][, 3] == 0)) # # # # threePlParameters[['focal']] <- threePlParameters[['focal']][!isNot3Pl, ] # # threePlParameters[['reference']] <- threePlParameters[['reference']][!isNot3Pl, ] # # threePlParameters[['focal']][, 3] <- threePlParameters[['focal']][, 3] + 0.1 # # threePlParameters[['reference']][, 3] <- threePlParameters[['reference']][, 3] + 0.1 # # threePlParameters[['focal']][, 2] <- threePlParameters[['focal']][, 2] + 1.5 # # threePlParameters[['reference']][, 2] <- threePlParameters[['reference']][, 2] + 1.5 # # threePlParameters[['focal']] <- threePlParameters[['focal']][-c(12, 16, 28), ] # # threePlParameters[['reference']] <- threePlParameters[['reference']][-c(12, 16, 28), ] # # # # threePlAse <- list() # # threePlAse[["focal"]] <- AseIrt(itemParameters = threePlParameters[["focal"]], # # logistic = TRUE, # # sampleSize = 10000, # # irtModel = "3pl") # # threePlAse[["reference"]] <- AseIrt(itemParameters = threePlParameters[["reference"]], # # logistic = TRUE, # # sampleSize = 15000, # # irtModel = "3pl")
Makes all simulated guessing values from a 3PL model that are outside the [0, 1] interval to be 0 or 1.
Bound3PlIpr(itemParameterList)
Bound3PlIpr(itemParameterList)
itemParameterList |
A list where each element is a list containing "focal" and "reference" item Parameters from a 3PL model. Item parameters are assumed to be on the same scale. Item parameters for each group should be a matrix with nrow equal to the number of items |
itemParameterList A list where each element is a list containing "focal" and "reference" item Parameters where guessing parameters outside the [0, 1] interval are changed by 0 and 1.
Victor H. Cervantes <vhcervantesb at unal.edu.co>
# # Not run # # # # data(dichotomousItemParameters) # # threePlParameters <- dichotomousItemParameters # # isNot3Pl <- ((dichotomousItemParameters[['focal']][, 3] == 0) | # # (dichotomousItemParameters[['reference']][, 3] == 0)) # # # # threePlParameters[['focal']] <- threePlParameters[['focal']][!isNot3Pl, ] # # threePlParameters[['reference']] <- threePlParameters[['reference']][!isNot3Pl, ] # # threePlParameters[['focal']][, 3] <- threePlParameters[['focal']][, 3] + 0.1 # # threePlParameters[['reference']][, 3] <- threePlParameters[['reference']][, 3] + 0.1 # # threePlParameters[['focal']][, 2] <- threePlParameters[['focal']][, 2] + 1.5 # # threePlParameters[['reference']][, 2] <- threePlParameters[['reference']][, 2] + 1.5 # # threePlParameters[['focal']] <- threePlParameters[['focal']][-c(12, 16, 28), ] # # threePlParameters[['reference']] <- threePlParameters[['reference']][-c(12, 16, 28), ] # # # # threePlAse <- list() # # threePlAse[["focal"]] <- AseIrt(itemParameters = threePlParameters[["focal"]], # # logistic = TRUE, # # sampleSize = 10000, # # irtModel = "3pl") # # threePlAse[["reference"]] <- AseIrt(itemParameters = threePlParameters[["reference"]], # # logistic = TRUE, # # sampleSize = 15000, # # irtModel = "3pl") # # # # set.seed(41568) # # threePlIpr <- Ipr(itemParameters = threePlParameters, itemCovariances = threePlAse, # # nReplicates = 100) # # threePlIpr <- Bound3PlIpr(threePlIpr)
# # Not run # # # # data(dichotomousItemParameters) # # threePlParameters <- dichotomousItemParameters # # isNot3Pl <- ((dichotomousItemParameters[['focal']][, 3] == 0) | # # (dichotomousItemParameters[['reference']][, 3] == 0)) # # # # threePlParameters[['focal']] <- threePlParameters[['focal']][!isNot3Pl, ] # # threePlParameters[['reference']] <- threePlParameters[['reference']][!isNot3Pl, ] # # threePlParameters[['focal']][, 3] <- threePlParameters[['focal']][, 3] + 0.1 # # threePlParameters[['reference']][, 3] <- threePlParameters[['reference']][, 3] + 0.1 # # threePlParameters[['focal']][, 2] <- threePlParameters[['focal']][, 2] + 1.5 # # threePlParameters[['reference']][, 2] <- threePlParameters[['reference']][, 2] + 1.5 # # threePlParameters[['focal']] <- threePlParameters[['focal']][-c(12, 16, 28), ] # # threePlParameters[['reference']] <- threePlParameters[['reference']][-c(12, 16, 28), ] # # # # threePlAse <- list() # # threePlAse[["focal"]] <- AseIrt(itemParameters = threePlParameters[["focal"]], # # logistic = TRUE, # # sampleSize = 10000, # # irtModel = "3pl") # # threePlAse[["reference"]] <- AseIrt(itemParameters = threePlParameters[["reference"]], # # logistic = TRUE, # # sampleSize = 15000, # # irtModel = "3pl") # # # # set.seed(41568) # # threePlIpr <- Ipr(itemParameters = threePlParameters, itemCovariances = threePlAse, # # nReplicates = 100) # # threePlIpr <- Bound3PlIpr(threePlIpr)
Makes all simulated guessing values from a 3PL model that are outside the [0, 1] interval to be 0 or 1.
Bound4PlIpr(itemParameterList)
Bound4PlIpr(itemParameterList)
itemParameterList |
A list where each element is a list containing "focal" and "reference" item Parameters from a 3PL model. Item parameters are assumed to be on the same scale. Item parameters for each group should be a matrix with nrow equal to the number of items |
itemParameterList A list where each element is a list containing "focal" and "reference" item Parameters where guessing parameters outside the [0, 1] interval are changed by 0 and 1.
Victor H. Cervantes <vhcervantesb at unal.edu.co>
# # Not run # # # # data(dichotomousItemParameters) # # threePlParameters <- dichotomousItemParameters # # isNot3Pl <- ((dichotomousItemParameters[['focal']][, 3] == 0) | # # (dichotomousItemParameters[['reference']][, 3] == 0)) # # # # threePlParameters[['focal']] <- threePlParameters[['focal']][!isNot3Pl, ] # # threePlParameters[['reference']] <- threePlParameters[['reference']][!isNot3Pl, ] # # threePlParameters[['focal']][, 3] <- threePlParameters[['focal']][, 3] + 0.1 # # threePlParameters[['reference']][, 3] <- threePlParameters[['reference']][, 3] + 0.1 # # threePlParameters[['focal']][, 2] <- threePlParameters[['focal']][, 2] + 1.5 # # threePlParameters[['reference']][, 2] <- threePlParameters[['reference']][, 2] + 1.5 # # threePlParameters[['focal']] <- threePlParameters[['focal']][-c(12, 16, 28), ] # # threePlParameters[['reference']] <- threePlParameters[['reference']][-c(12, 16, 28), ] # # # # threePlAse <- list() # # threePlAse[["focal"]] <- AseIrt(itemParameters = threePlParameters[["focal"]], # # logistic = TRUE, # # sampleSize = 10000, # # irtModel = "3pl") # # threePlAse[["reference"]] <- AseIrt(itemParameters = threePlParameters[["reference"]], # # logistic = TRUE, # # sampleSize = 15000, # # irtModel = "3pl") # # # # set.seed(41568) # # threePlIpr <- Ipr(itemParameters = threePlParameters, itemCovariances = threePlAse, # # nReplicates = 100) # # threePlIpr <- Bound3PlIpr(threePlIpr)
# # Not run # # # # data(dichotomousItemParameters) # # threePlParameters <- dichotomousItemParameters # # isNot3Pl <- ((dichotomousItemParameters[['focal']][, 3] == 0) | # # (dichotomousItemParameters[['reference']][, 3] == 0)) # # # # threePlParameters[['focal']] <- threePlParameters[['focal']][!isNot3Pl, ] # # threePlParameters[['reference']] <- threePlParameters[['reference']][!isNot3Pl, ] # # threePlParameters[['focal']][, 3] <- threePlParameters[['focal']][, 3] + 0.1 # # threePlParameters[['reference']][, 3] <- threePlParameters[['reference']][, 3] + 0.1 # # threePlParameters[['focal']][, 2] <- threePlParameters[['focal']][, 2] + 1.5 # # threePlParameters[['reference']][, 2] <- threePlParameters[['reference']][, 2] + 1.5 # # threePlParameters[['focal']] <- threePlParameters[['focal']][-c(12, 16, 28), ] # # threePlParameters[['reference']] <- threePlParameters[['reference']][-c(12, 16, 28), ] # # # # threePlAse <- list() # # threePlAse[["focal"]] <- AseIrt(itemParameters = threePlParameters[["focal"]], # # logistic = TRUE, # # sampleSize = 10000, # # irtModel = "3pl") # # threePlAse[["reference"]] <- AseIrt(itemParameters = threePlParameters[["reference"]], # # logistic = TRUE, # # sampleSize = 15000, # # irtModel = "3pl") # # # # set.seed(41568) # # threePlIpr <- Ipr(itemParameters = threePlParameters, itemCovariances = threePlAse, # # nReplicates = 100) # # threePlIpr <- Bound3PlIpr(threePlIpr)
Calculates the item success probability under the 1PL model.
Calculate1plProb(thetaValue, itemParameters, logistic = TRUE)
Calculate1plProb(thetaValue, itemParameters, logistic = TRUE)
thetaValue |
A numeric value or array for the theta (ability) value(s) where the difference will be calculated |
itemParameters |
A vector or column matrix containing the numeric values of item difficulties |
logistic |
A logical value stating if the IRT model will use the logistic or the normal metric. |
probabilities A numeric matrix with the probabilities on each thetaValue for each item.
Victor H. Cervantes <vhcervantesb at unal.edu.co>
de Ayala, R. J., (2009). The theory and practice of item response theory. New York: The Guildford Press
Calculates the item success probability under the 2PL model.
Calculate2plProb(thetaValue, itemParameters, logistic = TRUE)
Calculate2plProb(thetaValue, itemParameters, logistic = TRUE)
thetaValue |
A numeric value or array for the theta (ability) value(s) where the difference will be calculated |
itemParameters |
A matrix containing the numeric values of item discriminations on the first column and item difficulties on the second |
logistic |
A logical value stating if the IRT model will use the logistic or the normal metric. |
probabilities A numeric matrix with the probabilities on each thetaValue for each item.
Victor H. Cervantes <vhcervantesb at unal.edu.co>
de Ayala, R. J., (2009). The theory and practice of item response theory. New York: The Guildford Press
Calculates the item success probability under the 3PL model.
Calculate3plProb(thetaValue, itemParameters, logistic = TRUE)
Calculate3plProb(thetaValue, itemParameters, logistic = TRUE)
thetaValue |
A numeric value or array for the theta (ability) value(s) where the difference will be calculated |
itemParameters |
A matrix containing the numeric values of item discriminations on the first column, item difficulties on the second and item guessing parameters on the third |
logistic |
A logical value stating if the IRT model will use the logistic or the normal metric. |
probabilities A numeric matrix with the probabilities on each thetaValue for each item.
Victor H. Cervantes <vhcervantesb at unal.edu.co>
de Ayala, R. J., (2009). The theory and practice of item response theory. New York: The Guildford Press
Calculates the item success probability under the 4PL model.
Calculate4plProb(thetaValue, itemParameters, logistic = TRUE)
Calculate4plProb(thetaValue, itemParameters, logistic = TRUE)
thetaValue |
A numeric value or array for the theta (ability) value(s) where the difference will be calculated |
itemParameters |
A matrix containing the numeric values of item discriminations on the first column, item difficulties on the second, item guessing parameters on the third, and item upper asymptote on the fourth |
logistic |
A logical value stating if the IRT model will use the logistic or the normal metric. |
probabilities A numeric matrix with the probabilities on each thetaValue for each item.
Victor H. Cervantes <vhcervantesb at unal.edu.co>
de Ayala, R. J., (2009). The theory and practice of item response theory. New York: The Guildford Press
Calculates the expected item score under the GRM model.
CalculateGrmExp(thetaValue, itemParameters, logistic = TRUE)
CalculateGrmExp(thetaValue, itemParameters, logistic = TRUE)
thetaValue |
A numeric value or array for the theta (ability) value(s) where the difference will be calculated |
itemParameters |
A matrix containing the numeric values of item discriminations on the first column and category thresholds on the rest columns where the (column position - 1) indicates the category score or weight. |
logistic |
A logical value stating if the IRT model will use the logistic or the normal metric. |
expectedScore A numeric matrix with the expected score on each thetaValue for each item.
Victor H. Cervantes <vhcervantesb at unal.edu.co>
de Ayala, R. J., (2009). The theory and practice of item response theory. New York: The Guildford Press
Oshima, T. & Morris, S. (2008). Raju's Differential Functioning of Items and Tests (DFIT). Educational Measurement: Issues and Practice, 27(3), 43–50. doi:10.1111/j.1745-3992.2008.00127.x
Calculates the differences between two item option characteristic curves for all options (minus one).
CalculateItemDifferences( thetaValue, itemParameters, irtModel = "2pl", logistic = TRUE )
CalculateItemDifferences( thetaValue, itemParameters, irtModel = "2pl", logistic = TRUE )
thetaValue |
A numeric value or array for the theta (ability) value(s) for which the difference will be calculated |
itemParameters |
A list containing "focal" and "reference" item parameters. Item parameters are assumed to be on the same scale. Item parameters for each group should me a matrix with nrow equal to the number of items. |
irtModel |
A string stating the irtModel to be used. Should be one of "1pl", "2pl", "3pl", "grm" or "pcm". |
logistic |
A logical value stating if the IRT model will use the logistic or the normal metric. |
difference A numeric matrix with the differences on probabilities or on expected score for each item between focal and reference groups.
Victor H. Cervantes <vhcervantesb at unal.edu.co>
Calculates the expected item score under the (G)PCM model.
CalculatePcmExp(thetaValue, itemParameters, logistic = TRUE)
CalculatePcmExp(thetaValue, itemParameters, logistic = TRUE)
thetaValue |
A numeric value or array for the theta (ability) value(s) where the difference will be calculated |
itemParameters |
A matrix containing the numeric values of item discriminations on the first column and category thresholds on the rest columns where the (column position - 1) indicates the category score or weight. |
logistic |
A logical value stating if the IRT model will use the logistic or the normal metric. |
expectedScore A numeric matrix with the expected score on each thetaValue for each item.
Victor H. Cervantes <vhcervantesb at unal.edu.co>
de Ayala, R. J., (2009). The theory and practice of item response theory. New York: The Guildford Press
Oshima, T. & Morris, S. (2008). Raju's Differential Functioning of Items and Tests (DFIT). Educational Measurement: Issues and Practice, 27(3), 43–50. doi:10.1111/j.1745-3992.2008.00127.x
Calculates CDIF index for an item with given item parameters of focal and reference groups.
Cdif( itemParameters, irtModel = "2pl", focalAbilities = NULL, focalDistribution = "norm", subdivisions = 5000, logistic = TRUE, focalDistrExtra = list(mean = 0, sd = 1) )
Cdif( itemParameters, irtModel = "2pl", focalAbilities = NULL, focalDistribution = "norm", subdivisions = 5000, logistic = TRUE, focalDistrExtra = list(mean = 0, sd = 1) )
itemParameters |
A list containing "focal" and "reference" item parameters. Item parameters are assumed to be on the same scale. Item parameters for each group should me a matrix with nrow equal to the number of items. |
irtModel |
A string stating the irtModel to be used. Should be one of "1pl", "2pl", "3pl", "grm" or "pcm". |
focalAbilities |
If NULL, NCDIF is calculated by numerical integration of focal distribution. If not NULL, it must be a numerical vector containing the abilities for the individuals in the focal group. |
focalDistribution |
A string stating the distribution name to be used for integrating. Only used if focalAbilities is NULL. |
subdivisions |
A numeric value indicating the number of subdivisions for numerical integration. Only used if focalAbilities is NULL. |
logistic |
A logical value stating if the IRT model will use the logistic or the normal metric. Defaults to using the logistic metric by fixing the D constant to 1. If FALSE the constant is set to 1.702 so that the normal metric is used. |
focalDistrExtra |
Extra parameters for the focal group distribution function if needed. |
cdif Numeric vector with the CDIF index value for each item.
Victor H. Cervantes <vhcervantesb at unal.edu.co>
Raju, N. S., van der Linden, W. J., & Fleer, P. F. (1995). IRT-based internal measures of differential functioning of items and tests. Applied Psychological Measurement, 19, 353–368. doi:10.1177/014662169501900405
# # Not run # # # # data(dichotomousItemParameters) # # # # threePlParameters <- dichotomousItemParameters # # isNot3Pl <- ((dichotomousItemParameters[['focal']][, 3] == 0) | # # (dichotomousItemParameters[['reference']][, 3] == 0)) # # # # threePlParameters[['focal']] <- threePlParameters[['focal']][!isNot3Pl, ] # # threePlParameters[['reference']] <- threePlParameters[['reference']][!isNot3Pl, ] # # threePlParameters[['focal']][, 3] <- threePlParameters[['focal']][, 3] + 0.1 # # threePlParameters[['reference']][, 3] <- threePlParameters[['reference']][, 3] + 0.1 # # threePlParameters[['focal']][, 2] <- threePlParameters[['focal']][, 2] + 1.5 # # threePlParameters[['reference']][, 2] <- threePlParameters[['reference']][, 2] + 1.5 # # threePlParameters[['focal']] <- threePlParameters[['focal']][-c(12, 16, 28), ] # # threePlParameters[['reference']] <- threePlParameters[['reference']][-c(12, 16, 28), ] # # # # threePlCdif <- Cdif(itemParameters = dichotomousItemParameters, irtModel = '3pl', # # focalAbilities = NULL, focalDistribution = "norm", # # subdivisions = 5000, logistic = TRUE)
# # Not run # # # # data(dichotomousItemParameters) # # # # threePlParameters <- dichotomousItemParameters # # isNot3Pl <- ((dichotomousItemParameters[['focal']][, 3] == 0) | # # (dichotomousItemParameters[['reference']][, 3] == 0)) # # # # threePlParameters[['focal']] <- threePlParameters[['focal']][!isNot3Pl, ] # # threePlParameters[['reference']] <- threePlParameters[['reference']][!isNot3Pl, ] # # threePlParameters[['focal']][, 3] <- threePlParameters[['focal']][, 3] + 0.1 # # threePlParameters[['reference']][, 3] <- threePlParameters[['reference']][, 3] + 0.1 # # threePlParameters[['focal']][, 2] <- threePlParameters[['focal']][, 2] + 1.5 # # threePlParameters[['reference']][, 2] <- threePlParameters[['reference']][, 2] + 1.5 # # threePlParameters[['focal']] <- threePlParameters[['focal']][-c(12, 16, 28), ] # # threePlParameters[['reference']] <- threePlParameters[['reference']][-c(12, 16, 28), ] # # # # threePlCdif <- Cdif(itemParameters = dichotomousItemParameters, irtModel = '3pl', # # focalAbilities = NULL, focalDistribution = "norm", # # subdivisions = 5000, logistic = TRUE)
Identifies items with nonpositive discrimination
CheckDiscriminations(itemParameters)
CheckDiscriminations(itemParameters)
itemParameters |
A vector or column matrix containing the numeric values of item difficulties |
message A character string used to signal items with nonpsitive discriminations
Victor H. Cervantes <vhcervantesb at unal.edu.co>
Identifies items with guessing outside [0, 1]
CheckGuessings(itemParameters)
CheckGuessings(itemParameters)
itemParameters |
A vector or column matrix containing the numeric values of item difficulties |
message A character string used to signal items iadmissible guessing parameters
Victor H. Cervantes <vhcervantesb at unal.edu.co>
Identifies items with upper asymptote outside [0, 1]
CheckUpper(itemParameters)
CheckUpper(itemParameters)
itemParameters |
A vector or column matrix containing the numeric values of item difficulties |
message A character string used to signal items iadmissible guessing parameters
Victor H. Cervantes <vhcervantesb at unal.edu.co>
Calculates the crossed probabilities associated with the numerator and denominator of the odds-ratio under dichotomous IRT models
CrossedProbabilities(thetaValue, itemParameters, logistic, irtModel = "3pl")
CrossedProbabilities(thetaValue, itemParameters, logistic, irtModel = "3pl")
thetaValue |
A numeric value or array for the theta (ability) value(s) for which the odds will be calculated |
itemParameters |
A list containing the "focal" and "reference" item parameters. Item parameters are assumed to be on the same scale. |
logistic |
A logical indicating whether the logistic or the normal metric should be used. |
irtModel |
A string stating the irtModel used. May be one of "1pl", "2pl", or "3pl". |
out A list containing the crossed products for the 'num' the numerator, 'den' the denominator for the odds-ratio, and 'or' the odds-ratio
Victor H. Cervantes <vhcervantesb at unal.edu.co>
Roussos, L., Schnipke, D. & Pashley, P. (1999). A generalized formula for the Mantel-Haenszel Differential Item Functioning parameter. Journal of educational and behavioral statistics, 24(3), 293–322. doi:10.3102/10769986024003293
Calculates a given quantile cut-off point for each item on the IPR estimated items statistics. This function may produce the cut-off points for the NCDIF index, Signed and Unsigned Area Measures and the Mantel-Haenszel statistic based on the Monte Carlo Item parameter replication approach. The quantiles may be calculated directly on the output from the IprNcdif, IprSam, IprUam, and IprMh functions; the may be calculated by obtaining the corresponding statistics for the item parameters simulated under the IPR approach; or by obatining both the simulated item parameters and the statistics based on the item parameter values and their corresponging covariance matrices for the parameter estimates. In the latter case, the user may choose to obtain the IPR simulated item parameters based only on the focal group's covariance matrix as proposed by Oshima et al. (2006), or both focal and reference groups' matrices as proposed by Cervantes (2012).
CutoffIpr( iprStatistics = NULL, quantiles, statistic = "ncdif", itemParameterList = NULL, irtModel = "2pl", focalAbilities = NULL, focalDistribution = "norm", focalDistrExtra = list(mean = 0, sd = 1), referenceDistribution = "norm", referenceDistrExtra = list(mean = 0, sd = 1), groupRatio = 1, subdivisions = 5000, logistic = TRUE, itemParameters = NULL, itemCovariances = NULL, nullGroup = NULL, focalSampleSize = NULL, referenceSampleSize = NULL, nReplicates = 5000 )
CutoffIpr( iprStatistics = NULL, quantiles, statistic = "ncdif", itemParameterList = NULL, irtModel = "2pl", focalAbilities = NULL, focalDistribution = "norm", focalDistrExtra = list(mean = 0, sd = 1), referenceDistribution = "norm", referenceDistrExtra = list(mean = 0, sd = 1), groupRatio = 1, subdivisions = 5000, logistic = TRUE, itemParameters = NULL, itemCovariances = NULL, nullGroup = NULL, focalSampleSize = NULL, referenceSampleSize = NULL, nReplicates = 5000 )
iprStatistics |
A numeric matrix with the statistics obtained for the simulated IPR item parameters or a list containing all the elements of the output of this function. If not NULL they will be used for calculating the cut-off points. |
quantiles |
A numeric vector with the quantiles to be calculated. |
statistic |
A character indicating which statistic will the cut-off point will be obtained for. If iprStatistics are provided, it is up to the user to correctly especify this string for it will only be informative; otherwise, it will be used to identify the statistic to be calculated. Should be one of "ncdif", "sam", "uam" or "mh". |
itemParameterList |
A list where each element is a list containing "focal" and "reference" item Parameters. Item parameters are assumed to be on the same scale. Item parameters for each group should be a matrix with nrow equal to the number of items. Not used if iprStatistics are not NULL. If itemParameterList is not NULL, the statistic indicated with the argument "statistic" will be obtained for the set of itemParameterList, the corresponding arguments may be provided. |
irtModel |
A string stating the irtModel to be used. Should be one of "1pl", "2pl", "3pl", "grm" or "pcm". Not used if iprStatistics are not NULL. |
focalAbilities |
Only used if statistic is "ncdif". If NULL, NCDIF is calculated by numerical integration of focal distribution. If not NULL, must be a numerical vector containing the abilities for the individuals in the focal group. |
focalDistribution |
A string stating the distribution assumed for the focal group. Not used if iprStatistics are not NULL. |
focalDistrExtra |
A list stating the extra parameters needed by the focal distribution function. Not used if iprStatistics are not NULL. |
referenceDistribution |
A string stating the distribution assumed for the reference group. Not used if iprStatistics are not NULL. |
referenceDistrExtra |
A list stating the extra parameters needed by the reference distribution function. Not used if iprStatistics are not NULL. |
groupRatio |
A positive value indicating how many members of the reference group are expected for each member of the focal group. Only used if iprStatistics are NULL and statistic is "mh". |
subdivisions |
A numeric value indicating the number of subdivisions for numerical integration. Only used if focalAbilities and iprStatistics are NULL. |
logistic |
A logical value stating if the IRT model will use the logistic or the normal metric. Defaults to using the logistic metric by fixing the D constant to 1. If FALSE the constant is set to 1.702 so that the normal metric is used. |
itemParameters |
A list containing "focal" and "reference" item parameters. Item parameters are assumed to be on the same scale. Item parameters for each group should me a matrix with nrow equal to the number of items. Only used if both iprStatistics and itemParameterList are NULL. If used an itemParameterList from applying the IPR procedure will be simulated and the "statistic" will be calculated. |
itemCovariances |
Either a list containing "focal" and "reference" lists of matrices of covariance for item estimates or the string "asymptotic". Defaults to NULL. Only used if iprStatistics and itemParameterList are NULL, in all other cases the itemCovariances element of the returned list is equal to what is provided as value for these arguments. |
nullGroup |
If different from NULL and itemParameterList is NULL, a string equal to 'focal' or 'reference' to indicate which set of item parameters from itemParameters should be taken for the null hypothesis. If equal to NULL, itemParameterList will be generated using the given itemParameters for both groups. |
focalSampleSize |
A positive integer indicating the size of the focal group. Only used if itemCovariances is 'asymptotic'. Defaults to NULL. |
referenceSampleSize |
A positive integer indicating the size of the reference group. Only used if itemCovariances is 'asymptotic'. Defaults to NULL. |
nReplicates |
A numeric value indicating the number of replications to perform. Only used if iprStatistics and itemParameterList are NULL. |
cutoff A list containing: 'itemParameters', NULL if not provided as argument, 'itemCovariances', NULL if not provided as argument, 'itemParameterList', NULL unless calculated from 'itemParameters' or provided as argument, 'iprStatistics' the matrix of 'statistics' provided as argument or calculated from 'itemParameterList', 'statistic' for which the IPR approach is used according to the provided argument, 'quantiles' the vector or matrix of calculated quantiles for each item
Victor H. Cervantes <vhcervantesb at unal.edu.co>
Cervantes, V. H. (2012). On using the Item Parameter Replication (IPR) approach for power calculation of the noncompensatory differential item functioning (NCDIF) index (pp. 206-207). Proceedings of the V European Congress of Methodology. Santiago de Compostela, Spain: Universidade de Santiago de Compostela.
Cervantes, V. H. (2017). DFIT: An R Package for Raju's Differential Functioning of Items and Tests Framework. Journal of Statistical Software, 76(5), 1-24. doi:10.18637/jss.v076.i05
Oshima, T., Raju, N. & Nanda, A. (2006). A new method for assessing the statistical significance in the Differential Functioning of Items and Tests (DFIT) framework. Journal of educational measurement, 43(1), 1–17. doi:10.1111/j.1745-3984.2006.00001.x
Raju, N. (1988). The area between two item characteristic cureves. Psychometricka, 53(4), 495–502. doi:10.1007/bf02294403
Roussos, L., Schnipke, D. & Pashley, P. (1999). A generalized formula for the Mantel-Haenszel Differential Item Functioning parameter. Journal of educational and behavioral statistics, 24(3), 293–322. doi:10.3102/10769986024003293
# # Not run # # # # data(dichotomousItemParameters) # # threePlParameters <- dichotomousItemParameters # # isNot3Pl <- ((dichotomousItemParameters[['focal']][, 3] == 0) | # # (dichotomousItemParameters[['reference']][, 3] == 0)) # # # # threePlParameters[['focal']] <- threePlParameters[['focal']][!isNot3Pl, ] # # threePlParameters[['reference']] <- threePlParameters[['reference']][!isNot3Pl, ] # # threePlParameters[['focal']][, 3] <- threePlParameters[['focal']][, 3] + 0.1 # # threePlParameters[['reference']][, 3] <- threePlParameters[['reference']][, 3] + 0.1 # # threePlParameters[['focal']][, 2] <- threePlParameters[['focal']][, 2] + 1.5 # # threePlParameters[['reference']][, 2] <- threePlParameters[['reference']][, 2] + 1.5 # # threePlParameters[['focal']] <- threePlParameters[['focal']][-c(12, 16, 28), ] # # threePlParameters[['reference']] <- threePlParameters[['reference']][-c(12, 16, 28), ] # # # # threePlAse <- list() # # threePlAse[["focal"]] <- AseIrt(itemParameters = threePlParameters[["focal"]], # # logistic = TRUE, # # sampleSize = 10000, # # irtModel = "3pl") # # threePlAse[["reference"]] <- AseIrt(itemParameters = threePlParameters[["reference"]], # # logistic = TRUE, # # sampleSize = 15000, # # irtModel = "3pl") # # # # set.seed(41568) # # # # threePlIprCutoff <- CutoffIpr(itemParameters = threePlParameters, # # itemCovariances = threePlAse, nullGroup = 'focal', # # nReplicates = 1000, statistic = 'ncdif', irtModel = '3pl')
# # Not run # # # # data(dichotomousItemParameters) # # threePlParameters <- dichotomousItemParameters # # isNot3Pl <- ((dichotomousItemParameters[['focal']][, 3] == 0) | # # (dichotomousItemParameters[['reference']][, 3] == 0)) # # # # threePlParameters[['focal']] <- threePlParameters[['focal']][!isNot3Pl, ] # # threePlParameters[['reference']] <- threePlParameters[['reference']][!isNot3Pl, ] # # threePlParameters[['focal']][, 3] <- threePlParameters[['focal']][, 3] + 0.1 # # threePlParameters[['reference']][, 3] <- threePlParameters[['reference']][, 3] + 0.1 # # threePlParameters[['focal']][, 2] <- threePlParameters[['focal']][, 2] + 1.5 # # threePlParameters[['reference']][, 2] <- threePlParameters[['reference']][, 2] + 1.5 # # threePlParameters[['focal']] <- threePlParameters[['focal']][-c(12, 16, 28), ] # # threePlParameters[['reference']] <- threePlParameters[['reference']][-c(12, 16, 28), ] # # # # threePlAse <- list() # # threePlAse[["focal"]] <- AseIrt(itemParameters = threePlParameters[["focal"]], # # logistic = TRUE, # # sampleSize = 10000, # # irtModel = "3pl") # # threePlAse[["reference"]] <- AseIrt(itemParameters = threePlParameters[["reference"]], # # logistic = TRUE, # # sampleSize = 15000, # # irtModel = "3pl") # # # # set.seed(41568) # # # # threePlIprCutoff <- CutoffIpr(itemParameters = threePlParameters, # # itemCovariances = threePlAse, nullGroup = 'focal', # # nReplicates = 1000, statistic = 'ncdif', irtModel = '3pl')
Obtains the ETS Delta measure for Mantel-Haneszel DIF statistic effect size.
DeltaMhIrt(mh, logistic = FALSE)
DeltaMhIrt(mh, logistic = FALSE)
mh |
A numeric vector containing the MH statistic values |
logistic |
A logical indicating whether the logistic or the normal metric should be used. |
delta A numeric vector containing the delta values
Victor H. Cervantes <vhcervantesb at unal.edu.co>
Holland, P.W., and Thayer, D.T. (1988). Differential Item Performance and the Mantel-Haenszel Procedure. In H. Wainer and H.I. Braun (Eds.), Test Validity. Hillsdale, NJ: Erlbaum.
data(dichotomousItemParameters) threePlParameters <- dichotomousItemParameters isNot3Pl <- ((dichotomousItemParameters[['focal']][, 3] == 0) | (dichotomousItemParameters[['reference']][, 3] == 0)) threePlParameters[['focal']] <- threePlParameters[['focal']][!isNot3Pl, ] threePlParameters[['reference']] <- threePlParameters[['reference']][!isNot3Pl, ] threePlParameters[['focal']][, 3] <- threePlParameters[['focal']][, 3] + 0.1 threePlParameters[['reference']][, 3] <- threePlParameters[['reference']][, 3] + 0.1 threePlParameters[['focal']][, 2] <- threePlParameters[['focal']][, 2] + 1.5 threePlParameters[['reference']][, 2] <- threePlParameters[['reference']][, 2] + 1.5 threePlParameters[['focal']] <- threePlParameters[['focal']][-c(12, 16, 28), ] threePlParameters[['reference']] <- threePlParameters[['reference']][-c(12, 16, 28), ] threePlMh <- IrtMh(itemParameters = threePlParameters, irtModel = "3pl", focalDistribution = "norm", referenceDistribution = "norm", focalDistrExtra = list(mean = 0, sd = 1), referenceDistrExtra = list(mean = 0, sd = 1), groupRatio = 1, logistic = FALSE) delta3pl <- DeltaMhIrt(threePlMh)
data(dichotomousItemParameters) threePlParameters <- dichotomousItemParameters isNot3Pl <- ((dichotomousItemParameters[['focal']][, 3] == 0) | (dichotomousItemParameters[['reference']][, 3] == 0)) threePlParameters[['focal']] <- threePlParameters[['focal']][!isNot3Pl, ] threePlParameters[['reference']] <- threePlParameters[['reference']][!isNot3Pl, ] threePlParameters[['focal']][, 3] <- threePlParameters[['focal']][, 3] + 0.1 threePlParameters[['reference']][, 3] <- threePlParameters[['reference']][, 3] + 0.1 threePlParameters[['focal']][, 2] <- threePlParameters[['focal']][, 2] + 1.5 threePlParameters[['reference']][, 2] <- threePlParameters[['reference']][, 2] + 1.5 threePlParameters[['focal']] <- threePlParameters[['focal']][-c(12, 16, 28), ] threePlParameters[['reference']] <- threePlParameters[['reference']][-c(12, 16, 28), ] threePlMh <- IrtMh(itemParameters = threePlParameters, irtModel = "3pl", focalDistribution = "norm", referenceDistribution = "norm", focalDistrExtra = list(mean = 0, sd = 1), referenceDistrExtra = list(mean = 0, sd = 1), groupRatio = 1, logistic = FALSE) delta3pl <- DeltaMhIrt(threePlMh)
DFIT
provides functions for calculating the differential item and test functioning
proposed by Raju et al. (1995).
DFIT provides a set of functions to calculate the noncompensatory (NCDIF), compensatory (CDIF) and test level (DTF) differential functioning indices for items and tests under Raju's (Raju, et al. 1995) DFIT framework. It also provides functions for obtaining cut-off points for identifying differential functioning for these indices following the Monte Carlo Item Parameter Replication approach proposed by Oshima et al. (2006).
This package also improves upon available DFIT software by allowing the covariance matrices for both focal and reference groups to be used. This improves the obtained cut-off points, which result in type I error rates at the nominal level, and increased power, when compared to the cut-off points obtained when using only the focal group item parameter estimates and their estimate covariances (Cervantes, 2012). Furthermore, this package includes functions for obtaining the asymptotic covariance matrices of item parameter estimates (currently only for dichotomous IRT models) and for calculating the DFIT indices base on the focal group distribution as well as ability estimates for a sample from the focal population are included; these enable ad hoc and a priori power calculations for given item parameters and sample sizes to be possible with this package.
de Ayala, R. J., (2009). The theory and practice of item response theory. New York: The Guildford Press
Cervantes, V. H. (2012). On using the Item Parameter Replication (IPR) approach for power calculation of the noncompensatory differential item functioning (NCDIF) index (pp. 206-207). Proceedings of the V European Congress of Methodology. Santiago de Compostela, Spain: Universidade de Santiago de Compostela.
Cervantes, V. H. (2017). DFIT: An R Package for Raju's Differential Functioning of Items and Tests Framework. Journal of Statistical Software, 76(5), 1-24. doi:10.18637/jss.v076.i05
Cohen, A., Kim, S-H and Baker, F. (1993). Detection of differential item functioning in the Graded Response Moodel. Applied psychological measurement, 17(4), 335-350. doi:10.1177/014662169301700402
Holland, P.W., and Thayer, D.T. (1988). Differential Item Performance and the Mantel-Haenszel Procedure. In H. Wainer and H.I. Braun (Eds.), Test Validity. Hillsdale, NJ: Erlbaum.
Li, Y. & Lissitz, R. (2004). Applications of the analytically derived standard errors of Item Response Theory item parameter estimates. Journal of educational measurement, 41(2), 85–117. doi:10.1111/j.1745-3984.2004.tb01109.x
Oshima, T. & Morris, S. (2008). Raju's Differential Functioning of Items and Tests (DFIT). Educational Measurement: Issues and Practice, 27(3), 43–50. doi:10.1111/j.1745-3992.2008.00127.x
Oshima, T., Raju, N. & Nanda, A. (2006). A new method for assessing the statistical significance in the Differential Functioning of Items and Tests (DFIT) framework. Journal of educational measurement, 43(1), 1–17. doi:10.1111/j.1745-3984.2006.00001.x
Raju, N. (1988). The area between two item characteristic cureves. Psychometricka, 53(4), 495–502. doi:10.1007/bf02294403
Raju, N., Fortmann-Johnson, K., Kim, W., Morris, S., Nering, M. & Oshima, T. (2009). The item parameter replication method for detecting differential functioning in the polytomous DFIT framework. Applied psychological measurement, 33(2), 133–147. doi:10.1177/0146621608319514
Raju, N. S., van der Linden, W. J., & Fleer, P. F. (1995). IRT-based internal measures of differential functioning of items and tests. Applied Psychological Measurement, 19, 353–368. doi:10.1177/014662169501900405
Roussos, L., Schnipke, D. & Pashley, P. (1999). A generalized formula for the Mantel-Haenszel Differential Item Functioning parameter. Journal of educational and behavioral statistics, 24(3), 293–322. doi:10.3102/10769986024003293
Wright, K. (2011). Improvements for Differential Funtioning of Items and Tests (DFIT): Investigating the addition of reporting an effect size measure and power (Unpublished doctoral dissertation). Georgia State University, USA.
This data set contains the item parameters found in Wright, K. (2011). Improvements for Differential Funtioning of Items and Tests (DFIT): Investigating the addition of reporting an effect size measure and power Unpublished doctoral dissertation). Georgia State University, USA.
data(dichotomousItemParameters)
data(dichotomousItemParameters)
a list with 'focal' and 'reference' elements. Each is a matrix
1 row per item by 3 columns: item discrimination, difficulty and guessing parameters.
This data set contains the item parameters based on those found in Wright, K. (2011).
Wright, K. (2011). Improvements for Differential Funtioning of Items and Tests (DFIT): Investigating the addition of reporting an effect size measure and power (Unpublished doctoral dissertation). Georgia State University, USA.
Calculates DTF index for a set of items with given item parameters of focal and reference groups.
Dtf( cdif = NULL, itemParameters = NULL, irtModel = "2pl", focalAbilities = NULL, focalDistribution = "norm", subdivisions = 5000, logistic = TRUE, focalDistrExtra = list(mean = 0, sd = 1) )
Dtf( cdif = NULL, itemParameters = NULL, irtModel = "2pl", focalAbilities = NULL, focalDistribution = "norm", subdivisions = 5000, logistic = TRUE, focalDistrExtra = list(mean = 0, sd = 1) )
cdif |
A numeric vector of CDIF values for the test items. If NULL it is calculated using itemParameters and the other arguments. |
itemParameters |
A list containing "focal" and "reference" item parameters. Item parameters are assumed to be on the same scale. Only used if cdif is NULL. Item parameters for each group should me a matrix with nrow equal to the number of items. |
irtModel |
A string stating the irtModel to be used. Should be one of "1pl", "2pl", "3pl", "grm" or "pcm". Only used if cdif is NULL. |
focalAbilities |
If NULL, CDIF is calculated by numerical integration of focal distribution. If not NULL, it must be a numerical vector containing the abilities for the individuals in the focal group. Only used if cdif is NULL. |
focalDistribution |
A string stating the distribution name to be used for integrating. Only used if focalAbilities and cdif are NULL. |
subdivisions |
A numeric value indicating the number of subdivisions for numerical integration. Only used if focalAbilities and cdif are NULL. |
logistic |
A logical value stating if the IRT model will use the logistic or the normal metric. Defaults to using the logistic metric by fixing the D constant to 1. If FALSE the constant is set to 1.702 so that the normal metric is used. Only used if cdif is NULL. |
focalDistrExtra |
Extra parameters for the focal group distribution function if needed. |
dtf Numeric vector with the CDIF index value for each item.
Victor H. Cervantes <vhcervantesb at unal.edu.co>
Raju, N. S., van der Linden, W. J., & Fleer, P. F. (1995). IRT-based internal measures of differential functioning of items and tests. Applied Psychological Measurement, 19, 353–368. doi:10.1177/014662169501900405
# # Not run # # # # data(dichotomousItemParameters) # # # # threePlParameters <- dichotomousItemParameters # # isNot3Pl <- ((dichotomousItemParameters[['focal']][, 3] == 0) | # # (dichotomousItemParameters[['reference']][, 3] == 0)) # # # # threePlParameters[['focal']] <- threePlParameters[['focal']][!isNot3Pl, ] # # threePlParameters[['reference']] <- threePlParameters[['reference']][!isNot3Pl, ] # # threePlParameters[['focal']][, 3] <- threePlParameters[['focal']][, 3] + 0.1 # # threePlParameters[['reference']][, 3] <- threePlParameters[['reference']][, 3] + 0.1 # # threePlParameters[['focal']][, 2] <- threePlParameters[['focal']][, 2] + 1.5 # # threePlParameters[['reference']][, 2] <- threePlParameters[['reference']][, 2] + 1.5 # # threePlParameters[['focal']] <- threePlParameters[['focal']][-c(12, 16, 28), ] # # threePlParameters[['reference']] <- threePlParameters[['reference']][-c(12, 16, 28), ] # # # # threePlCdif <- Cdif(itemParameters = threePlParameters, irtModel = '3pl', # # focalAbilities = NULL, focalDistribution = "norm", # # subdivisions = 5000, logistic = TRUE) # # threePlDtf <- Dtf(cdif = threePlCdif)
# # Not run # # # # data(dichotomousItemParameters) # # # # threePlParameters <- dichotomousItemParameters # # isNot3Pl <- ((dichotomousItemParameters[['focal']][, 3] == 0) | # # (dichotomousItemParameters[['reference']][, 3] == 0)) # # # # threePlParameters[['focal']] <- threePlParameters[['focal']][!isNot3Pl, ] # # threePlParameters[['reference']] <- threePlParameters[['reference']][!isNot3Pl, ] # # threePlParameters[['focal']][, 3] <- threePlParameters[['focal']][, 3] + 0.1 # # threePlParameters[['reference']][, 3] <- threePlParameters[['reference']][, 3] + 0.1 # # threePlParameters[['focal']][, 2] <- threePlParameters[['focal']][, 2] + 1.5 # # threePlParameters[['reference']][, 2] <- threePlParameters[['reference']][, 2] + 1.5 # # threePlParameters[['focal']] <- threePlParameters[['focal']][-c(12, 16, 28), ] # # threePlParameters[['reference']] <- threePlParameters[['reference']][-c(12, 16, 28), ] # # # # threePlCdif <- Cdif(itemParameters = threePlParameters, irtModel = '3pl', # # focalAbilities = NULL, focalDistribution = "norm", # # subdivisions = 5000, logistic = TRUE) # # threePlDtf <- Dtf(cdif = threePlCdif)
Extract item discrimination and difficulties and estimate covariance estimates for 2PL items from a fitted mirt object for one or two groups
Extract2PLMirt(mod, focal = NULL, reference = NULL)
Extract2PLMirt(mod, focal = NULL, reference = NULL)
mod |
A mirt object containing the fit of unidimensional model. |
focal |
Character. Required if mod is MultipleGroupClass, focal should coincide with the label for the focal group. If mod is SingleGroupClass, it is ignored. |
reference |
Character. Required if mod is MultipleGroupClass, reference should coincide with the label for the focal group. If mod is SingleGroupClass, it is ignored. |
If mod contains any itemtype == "2PL", a list with the item parameters and the estimate covariances (if available). If mod is SingleGroupClass, the list contains the item parameters as a matrix and the covariances as a list. If mod is MultipleGroupClass, the list contains the item parameters and covariances for the focal and reference groups only.
library(mirt) data <- expand.table(LSAT7) (mod1 <- mirt(data, model = 1, itemtype = "2PL", SE = TRUE)) (DFIT:::Extract2PLMirt(mod1))
library(mirt) data <- expand.table(LSAT7) (mod1 <- mirt(data, model = 1, itemtype = "2PL", SE = TRUE)) (DFIT:::Extract2PLMirt(mod1))
Extract item discrimination, difficulties, and guessing parameters and estimate covariance estimates for 3PL items from a fitted mirt object for one or two groups
Extract3PLMirt(mod, focal = NULL, reference = NULL)
Extract3PLMirt(mod, focal = NULL, reference = NULL)
mod |
A mirt object containing the fit of unidimensional model. |
focal |
Character. Required if mod is MultipleGroupClass, focal should coincide with the label for the focal group. If mod is SingleGroupClass, it is ignored. |
reference |
Character. Required if mod is MultipleGroupClass, reference should coincide with the label for the focal group. If mod is SingleGroupClass, it is ignored. |
If mod contains any itemtype == "3PL", a list with the item parameters and the estimate covariances (if available). If mod is SingleGroupClass, the list contains the item parameters as a matrix and the covariances as a list. If mod is MultipleGroupClass, the list contains the item parameters and covariances for the focal and reference groups only.
library(mirt) data <- expand.table(LSAT7) (mod1 <- mirt(data, model = 1, itemtype = "3PL", SE = TRUE)) (DFIT:::Extract3PLMirt(mod1))
library(mirt) data <- expand.table(LSAT7) (mod1 <- mirt(data, model = 1, itemtype = "3PL", SE = TRUE)) (DFIT:::Extract3PLMirt(mod1))
Extract item discrimination, difficulties, guessing, and upper asymptote parameters and estimate covariance estimates for 4PL items from a fitted mirt object for one or two groups
Extract4PLMirt(mod, focal = NULL, reference = NULL)
Extract4PLMirt(mod, focal = NULL, reference = NULL)
mod |
A mirt object containing the fit of unidimensional model. |
focal |
Character. Required if mod is MultipleGroupClass, focal should coincide with the label for the focal group. If mod is SingleGroupClass, it is ignored. |
reference |
Character. Required if mod is MultipleGroupClass, reference should coincide with the label for the focal group. If mod is SingleGroupClass, it is ignored. |
If mod contains any itemtype == "4PL", a list with the item parameters and the estimate covariances (if available). If mod is SingleGroupClass, the list contains the item parameters as a matrix and the covariances as a list. If mod is MultipleGroupClass, the list contains the item parameters and covariances for the focal and reference groups only.
library(mirt) data <- expand.table(LSAT7) (mod1 <- mirt(data, model = 1, itemtype = "4PL", SE = TRUE)) (DFIT:::Extract4PLMirt(mod1))
library(mirt) data <- expand.table(LSAT7) (mod1 <- mirt(data, model = 1, itemtype = "4PL", SE = TRUE)) (DFIT:::Extract4PLMirt(mod1))
Extract item discrimination and difficulties and estimate covariance estimates for GPCM items from a fitted mirt object for one or two groups
ExtractGPCMMirt(mod, focal = NULL, reference = NULL)
ExtractGPCMMirt(mod, focal = NULL, reference = NULL)
mod |
A mirt object containing the fit of unidimensional model. |
focal |
Character. Required if mod is MultipleGroupClass, focal should coincide with the label for the focal group. If mod is SingleGroupClass, it is ignored. |
reference |
Character. Required if mod is MultipleGroupClass, reference should coincide with the label for the focal group. If mod is SingleGroupClass, it is ignored. |
If mod contains any itemtype == "gpcm", a list with the item parameters and the estimate covariances (if available). If mod is SingleGroupClass, the list contains the item parameters as a matrix and the covariances as a list. If mod is MultipleGroupClass, the list contains the item parameters and covariances for the focal and reference groups only.
library(mirt) (mod1 <- mirt(Science, model = 1, itemtype = "gpcm", SE = TRUE)) (DFIT:::ExtractGPCMMirt(mod1))
library(mirt) (mod1 <- mirt(Science, model = 1, itemtype = "gpcm", SE = TRUE)) (DFIT:::ExtractGPCMMirt(mod1))
Extract item discrimination and difficulties and estimate covariance estimates for GRM items from a fitted mirt object for one or two groups
ExtractGRMMirt(mod, focal = NULL, reference = NULL)
ExtractGRMMirt(mod, focal = NULL, reference = NULL)
mod |
A mirt object containing the fit of unidimensional model. |
focal |
Character. Required if mod is MultipleGroupClass, focal should coincide with the label for the focal group. If mod is SingleGroupClass, it is ignored. |
reference |
Character. Required if mod is MultipleGroupClass, reference should coincide with the label for the focal group. If mod is SingleGroupClass, it is ignored. |
If mod contains any itemtype == "graded", a list with the item parameters and the estimate covariances (if available). If mod is SingleGroupClass, the list contains the item parameters as a matrix and the covariances as a list. If mod is MultipleGroupClass, the list contains the item parameters and covariances for the focal and reference groups only.
library(mirt) (mod1 <- mirt(Science, model = 1, itemtype = "graded", SE = TRUE)) (DFIT:::ExtractGRMMirt(mod1))
library(mirt) (mod1 <- mirt(Science, model = 1, itemtype = "graded", SE = TRUE)) (DFIT:::ExtractGRMMirt(mod1))
Extracts the item parameters from a unidimensional mirt model
ExtractMirtPars(mod, focal = NULL, reference = NULL)
ExtractMirtPars(mod, focal = NULL, reference = NULL)
mod |
A mirt object containing the fit of unidimensional model. |
focal |
Character. Required if mod is MultipleGroupClass, focal should coincide with the label for the focal group. If mod is SingleGroupClass, it is ignored. |
reference |
Character. Required if mod is MultipleGroupClass, reference should coincide with the label for the focal group. If mod is SingleGroupClass, it is ignored. |
If mod contains any itemtype == "gpcm", a list with the item parameters and the estimate covariances (if available). If mod is SingleGroupClass, the list contains the item parameters as a matrix and the covariances as a list. If mod is MultipleGroupClass, the list contains the item parameters and covariances for the focal and reference groups only.
library(mirt) (mod1 <- mirt(Science, model = 1, itemtype = c("graded", "graded", "gpcm", "gpcm"), SE = TRUE)) (ExtractMirtPars(mod1))
library(mirt) (mod1 <- mirt(Science, model = 1, itemtype = c("graded", "graded", "gpcm", "gpcm"), SE = TRUE)) (ExtractMirtPars(mod1))
Extract item difficulties and item difficulty variance estimates for Rasch items from a fitted mirt object for one or two groups
ExtractRaschMirt(mod, focal = NULL, reference = NULL)
ExtractRaschMirt(mod, focal = NULL, reference = NULL)
mod |
A mirt object containing the fit of unidimensional model. |
focal |
Character. See description of 'reference'. |
reference |
Character. If mod is of class MultipleGroupClass and parameters from precisely two groups are to be extracted, 'reference' should coincide with the label for the reference group. If mod is of class MultipleGroupClass and parameers from all groups are to be extracted, 'reference' should be NULL. If mod is SingleGroupClass, it is ignored. |
If mod contains any itemtype == "Rasch", a list with the item parameters and the estimate covariances (if available). If mod is SingleGroupClass, the list contains the item parameters as a matrix and the covariances as a list. If mod is MultipleGroupClass, the list contains the item parameters and covariances for the focal and reference groups only.
library(mirt) data <- expand.table(LSAT7) (mod1 <- mirt(data, model = 1, itemtype = "Rasch", SE = TRUE)) (DFIT:::ExtractRaschMirt(mod1)) # From mirt's multipleGroup set.seed(12345) a <- matrix(abs(rnorm(15, 1, .3)), ncol = 1) d <- matrix(rnorm(15, 0, .7), ncol = 1) itemtype <- rep('2PL', nrow(a)) N <- 1000 dataset1 <- simdata(a, d, N, itemtype) dataset2 <- simdata(a, d, N, itemtype, mu = .1, sigma = matrix(1.5)) dataset3 <- simdata(a, d, N, itemtype, mu = -.1, sigma = matrix(1.5)) dataset4 <- simdata(a, d, N, itemtype, mu = 0, sigma = matrix(1.5)) dat <- rbind(dataset1, dataset2, dataset3, dataset4) group <- rep(paste0('D', 1:4), each = N) (mod2 <- multipleGroup(dat, 1, itemtype = 'Rasch', group = group, SE = TRUE)) (DFIT:::ExtractRaschMirt(mod2, focal = "D1", reference = "D4")) (DFIT:::ExtractRaschMirt(mod2))
library(mirt) data <- expand.table(LSAT7) (mod1 <- mirt(data, model = 1, itemtype = "Rasch", SE = TRUE)) (DFIT:::ExtractRaschMirt(mod1)) # From mirt's multipleGroup set.seed(12345) a <- matrix(abs(rnorm(15, 1, .3)), ncol = 1) d <- matrix(rnorm(15, 0, .7), ncol = 1) itemtype <- rep('2PL', nrow(a)) N <- 1000 dataset1 <- simdata(a, d, N, itemtype) dataset2 <- simdata(a, d, N, itemtype, mu = .1, sigma = matrix(1.5)) dataset3 <- simdata(a, d, N, itemtype, mu = -.1, sigma = matrix(1.5)) dataset4 <- simdata(a, d, N, itemtype, mu = 0, sigma = matrix(1.5)) dat <- rbind(dataset1, dataset2, dataset3, dataset4) group <- rep(paste0('D', 1:4), each = N) (mod2 <- multipleGroup(dat, 1, itemtype = 'Rasch', group = group, SE = TRUE)) (DFIT:::ExtractRaschMirt(mod2, focal = "D1", reference = "D4")) (DFIT:::ExtractRaschMirt(mod2))
Generates a sample of item parameters assuming multivariate normality of estimates
Ipr(itemParameters, itemCovariances, nReplicates = 5000)
Ipr(itemParameters, itemCovariances, nReplicates = 5000)
itemParameters |
A list containing "focal" and "reference" item parameters. Item parameters are assumed to be on the same scale. Item parameters for each group should me a matrix with nrow equal to the number of items. |
itemCovariances |
A list containing "focal" and "reference" matrices of covariance for item estimates. Each (focal and reference) may be either a list of covariance matrices for each item or a single matrix of covariance of all parameters. |
nReplicates |
A numeric value indicating the number of replications to perform |
itemParameters A list with item parameters for focal and reference groups
Victor H. Cervantes <vhcervantesb at unal.edu.co>
Oshima, T., Raju, N. & Nanda, A. (2006). A new method for assessing the statistical significance in the Differential Functioning of Items and Tests (DFIT) framework. Journal of educational measurement, 43(1), 1–17. doi:10.1111/j.1745-3984.2006.00001.x
# # Not run # # # # data(dichotomousItemParameters) # # threePlParameters <- dichotomousItemParameters # # isNot3Pl <- ((dichotomousItemParameters[['focal']][, 3] == 0) | # # (dichotomousItemParameters[['reference']][, 3] == 0)) # # # # threePlParameters[['focal']] <- threePlParameters[['focal']][!isNot3Pl, ] # # threePlParameters[['reference']] <- threePlParameters[['reference']][!isNot3Pl, ] # # threePlParameters[['focal']][, 3] <- threePlParameters[['focal']][, 3] + 0.1 # # threePlParameters[['reference']][, 3] <- threePlParameters[['reference']][, 3] + 0.1 # # threePlParameters[['focal']][, 2] <- threePlParameters[['focal']][, 2] + 1.5 # # threePlParameters[['reference']][, 2] <- threePlParameters[['reference']][, 2] + 1.5 # # threePlParameters[['focal']] <- threePlParameters[['focal']][-c(12, 16, 28), ] # # threePlParameters[['reference']] <- threePlParameters[['reference']][-c(12, 16, 28), ] # # # # threePlAse <- list() # # threePlAse[["focal"]] <- AseIrt(itemParameters = threePlParameters[["focal"]], # # logistic = TRUE, # # sampleSize = 10000, # # irtModel = "3pl") # # threePlAse[["reference"]] <- AseIrt(itemParameters = threePlParameters[["reference"]], # # logistic = TRUE, # # sampleSize = 15000, # # irtModel = "3pl") # # # # set.seed(41568) # # threePlIpr <- Ipr(itemParameters = threePlParameters, itemCovariances = threePlAse, # # nReplicates = 100)
# # Not run # # # # data(dichotomousItemParameters) # # threePlParameters <- dichotomousItemParameters # # isNot3Pl <- ((dichotomousItemParameters[['focal']][, 3] == 0) | # # (dichotomousItemParameters[['reference']][, 3] == 0)) # # # # threePlParameters[['focal']] <- threePlParameters[['focal']][!isNot3Pl, ] # # threePlParameters[['reference']] <- threePlParameters[['reference']][!isNot3Pl, ] # # threePlParameters[['focal']][, 3] <- threePlParameters[['focal']][, 3] + 0.1 # # threePlParameters[['reference']][, 3] <- threePlParameters[['reference']][, 3] + 0.1 # # threePlParameters[['focal']][, 2] <- threePlParameters[['focal']][, 2] + 1.5 # # threePlParameters[['reference']][, 2] <- threePlParameters[['reference']][, 2] + 1.5 # # threePlParameters[['focal']] <- threePlParameters[['focal']][-c(12, 16, 28), ] # # threePlParameters[['reference']] <- threePlParameters[['reference']][-c(12, 16, 28), ] # # # # threePlAse <- list() # # threePlAse[["focal"]] <- AseIrt(itemParameters = threePlParameters[["focal"]], # # logistic = TRUE, # # sampleSize = 10000, # # irtModel = "3pl") # # threePlAse[["reference"]] <- AseIrt(itemParameters = threePlParameters[["reference"]], # # logistic = TRUE, # # sampleSize = 15000, # # irtModel = "3pl") # # # # set.seed(41568) # # threePlIpr <- Ipr(itemParameters = threePlParameters, itemCovariances = threePlAse, # # nReplicates = 100)
Generates a sample of item parameters assuming multivariate normality of estimates
IprMG(itemParameters, itemCovariances, nReplicates = 5000)
IprMG(itemParameters, itemCovariances, nReplicates = 5000)
itemParameters |
A list of three or more sets of item parameters. Item parameters are assumed to be on the same scale. Item parameters for each group should be a matrix with nrow equal to the number of items. One set of item parameters must be called "base" and contain the item parameters to which all other sets will be compared to; the other group item parameters must have some name but it can be arbitrarily given. |
itemCovariances |
A list containing matrices of covariance for item estimates. See 'itemParameters' for list structure. Each list element may be either a list of covariance matrices for each item or a single matrix of covariance of all parameters. |
nReplicates |
A numeric value indicating the number of replications to perform |
itemParameters A list with item parameters for focal and reference groups
Victor H. Cervantes <vhcervantesb at unal.edu.co>
Oshima, T. C., Wright, K., & White, N. (2014). Multiple-Group Noncompensatory Differential Item Functioning in Raju’s Differential Functioning of Items and Tests. International Journal of Testing, 15, 254–273.
Oshima, T., Raju, N. & Nanda, A. (2006). A new method for assessing the statistical significance in the Differential Functioning of Items and Tests (DFIT) framework. Journal of educational measurement, 43(1), 1–17. doi:10.1111/j.1745-3984.2006.00001.x
#' # Data fom Oshima, Wright and White baseParameters <- matrix(c(0.49, -0.07, 0.19, 0.92, 0.21, 0.15, 1.26, 0.54, 0.05, 0.61, -0.03, 0.18, 1.74, 0.01, 0.12, 0.50, 1.96, 0.12, 0.96, 0.04, 0.13, 0.59, -0.09, 0.18, 0.82, -1.16, 0.17, 1.26, 0.02, 0.11, 0.82, 0.20, 0.07, 0.75, -0.43, 0.15, 1.49, -0.06, 0.09, 0.97, -0.34, 0.12, 1.49, 0.05, 0.12, 0.89, -0.25, 0.15, 1.45, 0.06, 0.07, 0.75, 0.31, 0.18, 1.43, 0.04, 0.08, 0.60, 0.13, 0.22, 0.83, 0.52, 0.09, 0.56, -0.96, 0.19, 0.67, -0.79, 0.20, 0.70, 0.37, 0.18, 1.03, -0.71, 0.14, 0.89, -0.19, 0.21, 1.23, 0.74, 0.06, 0.90, -0.44, 0.18, 1.23, -0.17, 0.12, 0.69, 0.53, 0.17), byrow = TRUE, ncol = 3) group1Pars <- group2Pars <- group3Pars <- group4Pars <- group5Pars <- baseParameters group1Pars[c(4, 22), 1] <- group1Pars[c(4, 22), 1] + .4 group1Pars[c(7, 22), 2] <- group1Pars[c(7, 22), 2] + .7 group2Pars[c(13, 28), 1] <- group2Pars[c(13, 28), 1] - .4 group2Pars[c(19, 28), 2] <- group2Pars[c(19, 28), 2] - .7 group3Pars[c(4, 13), 1] <- group3Pars[c(4, 13), 1] + .4 group3Pars[c(4, 22), 2] <- group3Pars[c(4, 22), 2] - .7 group4Pars[c(7, 28), 1] <- group4Pars[c(7, 28), 1] - .4 group4Pars[c(7, 19), 2] <- group4Pars[c(7, 19), 2] + .7 itemParameters <- list(base = baseParameters, group1 = group1Pars, group2 = group2Pars, group3 = group3Pars, group4 = group4Pars, group5 = group5Pars ) itemCovariances <- lapply(itemParameters, AseIrt, irtModel = "3pl", sampleSize = 5000) mgIpr <- IprMG(itemParameters = itemParameters, itemCovariances = itemCovariances, nReplicates = 100)
#' # Data fom Oshima, Wright and White baseParameters <- matrix(c(0.49, -0.07, 0.19, 0.92, 0.21, 0.15, 1.26, 0.54, 0.05, 0.61, -0.03, 0.18, 1.74, 0.01, 0.12, 0.50, 1.96, 0.12, 0.96, 0.04, 0.13, 0.59, -0.09, 0.18, 0.82, -1.16, 0.17, 1.26, 0.02, 0.11, 0.82, 0.20, 0.07, 0.75, -0.43, 0.15, 1.49, -0.06, 0.09, 0.97, -0.34, 0.12, 1.49, 0.05, 0.12, 0.89, -0.25, 0.15, 1.45, 0.06, 0.07, 0.75, 0.31, 0.18, 1.43, 0.04, 0.08, 0.60, 0.13, 0.22, 0.83, 0.52, 0.09, 0.56, -0.96, 0.19, 0.67, -0.79, 0.20, 0.70, 0.37, 0.18, 1.03, -0.71, 0.14, 0.89, -0.19, 0.21, 1.23, 0.74, 0.06, 0.90, -0.44, 0.18, 1.23, -0.17, 0.12, 0.69, 0.53, 0.17), byrow = TRUE, ncol = 3) group1Pars <- group2Pars <- group3Pars <- group4Pars <- group5Pars <- baseParameters group1Pars[c(4, 22), 1] <- group1Pars[c(4, 22), 1] + .4 group1Pars[c(7, 22), 2] <- group1Pars[c(7, 22), 2] + .7 group2Pars[c(13, 28), 1] <- group2Pars[c(13, 28), 1] - .4 group2Pars[c(19, 28), 2] <- group2Pars[c(19, 28), 2] - .7 group3Pars[c(4, 13), 1] <- group3Pars[c(4, 13), 1] + .4 group3Pars[c(4, 22), 2] <- group3Pars[c(4, 22), 2] - .7 group4Pars[c(7, 28), 1] <- group4Pars[c(7, 28), 1] - .4 group4Pars[c(7, 19), 2] <- group4Pars[c(7, 19), 2] + .7 itemParameters <- list(base = baseParameters, group1 = group1Pars, group2 = group2Pars, group3 = group3Pars, group4 = group4Pars, group5 = group5Pars ) itemCovariances <- lapply(itemParameters, AseIrt, irtModel = "3pl", sampleSize = 5000) mgIpr <- IprMG(itemParameters = itemParameters, itemCovariances = itemCovariances, nReplicates = 100)
Calculates the NCDIF index on a list of item parameters such as those produced by the Ipr function
IprMGNcdif( itemParameterList, irtModel = "2pl", focalAbilities = NULL, focalDistribution = "norm", relSizes = NULL, subdivisions = 5000, logistic = TRUE, focalDistrExtra = list(mean = 0, sd = 1) )
IprMGNcdif( itemParameterList, irtModel = "2pl", focalAbilities = NULL, focalDistribution = "norm", relSizes = NULL, subdivisions = 5000, logistic = TRUE, focalDistrExtra = list(mean = 0, sd = 1) )
itemParameterList |
A list where each element is a list containing "focal" and "reference" item Parameters. Item parameters are assumed to be on the same scale. Item parameters for each group should be a matrix with nrow equal to the number of items. |
irtModel |
A string stating the irtModel to be used. Should be one of "1pl", "2pl", "3pl", "grm" or "pcm". |
focalAbilities |
If NULL, NCDIF is calculated by numerical integration of focal distribution. If not NULL, must be a numerical vector containing the abilities for the individuals in the focal group. |
focalDistribution |
A string stating the distribution name to be used for integrating. Only used if focalAbilities is NULL. |
relSizes |
If not NULL, a numeric vector with named components containing the relative sizes of the groups. Used to obtain the weighted average of the pairwise NCDIF statistics. If NULL and focalAbilities is NULL, defaults to 1/length(focalDistribution) |
subdivisions |
A numeric value indicating the number of subdivisions for numerical integration. Only used if focalAbilities is NULL. |
logistic |
A logical value stating if the IRT model will use the logistic or the normal metric. Defaults to using the logistic metric by fixing the D constant to 1. If FALSE the constant is set to 1.702 so that the normal metric is used. |
focalDistrExtra |
A list stating the extra parameters needed by the focal distribution function. |
mgncdif A numeric matrix with the NCDIF values for all the item parameter in each set of itemParameterList
Victor H. Cervantes <vhcervantesb at unal.edu.co>
Oshima, T., Raju, N. & Nanda, A. (2006). A new method for assessing the statistical significance in the Differential Functioning of Items and Tests (DFIT) framework. Journal of educational measurement, 43(1), 1–17. doi:10.1111/j.1745-3984.2006.00001.x
#' # Data fom Oshima, Wright and White baseParameters <- matrix(c(0.49, -0.07, 0.19, 0.92, 0.21, 0.15, 1.26, 0.54, 0.05, 0.61, -0.03, 0.18, 1.74, 0.01, 0.12, 0.50, 1.96, 0.12, 0.96, 0.04, 0.13, 0.59, -0.09, 0.18, 0.82, -1.16, 0.17, 1.26, 0.02, 0.11, 0.82, 0.20, 0.07, 0.75, -0.43, 0.15, 1.49, -0.06, 0.09, 0.97, -0.34, 0.12, 1.49, 0.05, 0.12, 0.89, -0.25, 0.15, 1.45, 0.06, 0.07, 0.75, 0.31, 0.18, 1.43, 0.04, 0.08, 0.60, 0.13, 0.22, 0.83, 0.52, 0.09, 0.56, -0.96, 0.19, 0.67, -0.79, 0.20, 0.70, 0.37, 0.18, 1.03, -0.71, 0.14, 0.89, -0.19, 0.21, 1.23, 0.74, 0.06, 0.90, -0.44, 0.18, 1.23, -0.17, 0.12, 0.69, 0.53, 0.17), byrow = TRUE, ncol = 3) group1Pars <- group2Pars <- group3Pars <- group4Pars <- group5Pars <- baseParameters group1Pars[c(4, 22), 1] <- group1Pars[c(4, 22), 1] + .4 group1Pars[c(7, 22), 2] <- group1Pars[c(7, 22), 2] + .7 group2Pars[c(13, 28), 1] <- group2Pars[c(13, 28), 1] - .4 group2Pars[c(19, 28), 2] <- group2Pars[c(19, 28), 2] - .7 group3Pars[c(4, 13), 1] <- group3Pars[c(4, 13), 1] + .4 group3Pars[c(4, 22), 2] <- group3Pars[c(4, 22), 2] - .7 group4Pars[c(7, 28), 1] <- group4Pars[c(7, 28), 1] - .4 group4Pars[c(7, 19), 2] <- group4Pars[c(7, 19), 2] + .7 itemParameters <- list(base = baseParameters, group1 = group1Pars, group2 = group2Pars, group3 = group3Pars, group4 = group4Pars, group5 = group5Pars ) itemCovariances <- lapply(itemParameters, AseIrt, irtModel = "3pl", sampleSize = 5000) mgIpr <- IprMG(itemParameters = itemParameters, itemCovariances = itemCovariances, nReplicates = 100) mgIpr <- Bound3PlIpr(mgIpr) mgncdifIpr <- IprMGNcdif(itemParameterList = mgIpr, irtModel = "3pl")
#' # Data fom Oshima, Wright and White baseParameters <- matrix(c(0.49, -0.07, 0.19, 0.92, 0.21, 0.15, 1.26, 0.54, 0.05, 0.61, -0.03, 0.18, 1.74, 0.01, 0.12, 0.50, 1.96, 0.12, 0.96, 0.04, 0.13, 0.59, -0.09, 0.18, 0.82, -1.16, 0.17, 1.26, 0.02, 0.11, 0.82, 0.20, 0.07, 0.75, -0.43, 0.15, 1.49, -0.06, 0.09, 0.97, -0.34, 0.12, 1.49, 0.05, 0.12, 0.89, -0.25, 0.15, 1.45, 0.06, 0.07, 0.75, 0.31, 0.18, 1.43, 0.04, 0.08, 0.60, 0.13, 0.22, 0.83, 0.52, 0.09, 0.56, -0.96, 0.19, 0.67, -0.79, 0.20, 0.70, 0.37, 0.18, 1.03, -0.71, 0.14, 0.89, -0.19, 0.21, 1.23, 0.74, 0.06, 0.90, -0.44, 0.18, 1.23, -0.17, 0.12, 0.69, 0.53, 0.17), byrow = TRUE, ncol = 3) group1Pars <- group2Pars <- group3Pars <- group4Pars <- group5Pars <- baseParameters group1Pars[c(4, 22), 1] <- group1Pars[c(4, 22), 1] + .4 group1Pars[c(7, 22), 2] <- group1Pars[c(7, 22), 2] + .7 group2Pars[c(13, 28), 1] <- group2Pars[c(13, 28), 1] - .4 group2Pars[c(19, 28), 2] <- group2Pars[c(19, 28), 2] - .7 group3Pars[c(4, 13), 1] <- group3Pars[c(4, 13), 1] + .4 group3Pars[c(4, 22), 2] <- group3Pars[c(4, 22), 2] - .7 group4Pars[c(7, 28), 1] <- group4Pars[c(7, 28), 1] - .4 group4Pars[c(7, 19), 2] <- group4Pars[c(7, 19), 2] + .7 itemParameters <- list(base = baseParameters, group1 = group1Pars, group2 = group2Pars, group3 = group3Pars, group4 = group4Pars, group5 = group5Pars ) itemCovariances <- lapply(itemParameters, AseIrt, irtModel = "3pl", sampleSize = 5000) mgIpr <- IprMG(itemParameters = itemParameters, itemCovariances = itemCovariances, nReplicates = 100) mgIpr <- Bound3PlIpr(mgIpr) mgncdifIpr <- IprMGNcdif(itemParameterList = mgIpr, irtModel = "3pl")
Calculates the Mantel-Haenszel theoretical parameter under IRT assumptions on a list of item parameters such as those produced by the Ipr function
IprMh( itemParameterList, irtModel = "2pl", focalDistribution = "norm", focalDistrExtra = list(mean = 0, sd = 1), referenceDistribution = "norm", referenceDistrExtra = list(mean = 0, sd = 1), groupRatio = 1, subdivisions = 5000, logistic = TRUE )
IprMh( itemParameterList, irtModel = "2pl", focalDistribution = "norm", focalDistrExtra = list(mean = 0, sd = 1), referenceDistribution = "norm", referenceDistrExtra = list(mean = 0, sd = 1), groupRatio = 1, subdivisions = 5000, logistic = TRUE )
itemParameterList |
A list where each element is a list containing "focal" and "reference" item Parameters. Item parameters are assumed to be on the same scale. Item parameters for each group should be a matrix with nrow equal to the number of items |
irtModel |
A string stating the irtModel to be used. Should be one of "1pl", "2pl", "3pl", "grm" or "pcm". |
focalDistribution |
A string stating the distribution assumed for the focal group. |
focalDistrExtra |
A list stating the extra parameters needed by the focal distribution function. |
referenceDistribution |
A string stating the distribution assumed for the reference group. |
referenceDistrExtra |
A list stating the extra parameters needed by the reference distribution function. |
groupRatio |
A positive value indicating how many members of the reference group are expected for each member of the focal group. |
subdivisions |
A numeric value indicating the number of subdivisions for numerical integration. |
logistic |
A logical value stating if the IRT model will use the logistic or the normal metric. Defaults to using the logistic metric by fixing the D constant to 1. If FALSE the constant is set to 1.702 so that the normal metric is used. |
mh A numeric matrix with the Mantel Haenszel values for all the item parameter in each set of itemParameterList
Victor H. Cervantes <vhcervantesb at unal.edu.co>
Oshima, T., Raju, N. & Nanda, A. (2006). A new method for assessing the statistical significance in the Differential Functioning of Items and Tests (DFIT) framework. Journal of educational measurement, 43(1), 1–17. doi:10.1111/j.1745-3984.2006.00001.x
Roussos, L., Schnipke, D. & Pashley, P. (1999). A generalized formula for the Mantel-Haenszel Differential Item Functioning parameter. Journal of educational and behavioral statistics, 24(3), 293–322. doi:10.3102/10769986024003293
# # Not run # # # # data(dichotomousItemParameters) # # threePlParameters <- dichotomousItemParameters # # isNot3Pl <- ((dichotomousItemParameters[['focal']][, 3] == 0) | # # (dichotomousItemParameters[['reference']][, 3] == 0)) # # # # threePlParameters[['focal']] <- threePlParameters[['focal']][!isNot3Pl, ] # # threePlParameters[['reference']] <- threePlParameters[['reference']][!isNot3Pl, ] # # threePlParameters[['focal']][, 3] <- threePlParameters[['focal']][, 3] + 0.1 # # threePlParameters[['reference']][, 3] <- threePlParameters[['reference']][, 3] + 0.1 # # threePlParameters[['focal']][, 2] <- threePlParameters[['focal']][, 2] + 1.5 # # threePlParameters[['reference']][, 2] <- threePlParameters[['reference']][, 2] + 1.5 # # threePlParameters[['focal']] <- threePlParameters[['focal']][-c(12, 16, 28), ] # # threePlParameters[['reference']] <- threePlParameters[['reference']][-c(12, 16, 28), ] # # # # threePlAse <- list() # # threePlAse[["focal"]] <- AseIrt(itemParameters = threePlParameters[["focal"]], # # logistic = TRUE, # # sampleSize = 10000, # # irtModel = "3pl") # # threePlAse[["reference"]] <- AseIrt(itemParameters = threePlParameters[["reference"]], # # logistic = TRUE, # # sampleSize = 10000, # # irtModel = "3pl") # # # # set.seed(41568) # # threePlIpr <- Ipr(itemParameters = threePlParameters, itemCovariances = threePlAse, # # nReplicates = 100) # # # # threePlMhIpr <- IprMh(itemParameterList = threePlIpr, irtModel = '3pl', logistic = TRUE)
# # Not run # # # # data(dichotomousItemParameters) # # threePlParameters <- dichotomousItemParameters # # isNot3Pl <- ((dichotomousItemParameters[['focal']][, 3] == 0) | # # (dichotomousItemParameters[['reference']][, 3] == 0)) # # # # threePlParameters[['focal']] <- threePlParameters[['focal']][!isNot3Pl, ] # # threePlParameters[['reference']] <- threePlParameters[['reference']][!isNot3Pl, ] # # threePlParameters[['focal']][, 3] <- threePlParameters[['focal']][, 3] + 0.1 # # threePlParameters[['reference']][, 3] <- threePlParameters[['reference']][, 3] + 0.1 # # threePlParameters[['focal']][, 2] <- threePlParameters[['focal']][, 2] + 1.5 # # threePlParameters[['reference']][, 2] <- threePlParameters[['reference']][, 2] + 1.5 # # threePlParameters[['focal']] <- threePlParameters[['focal']][-c(12, 16, 28), ] # # threePlParameters[['reference']] <- threePlParameters[['reference']][-c(12, 16, 28), ] # # # # threePlAse <- list() # # threePlAse[["focal"]] <- AseIrt(itemParameters = threePlParameters[["focal"]], # # logistic = TRUE, # # sampleSize = 10000, # # irtModel = "3pl") # # threePlAse[["reference"]] <- AseIrt(itemParameters = threePlParameters[["reference"]], # # logistic = TRUE, # # sampleSize = 10000, # # irtModel = "3pl") # # # # set.seed(41568) # # threePlIpr <- Ipr(itemParameters = threePlParameters, itemCovariances = threePlAse, # # nReplicates = 100) # # # # threePlMhIpr <- IprMh(itemParameterList = threePlIpr, irtModel = '3pl', logistic = TRUE)
Calculates the NCDIF index on a list of item parameters such as those produced by the Ipr function
IprNcdif( itemParameterList, irtModel = "2pl", focalAbilities = NULL, focalDistribution = "norm", subdivisions = 5000, logistic = TRUE, focalDistrExtra = list(mean = 0, sd = 1) )
IprNcdif( itemParameterList, irtModel = "2pl", focalAbilities = NULL, focalDistribution = "norm", subdivisions = 5000, logistic = TRUE, focalDistrExtra = list(mean = 0, sd = 1) )
itemParameterList |
A list where each element is a list containing "focal" and "reference" item Parameters. Item parameters are assumed to be on the same scale. Item parameters for each group should be a matrix with nrow equal to the number of items. |
irtModel |
A string stating the irtModel to be used. Should be one of "1pl", "2pl", "3pl", "grm" or "pcm". |
focalAbilities |
If NULL, NCDIF is calculated by numerical integration of focal distribution. If not NULL, must be a numerical vector containing the abilities for the individuals in the focal group. |
focalDistribution |
A string stating the distribution name to be used for integrating. Only used if focalAbilities is NULL. |
subdivisions |
A numeric value indicating the number of subdivisions for numerical integration. Only used if focalAbilities is NULL. |
logistic |
A logical value stating if the IRT model will use the logistic or the normal metric. Defaults to using the logistic metric by fixing the D constant to 1. If FALSE the constant is set to 1.702 so that the normal metric is used. |
focalDistrExtra |
A list stating the extra parameters needed by the focal distribution function. |
ncdif A numeric matrix with the NCDIF values for all the item parameter in each set of itemParameterList
Victor H. Cervantes <vhcervantesb at unal.edu.co>
Oshima, T., Raju, N. & Nanda, A. (2006). A new method for assessing the statistical significance in the Differential Functioning of Items and Tests (DFIT) framework. Journal of educational measurement, 43(1), 1–17. doi:10.1111/j.1745-3984.2006.00001.x
# # Not run # # # # data(dichotomousItemParameters) # # threePlParameters <- dichotomousItemParameters # # isNot3Pl <- ((dichotomousItemParameters[['focal']][, 3] == 0) | # # (dichotomousItemParameters[['reference']][, 3] == 0)) # # # # threePlParameters[['focal']] <- threePlParameters[['focal']][!isNot3Pl, ] # # threePlParameters[['reference']] <- threePlParameters[['reference']][!isNot3Pl, ] # # threePlParameters[['focal']][, 3] <- threePlParameters[['focal']][, 3] + 0.1 # # threePlParameters[['reference']][, 3] <- threePlParameters[['reference']][, 3] + 0.1 # # threePlParameters[['focal']][, 2] <- threePlParameters[['focal']][, 2] + 1.5 # # threePlParameters[['reference']][, 2] <- threePlParameters[['reference']][, 2] + 1.5 # # threePlParameters[['focal']] <- threePlParameters[['focal']][-c(12, 16, 28), ] # # threePlParameters[['reference']] <- threePlParameters[['reference']][-c(12, 16, 28), ] # # # # threePlAse <- list() # # threePlAse[["focal"]] <- AseIrt(itemParameters = threePlParameters[["focal"]], # # logistic = TRUE, # # sampleSize = 10000, # # irtModel = "3pl") # # threePlAse[["reference"]] <- AseIrt(itemParameters = threePlParameters[["reference"]], # # logistic = TRUE, # # sampleSize = 10000, # # irtModel = "3pl") # # # # set.seed(41568) # # threePlIpr <- Ipr(itemParameters = threePlParameters, itemCovariances = threePlAse, # # nReplicates = 100) # # # # threePlNcdifIpr <- IprNcdif(itemParameterList = threePlIpr, irtModel = '3pl', logistic = TRUE)
# # Not run # # # # data(dichotomousItemParameters) # # threePlParameters <- dichotomousItemParameters # # isNot3Pl <- ((dichotomousItemParameters[['focal']][, 3] == 0) | # # (dichotomousItemParameters[['reference']][, 3] == 0)) # # # # threePlParameters[['focal']] <- threePlParameters[['focal']][!isNot3Pl, ] # # threePlParameters[['reference']] <- threePlParameters[['reference']][!isNot3Pl, ] # # threePlParameters[['focal']][, 3] <- threePlParameters[['focal']][, 3] + 0.1 # # threePlParameters[['reference']][, 3] <- threePlParameters[['reference']][, 3] + 0.1 # # threePlParameters[['focal']][, 2] <- threePlParameters[['focal']][, 2] + 1.5 # # threePlParameters[['reference']][, 2] <- threePlParameters[['reference']][, 2] + 1.5 # # threePlParameters[['focal']] <- threePlParameters[['focal']][-c(12, 16, 28), ] # # threePlParameters[['reference']] <- threePlParameters[['reference']][-c(12, 16, 28), ] # # # # threePlAse <- list() # # threePlAse[["focal"]] <- AseIrt(itemParameters = threePlParameters[["focal"]], # # logistic = TRUE, # # sampleSize = 10000, # # irtModel = "3pl") # # threePlAse[["reference"]] <- AseIrt(itemParameters = threePlParameters[["reference"]], # # logistic = TRUE, # # sampleSize = 10000, # # irtModel = "3pl") # # # # set.seed(41568) # # threePlIpr <- Ipr(itemParameters = threePlParameters, itemCovariances = threePlAse, # # nReplicates = 100) # # # # threePlNcdifIpr <- IprNcdif(itemParameterList = threePlIpr, irtModel = '3pl', logistic = TRUE)
Calculates Raju's Signed Area Measure index on a list of item parameters such as those produced by the Ipr function
IprSam( itemParameterList, irtModel = "2pl", subdivisions = 5000, logistic = TRUE )
IprSam( itemParameterList, irtModel = "2pl", subdivisions = 5000, logistic = TRUE )
itemParameterList |
A list where each element is a list containing "focal" and "reference" item Parameters. Item parameters are assumed to be on the same scale. Item parameters for each group should be a matrix with nrow equal to the number of items. |
irtModel |
A string stating the irtModel to be used. Should be one of "1pl", "2pl", "3pl", "grm" or "pcm". |
subdivisions |
A numeric value indicating the number of subdivisions for numerical integration. |
logistic |
A logical value stating if the IRT model will use the logistic or the normal metric. Defaults to using the logistic metric by fixing the D constant to 1. If FALSE the constant is set to 1.702 so that the normal metric is used. |
sam A numeric matrix with the Signed Area Measure values for all the item parameter in each set of itemParameterList
Victor H. Cervantes <vhcervantesb at unal.edu.co>
Raju, N. (1988). The area between two item characteristic cureves. Psychometricka, 53(4), 495–502. doi:10.1007/bf02294403
Oshima, T., Raju, N. & Nanda, A. (2006). A new method for assessing the statistical significance in the Differential Functioning of Items and Tests (DFIT) framework. Journal of educational measurement, 43(1), 1–17. doi:10.1111/j.1745-3984.2006.00001.x
# # Not run # # # # data(dichotomousItemParameters) # # threePlParameters <- dichotomousItemParameters # # isNot3Pl <- ((dichotomousItemParameters[['focal']][, 3] == 0) | # # (dichotomousItemParameters[['reference']][, 3] == 0)) # # # # threePlParameters[['focal']] <- threePlParameters[['focal']][!isNot3Pl, ] # # threePlParameters[['reference']] <- threePlParameters[['reference']][!isNot3Pl, ] # # threePlParameters[['focal']][, 3] <- threePlParameters[['focal']][, 3] + 0.1 # # threePlParameters[['reference']][, 3] <- threePlParameters[['reference']][, 3] + 0.1 # # threePlParameters[['focal']][, 2] <- threePlParameters[['focal']][, 2] + 1.5 # # threePlParameters[['reference']][, 2] <- threePlParameters[['reference']][, 2] + 1.5 # # threePlParameters[['focal']] <- threePlParameters[['focal']][-c(12, 16, 28), ] # # threePlParameters[['reference']] <- threePlParameters[['reference']][-c(12, 16, 28), ] # # # # threePlAse <- list() # # threePlAse[["focal"]] <- AseIrt(itemParameters = threePlParameters[["focal"]], # # logistic = TRUE, # # sampleSize = 10000, # # irtModel = "3pl") # # threePlAse[["reference"]] <- AseIrt(itemParameters = threePlParameters[["reference"]], # # logistic = TRUE, # # sampleSize = 10000, # # irtModel = "3pl") # # # # set.seed(41568) # # threePlIpr <- Ipr(itemParameters = threePlParameters, itemCovariances = threePlAse, # # nReplicates = 100) # # # # threePlSamIpr <- IprSam(itemParameterList = threePlIpr, irtModel = '3pl', logistic = TRUE)
# # Not run # # # # data(dichotomousItemParameters) # # threePlParameters <- dichotomousItemParameters # # isNot3Pl <- ((dichotomousItemParameters[['focal']][, 3] == 0) | # # (dichotomousItemParameters[['reference']][, 3] == 0)) # # # # threePlParameters[['focal']] <- threePlParameters[['focal']][!isNot3Pl, ] # # threePlParameters[['reference']] <- threePlParameters[['reference']][!isNot3Pl, ] # # threePlParameters[['focal']][, 3] <- threePlParameters[['focal']][, 3] + 0.1 # # threePlParameters[['reference']][, 3] <- threePlParameters[['reference']][, 3] + 0.1 # # threePlParameters[['focal']][, 2] <- threePlParameters[['focal']][, 2] + 1.5 # # threePlParameters[['reference']][, 2] <- threePlParameters[['reference']][, 2] + 1.5 # # threePlParameters[['focal']] <- threePlParameters[['focal']][-c(12, 16, 28), ] # # threePlParameters[['reference']] <- threePlParameters[['reference']][-c(12, 16, 28), ] # # # # threePlAse <- list() # # threePlAse[["focal"]] <- AseIrt(itemParameters = threePlParameters[["focal"]], # # logistic = TRUE, # # sampleSize = 10000, # # irtModel = "3pl") # # threePlAse[["reference"]] <- AseIrt(itemParameters = threePlParameters[["reference"]], # # logistic = TRUE, # # sampleSize = 10000, # # irtModel = "3pl") # # # # set.seed(41568) # # threePlIpr <- Ipr(itemParameters = threePlParameters, itemCovariances = threePlAse, # # nReplicates = 100) # # # # threePlSamIpr <- IprSam(itemParameterList = threePlIpr, irtModel = '3pl', logistic = TRUE)
Calculates Raju's Unsigned Area Measure index on a list of item parameters such as those produced by the Ipr function
IprUam( itemParameterList, irtModel = "2pl", subdivisions = 5000, logistic = TRUE )
IprUam( itemParameterList, irtModel = "2pl", subdivisions = 5000, logistic = TRUE )
itemParameterList |
A list where each element is a list containing "focal" and "reference" item Parameters. Item parameters are assumed to be on the same scale. Item parameters for each group should be a matrix with nrow equal to the number of items. |
irtModel |
A string stating the irtModel to be used. Should be one of "1pl", "2pl", "3pl", "grm" or "pcm". |
subdivisions |
A numeric value indicating the number of subdivisions for numerical integration. |
logistic |
A logical value stating if the IRT model will use the logistic or the normal metric. Defaults to using the logistic metric by fixing the D constant to 1. If FALSE the constant is set to 1.702 so that the normal metric is used. |
uam A numeric matrix with the Unsigned Area Measure values for all the item parameter in each set of itemParameterList
Victor H. Cervantes <vhcervantesb at unal.edu.co>
Raju, N. (1988). The area between two item characteristic cureves. Psychometricka, 53(4), 495–502. doi:10.1007/bf02294403
Oshima, T., Raju, N. & Nanda, A. (2006). A new method for assessing the statistical significance in the Differential Functioning of Items and Tests (DFIT) framework. Journal of educational measurement, 43(1), 1–17. doi:10.1111/j.1745-3984.2006.00001.x
# # Not run # # # # data(dichotomousItemParameters) # # threePlParameters <- dichotomousItemParameters # # isNot3Pl <- ((dichotomousItemParameters[['focal']][, 3] == 0) | # # (dichotomousItemParameters[['reference']][, 3] == 0)) # # # # threePlParameters[['focal']] <- threePlParameters[['focal']][!isNot3Pl, ] # # threePlParameters[['reference']] <- threePlParameters[['reference']][!isNot3Pl, ] # # threePlParameters[['focal']][, 3] <- threePlParameters[['focal']][, 3] + 0.1 # # threePlParameters[['reference']][, 3] <- threePlParameters[['reference']][, 3] + 0.1 # # threePlParameters[['focal']][, 2] <- threePlParameters[['focal']][, 2] + 1.5 # # threePlParameters[['reference']][, 2] <- threePlParameters[['reference']][, 2] + 1.5 # # threePlParameters[['focal']] <- threePlParameters[['focal']][-c(12, 16, 28), ] # # threePlParameters[['reference']] <- threePlParameters[['reference']][-c(12, 16, 28), ] # # # # threePlAse <- list() # # threePlAse[["focal"]] <- AseIrt(itemParameters = threePlParameters[["focal"]], # # logistic = TRUE, # # sampleSize = 10000, # # irtModel = "3pl") # # threePlAse[["reference"]] <- AseIrt(itemParameters = threePlParameters[["reference"]], # # logistic = TRUE, # # sampleSize = 10000, # # irtModel = "3pl") # # # # set.seed(41568) # # threePlIpr <- Ipr(itemParameters = threePlParameters, itemCovariances = threePlAse, # # nReplicates = 100) # # # # threePlUamIpr <- IprUam(itemParameterList = threePlIpr, irtModel = '3pl', logistic = TRUE)
# # Not run # # # # data(dichotomousItemParameters) # # threePlParameters <- dichotomousItemParameters # # isNot3Pl <- ((dichotomousItemParameters[['focal']][, 3] == 0) | # # (dichotomousItemParameters[['reference']][, 3] == 0)) # # # # threePlParameters[['focal']] <- threePlParameters[['focal']][!isNot3Pl, ] # # threePlParameters[['reference']] <- threePlParameters[['reference']][!isNot3Pl, ] # # threePlParameters[['focal']][, 3] <- threePlParameters[['focal']][, 3] + 0.1 # # threePlParameters[['reference']][, 3] <- threePlParameters[['reference']][, 3] + 0.1 # # threePlParameters[['focal']][, 2] <- threePlParameters[['focal']][, 2] + 1.5 # # threePlParameters[['reference']][, 2] <- threePlParameters[['reference']][, 2] + 1.5 # # threePlParameters[['focal']] <- threePlParameters[['focal']][-c(12, 16, 28), ] # # threePlParameters[['reference']] <- threePlParameters[['reference']][-c(12, 16, 28), ] # # # # threePlAse <- list() # # threePlAse[["focal"]] <- AseIrt(itemParameters = threePlParameters[["focal"]], # # logistic = TRUE, # # sampleSize = 10000, # # irtModel = "3pl") # # threePlAse[["reference"]] <- AseIrt(itemParameters = threePlParameters[["reference"]], # # logistic = TRUE, # # sampleSize = 10000, # # irtModel = "3pl") # # # # set.seed(41568) # # threePlIpr <- Ipr(itemParameters = threePlParameters, itemCovariances = threePlAse, # # nReplicates = 100) # # # # threePlUamIpr <- IprUam(itemParameterList = threePlIpr, irtModel = '3pl', logistic = TRUE)
Calculates the Mantel-Haenszel theoretical parameter when a dichotomous IRT model holds
IrtMh( itemParameters, irtModel = "2pl", focalDistribution = "norm", referenceDistribution = "norm", focalDistrExtra = list(mean = 0, sd = 1), referenceDistrExtra = list(mean = 0, sd = 1), groupRatio = 1, logistic = TRUE, subdivisions = 5000 )
IrtMh( itemParameters, irtModel = "2pl", focalDistribution = "norm", referenceDistribution = "norm", focalDistrExtra = list(mean = 0, sd = 1), referenceDistrExtra = list(mean = 0, sd = 1), groupRatio = 1, logistic = TRUE, subdivisions = 5000 )
itemParameters |
A list containing the "focal" and "reference" item parameters. Item parameters are assumed to be on the same scale. |
irtModel |
A string stating the irtModel used. May be one of "1pl", "2pl", or "3pl". |
focalDistribution |
A string stating the distribution assumed for the focal group. |
referenceDistribution |
A string stating the distribution assumed for the reference group. |
focalDistrExtra |
A list of extra parameters for the focal distribution function. |
referenceDistrExtra |
A list of extra parameters for the reference distribution function. |
groupRatio |
A positive value indicating how many members of the reference group are expected for each member of the focal group. |
logistic |
A logical indicating whether the logistic or the normal metric should be used. |
subdivisions |
A numeric value stating the maximum number of subdivisions for adaptive quadrature. |
mh A numeric vector containing the Mantel-Haenszel statistics for each item
Victor H. Cervantes <vhcervantesb at unal.edu.co>
Roussos, L., Schnipke, D. & Pashley, P. (1999). A generalized formula for the Mantel-Haenszel Differential Item Functioning parameter. Journal of educational and behavioral statistics, 24(3), 293–322. doi:10.3102/10769986024003293
data(dichotomousItemParameters) threePlParameters <- dichotomousItemParameters isNot3Pl <- ((dichotomousItemParameters[['focal']][, 3] == 0) | (dichotomousItemParameters[['reference']][, 3] == 0)) threePlParameters[['focal']] <- threePlParameters[['focal']][!isNot3Pl, ] threePlParameters[['reference']] <- threePlParameters[['reference']][!isNot3Pl, ] threePlParameters[['focal']][, 3] <- threePlParameters[['focal']][, 3] + 0.1 threePlParameters[['reference']][, 3] <- threePlParameters[['reference']][, 3] + 0.1 threePlParameters[['focal']][, 2] <- threePlParameters[['focal']][, 2] + 1.5 threePlParameters[['reference']][, 2] <- threePlParameters[['reference']][, 2] + 1.5 threePlParameters[['focal']] <- threePlParameters[['focal']][-c(12, 16, 28), ] threePlParameters[['reference']] <- threePlParameters[['reference']][-c(12, 16, 28), ] threePlMh <- IrtMh(itemParameters = threePlParameters, irtModel = "3pl", focalDistribution = "norm", referenceDistribution = "norm", focalDistrExtra = list(mean = 0, sd = 1), referenceDistrExtra = list(mean = 0, sd = 1), groupRatio = 1, logistic = FALSE)
data(dichotomousItemParameters) threePlParameters <- dichotomousItemParameters isNot3Pl <- ((dichotomousItemParameters[['focal']][, 3] == 0) | (dichotomousItemParameters[['reference']][, 3] == 0)) threePlParameters[['focal']] <- threePlParameters[['focal']][!isNot3Pl, ] threePlParameters[['reference']] <- threePlParameters[['reference']][!isNot3Pl, ] threePlParameters[['focal']][, 3] <- threePlParameters[['focal']][, 3] + 0.1 threePlParameters[['reference']][, 3] <- threePlParameters[['reference']][, 3] + 0.1 threePlParameters[['focal']][, 2] <- threePlParameters[['focal']][, 2] + 1.5 threePlParameters[['reference']][, 2] <- threePlParameters[['reference']][, 2] + 1.5 threePlParameters[['focal']] <- threePlParameters[['focal']][-c(12, 16, 28), ] threePlParameters[['reference']] <- threePlParameters[['reference']][-c(12, 16, 28), ] threePlMh <- IrtMh(itemParameters = threePlParameters, irtModel = "3pl", focalDistribution = "norm", referenceDistribution = "norm", focalDistrExtra = list(mean = 0, sd = 1), referenceDistrExtra = list(mean = 0, sd = 1), groupRatio = 1, logistic = FALSE)
Calculates the MG-NCDIF index for an item with given item parameters of two or more groups.
MGNcdif( itemParameters, irtModel = "2pl", focalAbilities = NULL, focalDistribution = "norm", relSizes = NULL, subdivisions = 5000, logistic = TRUE, focalDistrExtra = list(list(mean = 0, sd = 1)) )
MGNcdif( itemParameters, irtModel = "2pl", focalAbilities = NULL, focalDistribution = "norm", relSizes = NULL, subdivisions = 5000, logistic = TRUE, focalDistrExtra = list(list(mean = 0, sd = 1)) )
itemParameters |
A list of three or more sets of item parameters. Item parameters are assumed to be on the same scale. Item parameters for each group should be a matrix with nrow equal to the number of items. One set of item parameters must be called "base" and contain the item parameters to which all other sets will be compared to; the other group item parameters must have some name but it can be arbitrarily given. |
irtModel |
A string stating the irtModel to be used. Should be one of "1pl", "2pl", "3pl", "grm" or "pcm". |
focalAbilities |
If NULL, NCDIF is calculated by numerical integration of focal distributions. If not NULL, it must be a list of numerical vectors containing the abilities for the individuals in each group. Names of the list must coincide with the names of the itemParameters list that are not the "base" group. |
focalDistribution |
Either a string or a list of strings stating the distribution name to be used for integrating for each non base group. Only used if focalAbilities is NULL. If a list, names of the list must coincide with the names of the itemParameters list that are not the "base" group. IF a single string, the same distribution will be used for all pairwise computation of NCDIF. |
relSizes |
If not NULL, a numeric vector with named components containing the relative sizes of the groups. Used to obtain the weighted average of the pairwise NCDIF statistics. If NULL and focalAbilities is NULL, defaults to 1/length(focalDistribution) |
subdivisions |
A numeric value indicating the number of subdivisions for numerical integration. Only used if focalAbilities is NULL. |
logistic |
A logical value stating if the IRT model will use the logistic or the normal metric. Defaults to using the logistic metric by fixing the D constant to 1. If FALSE the constant is set to 1.702 so that the normal metric is used. |
focalDistrExtra |
Extra parameters for the focal group distribution function if needed. If focalDistribution is a list, then names(focalDistrExtra) must coincide with names(focalDistribution). |
mgncdif Numeric vector with the MG-NCDIF index value for each item.
Victor H. Cervantes <vhcervantesb at unal.edu.co>
Oshima, T. C., Wright, K., & White, N. (2014). Multiple-Group Noncompensatory Differential Item Functioning in Raju’s Differential Functioning of Items and Tests. International Journal of Testing, 15, 254–273.
# Data fom Oshima, Wright and White baseParameters <- matrix(c(0.49, -0.07, 0.19, 0.92, 0.21, 0.15, 1.26, 0.54, 0.05, 0.61, -0.03, 0.18, 1.74, 0.01, 0.12, 0.50, 1.96, 0.12, 0.96, 0.04, 0.13, 0.59, -0.09, 0.18, 0.82, -1.16, 0.17, 1.26, 0.02, 0.11, 0.82, 0.20, 0.07, 0.75, -0.43, 0.15, 1.49, -0.06, 0.09, 0.97, -0.34, 0.12, 1.49, 0.05, 0.12, 0.89, -0.25, 0.15, 1.45, 0.06, 0.07, 0.75, 0.31, 0.18, 1.43, 0.04, 0.08, 0.60, 0.13, 0.22, 0.83, 0.52, 0.09, 0.56, -0.96, 0.19, 0.67, -0.79, 0.20, 0.70, 0.37, 0.18, 1.03, -0.71, 0.14, 0.89, -0.19, 0.21, 1.23, 0.74, 0.06, 0.90, -0.44, 0.18, 1.23, -0.17, 0.12, 0.69, 0.53, 0.17), byrow = TRUE, ncol = 3) group1Pars <- group2Pars <- group3Pars <- group4Pars <- group5Pars <- baseParameters group1Pars[c(4, 22), 1] <- group1Pars[c(4, 22), 1] + .4 group1Pars[c(7, 22), 2] <- group1Pars[c(7, 22), 2] + .7 group2Pars[c(13, 28), 1] <- group2Pars[c(13, 28), 1] - .4 group2Pars[c(19, 28), 2] <- group2Pars[c(19, 28), 2] - .7 group3Pars[c(4, 13), 1] <- group3Pars[c(4, 13), 1] + .4 group3Pars[c(4, 22), 2] <- group3Pars[c(4, 22), 2] - .7 group4Pars[c(7, 28), 1] <- group4Pars[c(7, 28), 1] - .4 group4Pars[c(7, 19), 2] <- group4Pars[c(7, 19), 2] + .7 itemParameters <- list(base = baseParameters, group1 = group1Pars, group2 = group2Pars, group3 = group3Pars, group4 = group4Pars, group5 = group5Pars ) itemCovariances <- lapply(itemParameters, AseIrt, irtModel = "2pl") relSizes <- rep(.2, 5) names(relSizes) <- names(itemParameters)[-1] threePlMGNcdif <- MGNcdif(itemParameters = itemParameters, irtModel = '3pl', focalAbilities = NULL, focalDistribution = "norm", relSizes = relSizes, subdivisions = 5000, logistic = TRUE)
# Data fom Oshima, Wright and White baseParameters <- matrix(c(0.49, -0.07, 0.19, 0.92, 0.21, 0.15, 1.26, 0.54, 0.05, 0.61, -0.03, 0.18, 1.74, 0.01, 0.12, 0.50, 1.96, 0.12, 0.96, 0.04, 0.13, 0.59, -0.09, 0.18, 0.82, -1.16, 0.17, 1.26, 0.02, 0.11, 0.82, 0.20, 0.07, 0.75, -0.43, 0.15, 1.49, -0.06, 0.09, 0.97, -0.34, 0.12, 1.49, 0.05, 0.12, 0.89, -0.25, 0.15, 1.45, 0.06, 0.07, 0.75, 0.31, 0.18, 1.43, 0.04, 0.08, 0.60, 0.13, 0.22, 0.83, 0.52, 0.09, 0.56, -0.96, 0.19, 0.67, -0.79, 0.20, 0.70, 0.37, 0.18, 1.03, -0.71, 0.14, 0.89, -0.19, 0.21, 1.23, 0.74, 0.06, 0.90, -0.44, 0.18, 1.23, -0.17, 0.12, 0.69, 0.53, 0.17), byrow = TRUE, ncol = 3) group1Pars <- group2Pars <- group3Pars <- group4Pars <- group5Pars <- baseParameters group1Pars[c(4, 22), 1] <- group1Pars[c(4, 22), 1] + .4 group1Pars[c(7, 22), 2] <- group1Pars[c(7, 22), 2] + .7 group2Pars[c(13, 28), 1] <- group2Pars[c(13, 28), 1] - .4 group2Pars[c(19, 28), 2] <- group2Pars[c(19, 28), 2] - .7 group3Pars[c(4, 13), 1] <- group3Pars[c(4, 13), 1] + .4 group3Pars[c(4, 22), 2] <- group3Pars[c(4, 22), 2] - .7 group4Pars[c(7, 28), 1] <- group4Pars[c(7, 28), 1] - .4 group4Pars[c(7, 19), 2] <- group4Pars[c(7, 19), 2] + .7 itemParameters <- list(base = baseParameters, group1 = group1Pars, group2 = group2Pars, group3 = group3Pars, group4 = group4Pars, group5 = group5Pars ) itemCovariances <- lapply(itemParameters, AseIrt, irtModel = "2pl") relSizes <- rep(.2, 5) names(relSizes) <- names(itemParameters)[-1] threePlMGNcdif <- MGNcdif(itemParameters = itemParameters, irtModel = '3pl', focalAbilities = NULL, focalDistribution = "norm", relSizes = relSizes, subdivisions = 5000, logistic = TRUE)
Calculates NCDIF index for an item with given item parameters of focal and reference groups.
Ncdif( itemParameters, irtModel = "2pl", focalAbilities = NULL, focalDistribution = "norm", subdivisions = 5000, logistic = TRUE, focalDistrExtra = list(mean = 0, sd = 1) )
Ncdif( itemParameters, irtModel = "2pl", focalAbilities = NULL, focalDistribution = "norm", subdivisions = 5000, logistic = TRUE, focalDistrExtra = list(mean = 0, sd = 1) )
itemParameters |
A list containing "focal" and "reference" item parameters. Item parameters are assumed to be on the same scale. Item parameters for each group should me a matrix with nrow equal to the number of items. |
irtModel |
A string stating the irtModel to be used. Should be one of "1pl", "2pl", "3pl", "grm" or "pcm". |
focalAbilities |
If NULL, NCDIF is calculated by numerical integration of focal distribution. If not NULL, it must be a numerical vector containing the abilities for the individuals in the focal group. |
focalDistribution |
A string stating the distribution name to be used for integrating. Only used if focalAbilities is NULL. |
subdivisions |
A numeric value indicating the number of subdivisions for numerical integration. Only used if focalAbilities is NULL. |
logistic |
A logical value stating if the IRT model will use the logistic or the normal metric. Defaults to using the logistic metric by fixing the D constant to 1. If FALSE the constant is set to 1.702 so that the normal metric is used. |
focalDistrExtra |
Extra parameters for the focal group distribution function if needed. |
ncdif Numeric vector with the NCDIF index value for each item.
Victor H. Cervantes <vhcervantesb at unal.edu.co>
Raju, N. S., van der Linden, W. J., & Fleer, P. F. (1995). IRT-based internal measures of differential functioning of items and tests. Applied Psychological Measurement, 19, 353–368. doi:10.1177/014662169501900405
data(dichotomousItemParameters) threePlParameters <- dichotomousItemParameters isNot3Pl <- ((dichotomousItemParameters[['focal']][, 3] == 0) | (dichotomousItemParameters[['reference']][, 3] == 0)) threePlParameters[['focal']] <- threePlParameters[['focal']][!isNot3Pl, ] threePlParameters[['reference']] <- threePlParameters[['reference']][!isNot3Pl, ] threePlParameters[['focal']][, 3] <- threePlParameters[['focal']][, 3] + 0.1 threePlParameters[['reference']][, 3] <- threePlParameters[['reference']][, 3] + 0.1 threePlParameters[['focal']][, 2] <- threePlParameters[['focal']][, 2] + 1.5 threePlParameters[['reference']][, 2] <- threePlParameters[['reference']][, 2] + 1.5 threePlParameters[['focal']] <- threePlParameters[['focal']][-c(12, 16, 28), ] threePlParameters[['reference']] <- threePlParameters[['reference']][-c(12, 16, 28), ] threePlNcdif <- Ncdif(itemParameters = threePlParameters, irtModel = '3pl', focalAbilities = NULL, focalDistribution = "norm", subdivisions = 5000, logistic = TRUE)
data(dichotomousItemParameters) threePlParameters <- dichotomousItemParameters isNot3Pl <- ((dichotomousItemParameters[['focal']][, 3] == 0) | (dichotomousItemParameters[['reference']][, 3] == 0)) threePlParameters[['focal']] <- threePlParameters[['focal']][!isNot3Pl, ] threePlParameters[['reference']] <- threePlParameters[['reference']][!isNot3Pl, ] threePlParameters[['focal']][, 3] <- threePlParameters[['focal']][, 3] + 0.1 threePlParameters[['reference']][, 3] <- threePlParameters[['reference']][, 3] + 0.1 threePlParameters[['focal']][, 2] <- threePlParameters[['focal']][, 2] + 1.5 threePlParameters[['reference']][, 2] <- threePlParameters[['reference']][, 2] + 1.5 threePlParameters[['focal']] <- threePlParameters[['focal']][-c(12, 16, 28), ] threePlParameters[['reference']] <- threePlParameters[['reference']][-c(12, 16, 28), ] threePlNcdif <- Ncdif(itemParameters = threePlParameters, irtModel = '3pl', focalAbilities = NULL, focalDistribution = "norm", subdivisions = 5000, logistic = TRUE)
Plot the item characteristic (expected score) curve for focal and reference groups for the iiItem along with a representation of the focal group density.
PlotNcdif( iiItem, itemParameters, irtModel = "2pl", logistic = TRUE, plotDensity = FALSE, focalAbilities = NULL, focalDistribution = "norm", focalDistrExtra = list(mean = 0, sd = 1), from = -5, to = 5, thetaInt = 0.01, colour = TRUE, highColour = "blue", main = "", xlab = "Ability", ylab = "Probability", iccText = "Group ICCs", focalIccText = "Focal group ICC", referenceIccText = "Reference group ICC", focalDensityText = "Focal group density" )
PlotNcdif( iiItem, itemParameters, irtModel = "2pl", logistic = TRUE, plotDensity = FALSE, focalAbilities = NULL, focalDistribution = "norm", focalDistrExtra = list(mean = 0, sd = 1), from = -5, to = 5, thetaInt = 0.01, colour = TRUE, highColour = "blue", main = "", xlab = "Ability", ylab = "Probability", iccText = "Group ICCs", focalIccText = "Focal group ICC", referenceIccText = "Reference group ICC", focalDensityText = "Focal group density" )
iiItem |
Item (row) number for the item in each of the itemParameter matrices to plot. |
itemParameters |
A list containing "focal" and "reference" item parameters. Item parameters are assumed to be on the same scale. Item parameters for each group should me a matrix with nrow equal to the number of items. |
irtModel |
A string stating the irtModel to be used. Should be one of "1pl", "2pl", "3pl", "grm" or "pcm". |
logistic |
A logical value stating if the IRT model will use the logistic or the normal metric. |
plotDensity |
logical indicating if the focal distribution density should be plotted as a density curve (TRUE) or if it should be represented as an area gradient (FALSE). Defaults to gradient. |
focalAbilities |
If NULL, density is calculated theoretically from focal distribution. If not NULL, it must be a numerical vector containing the abilities for the individuals in the focal group. |
focalDistribution |
A string stating the distribution name to be used for density calculation. Only used if focalAbilities is NULL. |
focalDistrExtra |
Extra parameters for the focal group distribution function if needed. |
from |
value on the x-axis to serve as minimum for the plot |
to |
value on the x-axis to serve as maximum for the plot |
thetaInt |
value for the x-axis step for probabilities and density evaluation. Only used if focalAbilities is NULL. |
colour |
logical value indicating if the area gradient should be presented in colour when plotDensity is FALSE, or if the different lines should be presented in colour when plotDensity is TRUE. |
highColour |
character indicating the colour text name that should be used for high density regions. |
main |
text for plot main title. |
xlab |
text for x-axis label. |
ylab |
text for y-axis label. |
iccText |
text for legend title related to ICC curves. |
focalIccText |
legend for focal group ICC curve. |
referenceIccText |
legend for reference group ICC curve. |
focalDensityText |
legend for focal group density curve when plotDensity is TRUE. Text for legend title related to the colour gradient when plotDensity is FALSE. |
plotNCDIF A ggplot object for the plot
Victor H. Cervantes <vhcervantesb at unal.edu.co>
data(dichotomousItemParameters) threePlParameters <- dichotomousItemParameters isNot3Pl <- ((dichotomousItemParameters[['focal']][, 3] == 0) | (dichotomousItemParameters[['reference']][, 3] == 0)) threePlParameters[['focal']] <- threePlParameters[['focal']][!isNot3Pl, ] threePlParameters[['reference']] <- threePlParameters[['reference']][!isNot3Pl, ] threePlParameters[['focal']][, 3] <- threePlParameters[['focal']][, 3] + 0.1 threePlParameters[['reference']][, 3] <- threePlParameters[['reference']][, 3] + 0.1 threePlParameters[['focal']][, 2] <- threePlParameters[['focal']][, 2] + 1.5 threePlParameters[['reference']][, 2] <- threePlParameters[['reference']][, 2] + 1.5 threePlParameters[['focal']] <- threePlParameters[['focal']][-c(12, 16, 28), ] threePlParameters[['reference']] <- threePlParameters[['reference']][-c(12, 16, 28), ] # # Non Uniform - != guess DIF item PlotNcdif(iiItem = 22, itemParameters = threePlParameters, irtModel = "3pl", plotDensity = FALSE, main = "Item 22 Non uniform and different guessing DIF. 3PL") # # Uniform - != guess DIF item PlotNcdif(iiItem = 15, itemParameters = threePlParameters, irtModel = "3pl", plotDensity = FALSE, main = "Item 15 Uniform and different guessing DIF. 3PL")
data(dichotomousItemParameters) threePlParameters <- dichotomousItemParameters isNot3Pl <- ((dichotomousItemParameters[['focal']][, 3] == 0) | (dichotomousItemParameters[['reference']][, 3] == 0)) threePlParameters[['focal']] <- threePlParameters[['focal']][!isNot3Pl, ] threePlParameters[['reference']] <- threePlParameters[['reference']][!isNot3Pl, ] threePlParameters[['focal']][, 3] <- threePlParameters[['focal']][, 3] + 0.1 threePlParameters[['reference']][, 3] <- threePlParameters[['reference']][, 3] + 0.1 threePlParameters[['focal']][, 2] <- threePlParameters[['focal']][, 2] + 1.5 threePlParameters[['reference']][, 2] <- threePlParameters[['reference']][, 2] + 1.5 threePlParameters[['focal']] <- threePlParameters[['focal']][-c(12, 16, 28), ] threePlParameters[['reference']] <- threePlParameters[['reference']][-c(12, 16, 28), ] # # Non Uniform - != guess DIF item PlotNcdif(iiItem = 22, itemParameters = threePlParameters, irtModel = "3pl", plotDensity = FALSE, main = "Item 22 Non uniform and different guessing DIF. 3PL") # # Uniform - != guess DIF item PlotNcdif(iiItem = 15, itemParameters = threePlParameters, irtModel = "3pl", plotDensity = FALSE, main = "Item 15 Uniform and different guessing DIF. 3PL")
This data set contains the item parameters found in Raju, N., Fortmann-Johnson, K., Kim, W., Morris, S., Nering, M. & Oshima, T. (2009). The item parameter replication method for detecting differential functioning in the polytomous DFIT framework. Applied psychological measurement, 33(2), 133–147.
data(polytomousItemParameters)
data(polytomousItemParameters)
a list with 'focal' and 'reference' elements. Each is a matrix
1 row per item by 5 columns: item discrimination, four item step parameters.
This data set contains the item parameters based on those found in Raju et al. (2009).
Raju, N., Fortmann-Johnson, K., Kim, W., Morris, S., Nering, M. & Oshima, T. (2009). The item parameter replication method for detecting differential functioning in the polytomous DFIT framework. Applied psychological measurement, 33(2), 133–147. doi: 10.1177/01466216083319514
Calculates the product of item response probabilities for dichotomous IRT models
ProductProbabilities(thetaValue, itemParameters, logistic, irtModel = "3pl")
ProductProbabilities(thetaValue, itemParameters, logistic, irtModel = "3pl")
thetaValue |
A numeric value or array for the theta (ability) value(s) for which the product will be calculated |
itemParameters |
A matrix containing the item parameters. |
logistic |
A logical indicating whether the logistic or the normal metric should be used. |
irtModel |
A string stating the irtModel used. May be one of "1pl", "2pl", or "3pl". |
pq A numeric matrix containing the crossed product on each thetaValue for each item.
Victor H. Cervantes <vhcervantesb at unal.edu.co>
Calculates Raju's Signed Area Measure index for an item with given item parameters of focal and reference groups.
SignedArea( itemParameters, irtModel = "2pl", subdivisions = 5000, logistic = TRUE )
SignedArea( itemParameters, irtModel = "2pl", subdivisions = 5000, logistic = TRUE )
itemParameters |
A list containing "focal" and "reference" item parameters. Item parameters are assumed to be on the same scale. Item parameters for each group should me a matrix with nrow equal to the number of items. |
irtModel |
A string stating the irtModel to be used. Should be one of "1pl", "2pl", "3pl", "grm" or "pcm". |
subdivisions |
A numeric value indicating the number of subdivisions for numerical integration. |
logistic |
A logical value stating if the IRT model will use the logistic or the normal metric. Defaults to using the logistic metric by fixing the D constant to 1. If FALSE the constant is set to 1.702 so that the normal metric is used. |
sam A numeric matrix with the Signed Area Measure values for all the item parameter in each set of itemParameterList
Victor H. Cervantes <vhcervantesb at unal.edu.co>
Cohen, A., Kim, S-H and Baker , F. (1993). Detection of differential item functioning in the Graded Response Model. Applied psychological measurement, 17(4), 335-350. doi:10.1177/014662169301700402
Raju, N. (1988). The area between two item characteristic curves. Psychometrika, 53(4), 495–502. doi:10.1007/bf02294403
data(dichotomousItemParameters) threePlParameters <- dichotomousItemParameters isNot3Pl <- ((dichotomousItemParameters[['focal']][, 3] == 0) | (dichotomousItemParameters[['reference']][, 3] == 0)) threePlParameters[['focal']] <- threePlParameters[['focal']][!isNot3Pl, ] threePlParameters[['reference']] <- threePlParameters[['reference']][!isNot3Pl, ] threePlParameters[['focal']][, 3] <- threePlParameters[['focal']][, 3] + 0.1 threePlParameters[['reference']][, 3] <- threePlParameters[['reference']][, 3] + 0.1 threePlParameters[['focal']][, 2] <- threePlParameters[['focal']][, 2] + 1.5 threePlParameters[['reference']][, 2] <- threePlParameters[['reference']][, 2] + 1.5 threePlParameters[['focal']] <- threePlParameters[['focal']][-c(12, 16, 28), ] threePlParameters[['reference']] <- threePlParameters[['reference']][-c(12, 16, 28), ] sam3pl <- SignedArea(itemParameters = threePlParameters, irtModel = "3pl", subdivisions = 5000, logistic = TRUE)
data(dichotomousItemParameters) threePlParameters <- dichotomousItemParameters isNot3Pl <- ((dichotomousItemParameters[['focal']][, 3] == 0) | (dichotomousItemParameters[['reference']][, 3] == 0)) threePlParameters[['focal']] <- threePlParameters[['focal']][!isNot3Pl, ] threePlParameters[['reference']] <- threePlParameters[['reference']][!isNot3Pl, ] threePlParameters[['focal']][, 3] <- threePlParameters[['focal']][, 3] + 0.1 threePlParameters[['reference']][, 3] <- threePlParameters[['reference']][, 3] + 0.1 threePlParameters[['focal']][, 2] <- threePlParameters[['focal']][, 2] + 1.5 threePlParameters[['reference']][, 2] <- threePlParameters[['reference']][, 2] + 1.5 threePlParameters[['focal']] <- threePlParameters[['focal']][-c(12, 16, 28), ] threePlParameters[['reference']] <- threePlParameters[['reference']][-c(12, 16, 28), ] sam3pl <- SignedArea(itemParameters = threePlParameters, irtModel = "3pl", subdivisions = 5000, logistic = TRUE)
Calculates Raju's Unsigned Area Measure index for an item with given item parameters of focal and reference groups.
UnsignedArea( itemParameters, irtModel = "2pl", subdivisions = 5000, logistic = TRUE )
UnsignedArea( itemParameters, irtModel = "2pl", subdivisions = 5000, logistic = TRUE )
itemParameters |
A list containing "focal" and "reference" item parameters. Item parameters are assumed to be on the same scale. Item parameters for each group should me a matrix with nrow equal to the number of items. |
irtModel |
A string stating the irtModel to be used. Should be one of "1pl", "2pl", "3pl", "grm" or "pcm". |
subdivisions |
A numeric value indicating the number of subdivisions for numerical integration. |
logistic |
A logical value stating if the IRT model will use the logistic or the normal metric. Defaults to using the logistic metric by fixing the D constant to 1. If FALSE the constant is set to 1.702 so that the normal metric is used. |
uam A numeric matrix with the Unsigned Area Measure values for all the item parameter in each set of itemParameterList
Victor H. Cervantes <vhcervantesb at unal.edu.co>
Cohen, A., Kim, S-H and Baker , F. (1993). Detection of differential item functioning in the Graded Response Model. Applied psychological measurement, 17(4), 335-350. doi:10.1177/014662169301700402
Raju, N. (1988). The area between two item characteristic curves. Psychometrika, 53(4), 495–502. doi:10.1007/bf02294403
data(dichotomousItemParameters) threePlParameters <- dichotomousItemParameters isNot3Pl <- ((dichotomousItemParameters[['focal']][, 3] == 0) | (dichotomousItemParameters[['reference']][, 3] == 0)) threePlParameters[['focal']] <- threePlParameters[['focal']][!isNot3Pl, ] threePlParameters[['reference']] <- threePlParameters[['reference']][!isNot3Pl, ] threePlParameters[['focal']][, 3] <- threePlParameters[['focal']][, 3] + 0.1 threePlParameters[['reference']][, 3] <- threePlParameters[['reference']][, 3] + 0.1 threePlParameters[['focal']][, 2] <- threePlParameters[['focal']][, 2] + 1.5 threePlParameters[['reference']][, 2] <- threePlParameters[['reference']][, 2] + 1.5 threePlParameters[['focal']] <- threePlParameters[['focal']][-c(12, 16, 28), ] threePlParameters[['reference']] <- threePlParameters[['reference']][-c(12, 16, 28), ] uam3pl <- UnsignedArea(itemParameters = threePlParameters, irtModel = "3pl", subdivisions = 5000, logistic = TRUE)
data(dichotomousItemParameters) threePlParameters <- dichotomousItemParameters isNot3Pl <- ((dichotomousItemParameters[['focal']][, 3] == 0) | (dichotomousItemParameters[['reference']][, 3] == 0)) threePlParameters[['focal']] <- threePlParameters[['focal']][!isNot3Pl, ] threePlParameters[['reference']] <- threePlParameters[['reference']][!isNot3Pl, ] threePlParameters[['focal']][, 3] <- threePlParameters[['focal']][, 3] + 0.1 threePlParameters[['reference']][, 3] <- threePlParameters[['reference']][, 3] + 0.1 threePlParameters[['focal']][, 2] <- threePlParameters[['focal']][, 2] + 1.5 threePlParameters[['reference']][, 2] <- threePlParameters[['reference']][, 2] + 1.5 threePlParameters[['focal']] <- threePlParameters[['focal']][-c(12, 16, 28), ] threePlParameters[['reference']] <- threePlParameters[['reference']][-c(12, 16, 28), ] uam3pl <- UnsignedArea(itemParameters = threePlParameters, irtModel = "3pl", subdivisions = 5000, logistic = TRUE)