SimDichoDif: Generation of DIF for dichotomous items

View source: R/SimDichoDif.R

SimDichoDifR Documentation

Generation of DIF for dichotomous items

Description

Function to generate DIF for dichotomous items using the 2PL model.

Usage

SimDichoDif(It, ItDIFa, ItDIFb, NR, NF,
            a = rep(1, It), b,
            Ga = rep(0, length(ItDIFa)), Gb = rep(0, length(ItDIFb)),
            D = 1, thR = NULL, thF = NULL,
            muR = 0, muF = 0, sigR = 1, sigF = 1)

Arguments

It

It: Number of items

ItDIFa

Vector of integers specifying which items have DIF for a parameters.

ItDIFb

Vector of integers specifying which items have DIF for b parameters.

NR

Number of respondents for reference group.

NF

Number of respondents for focal group (generalize to multiple focal groups).

a

Item slope for reference group.

b

Item difficulty for reference group.

Gb

Vector of difference in b's for focal group(s).

Ga

Vector of difference in a's for focal group(s).

D

Scaling parameter for 2PL. Defaults to 1.

thR

Optional vector of latent variable values for reference group.

thF

Optional vector of latent variable values for focal group.

muR

Mean of latent variable for reference group. Used if latent scores not supplied.

muF

Mean of latent variable for reference group. Used if latent scores not supplied.

sigR

Standard deviation of latent variable for reference group. Used if latent scores not supplied.

sigF

Standard deviation of latent variable for reference group. Used if latent scores not supplied.

Details

This function is based on the 2PL model to test uniform, non-uniform of both DIF. To use the Rasch model, please restrict a parameter to 1.

Value

A list with several arguments:

data

the matrix with DIF items.

ipars

the item parameters.

thetas

the person parameters.

Author(s)

Sebastien Beland
Faculte des sciences de l'education
Universite de Montreal (Canada)
sebastien.beland@umontreal.ca
Carl F. Falk
Department of Psychology
McGill University (Canada)
carl.falk@mcgill.ca, https://www.mcgill.ca/psychology/carl-f-falk

References

Berger, M., & Tutz, G. (2016). Detection of Uniform and Nonuniform Differential Item Functioning by Item-Focused Trees. Journal of Educational and Behavioral Statistics, 41(6), 559–592. https://doi.org/10.3102/1076998616659371

Examples

## Not run: 

# test to generate UDIF

It   <- 15 # number of items
ItDIFa <- NULL
ItDIFb <- c(1,3)
NR   <- 100 # number of responses for group 1 (reference)
NF   <- 100 # number of responses for group 2 (focal)
a    <- rep(1,It)          # for tests: runif(It,0.2,.5)  
b    <- rnorm(It,1,.5)  
Gb   <- rep(2,2)           # Group value for U-DIF
Ga   <- 0                  # Group value for NU-DIF: need to be fix to 0 for U-DIF
#Type <- "UDIF"
#seed <- 1

Out1 <- SimDichoDif(It,ItDIFa,ItDIFb,NR,NF,a,b,Ga,Gb)
Out1
Out1$ipars

# Test to generate NUDIF

It   <- 15                # Nb of items with DIF
ItDIFa <- c(1,3)
ItDIFb <- c(1,3)
NR   <- 100              # N for Ref.
NF   <- 100              # N for Focal
a    <- rep(1,It)        # For Rasch or any value for 1PL
b    <- rnorm(It,1,.5)   # Item difficulties from random normal 
Gb   <- rep(.8,2)        # Group value for U-DIF
Ga   <- rep(1.2,2)       # Group value for NU-DIF
#Type <- "NUDIF"
#seed <- 1

Out2 <- SimDichoDif(It,ItDIFa,ItDIFb,NR,NF,a,b,Ga,Gb)
Out2
Out2$ipars

# Generates a mix of UDIF and NUDIF

It   <- 15                # Nb of items with DIF
ItDIFa <- c(1)
ItDIFb <- c(1,3)
NR   <- 100              # N for Ref.
NF   <- 100              # N for Focal
a    <- rep(1,It)        # For Rasch or any value for 1PL
b    <- rnorm(It,1,.5)   # Item difficulties from random normal 
Gb   <- rep(.8,2)        # Group value for U-DIF
Ga   <- 1.2              # Group value for NU-DIF
#Type <- "NUDIF"
#seed <- 1

Out3 <- SimDichoDif(It,ItDIFa,ItDIFb,NR,NF,a,b,Ga,Gb)
Out3
Out3$ipars

 
## End(Not run)
 

difR documentation built on June 8, 2025, 1:03 p.m.