mstDIF: A general function to detect differential item functioning...

View source: R/mstDIF.R

mstDIFR Documentation

A general function to detect differential item functioning (DIF) in multistage tests (MSTs)

Description

This function allows the application of various methods for the detection of differential item functioning in multistage tests. Currently five methods are implemented: 1. Logistic Regression, 2. mstSIB, 3. analytical score-base tests, 4. a score-based Bootstrap test, 5. a score-based permutation test. The required input depends on the chosen DIF test.

Usage

## Default S3 method:
mstDIF(resp, DIF_covariate, method, theta = NULL, see = NULL, ...)

## S3 method for class 'AllModelClass'
mstDIF(
  object,
  DIF_covariate,
  method,
  theta = NULL,
  see = NULL,
  theta_method = "WLE",
  ...
)

## S3 method for class 'dRm'
mstDIF(object, DIF_covariate, method, theta = NULL, see = NULL, ...)

Arguments

resp, object

A data frame or matrix containing the response matrix. Rows correspond to respondents, columns to items. Or an object of class SingleGroup-class or MultiGroup-class object as returned by mirt, or a dRm object as returned by the RM function in eRm.

DIF_covariate

A vector of ability estimates for each respondent.

method

A character value indicating the DIF test that should be used. Possible values are "logreg" (Logistic regression), "mstsib" (mstSIB), "bootstrap" (score-based Bootstrap test), "permutation" (score-based) permutation test) and "analytical" (analytical score-based test).

theta

Estimates of the ability parameters.

see

Estimates of the standard error of estimation.

...

Additional, test-specific arguments.

theta_method

Method for estimating the ability parameters if they should be estimated based on the responses. The calculation is carried out by the mirt package. Can be: "WLE" (default), "MAP", "EAP", "ML", "EAPsum", "plausible", "classify".

Details

Author: Rudolf Debelak and Dries Debeer

Value

An object of class mstDIF, which is a list with the following elements:

resp

The response matrix as a data frame.

method

The used DIF detection method.

test

The used test or statistic.

DIF_covariate

The person covariate tested for DIF.

DIF_test

A list with the DIF-test results.

call

The function call.

method_results

The complete output of the selected DIF test. Details depend on the DIF test.

Methods (by class)

  • mstDIF(default): Default mstDIF method

  • mstDIF(AllModelClass): mstDIF method for mirt-objects

  • mstDIF(dRm): mstDIF method for dRm-objects

See Also

mstDIF-Methods

Examples


## load data
data("toydata")
resp <- toydata$resp
group_categ <- factor(toydata$group_categ)
theta_est <- toydata$theta_est
see_est <- toydata$see_est

## test DIF along a categorical covariate (a factor) using the
## logistic regression method
res1 <- mstDIF(resp, DIF_covariate = group_categ, method = "logreg",
theta = theta_est)
res1
summary(res1)

## test DIF along a categorical covariate (a factor) using the
## mstSIB method
res2 <- mstDIF(resp, DIF_covariate = factor(group_categ), method = "mstsib",
theta = theta_est, see = see_est)
res2
summary(res2)


mstDIF documentation built on Dec. 2, 2022, 5:10 p.m.