dif_mh: Mantel-Haenszel DIF method

View source: R/MH-Functions.R

dif_mhR Documentation

Mantel-Haenszel DIF method

Description

Conducts DIF analysis with the Mantel-Haenszel method

Usage

dif_mh(
  item.data,
  dif.groups,
  match.type,
  match.scores,
  match.bins = NULL,
  exclude = NULL,
  stop = TRUE
)

Arguments

item.data

A data.frame of dichotomous item responses with subjects in rows and items in columns.

dif.groups

factor vector of group membership for which DIF is evaluated.

match.type

For the loess, MH, and logistic methods, a character indicating whether a total summed score ("Total"; default) or the summed score excluding the item under investigation ("Rest") should be used as the stratifying variable.

match.scores

A numeric vector (if match.type = "Total") or list of ncol(item.data) numeric vectors (if match.type = "Rest") of match scores used as the stratifying variable in the MH procedure.

match.bins

For MH, an optional vector of bin sizes for stratifying the match.type score. This is passed to the probs argument of stats::quantile. See examples for usage.

exclude

character vector of column names in item.data to exclude from DIF analysis, such as the anchor items or (currently) polytomous items.

stop

If FALSE, when possible, errors will return NA for the item under investigation rather than stop the analysis completely (default is TRUE.

Details

run_mh conducts a Mantel-Haenszel test via mantelhaen.test for each item in item.data, except those specified in exclude, grouped by dif.groups and stratified by the scores supplied to match.scores, which, if specified, are binned by match.bins. Biased items are identified through a two-step process of initial and refinement phases.

Value

A list containing

  • a data.frame with MH results for each item in item.data

  • an integer vector of the items showing DIF (i.e., biased items)


knickodem/WBdif documentation built on Feb. 3, 2024, 2:20 a.m.