summary_report: Summarize DIF analysis and treatment effect robustness checks

View source: R/Summary-Report.R

summary_reportR Documentation

Summarize DIF analysis and treatment effect robustness checks

Description

Conduct a DIF analysis, estimate treatment effect robustness, and produce report summarizing results

Usage

summary_report(
  dif.data,
  file.name,
  report.type = "dif.effects",
  report.format = "html_document",
  report.title = file.name,
  measure.name = "measure",
  dataset.name = "dataset",
  dif.methods = c("loess", "MH", "logistic", "IRT"),
  biased.items = "IRT",
  match.type = "Total",
  match.bins = NULL,
  item.type = NULL,
  irt.scoring = "WLE"
)

Arguments

dif.data

an object returned from dif_prep

file.name

File name to create on disk. The file path can also be specified here. If the path is omitted, the file is saved to the working directory.

report.type

A character indicating which type of report to produce: including both the DIF analysis results and treatment effect robustness checks ("dif.effects"; default), only DIF analysis ("dif.only"), or only treatment effect robustness checks ("effects.only").

report.format

File format of the report. Default is HTML ("html_document"). See render for other options.

report.title

An optional character string indicating the report title, which is printed in the report.

measure.name

An optional character string naming the measure being evaluated, which is printed in the report.

dataset.name

An optional character string naming the dataset used, which is printed in the report.

dif.methods

character vector with one or more methods of of investigating DIF: locally estimated scatterplot smoothing ("loess"), Mantel-Haenszel test ("MH"), logistic regression ("logistic"), and multi-group item response theory ("IRT"). The default is all four methods with dichotomous items and c("loess", "IRT") when polytomous items are detected; MH and logistic can only accommodate dichotomous data.

biased.items

Οne of c("MH", "logistic", "IRT"). Determines which DIF method should be used to identify biased items. Default is "IRT".

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

item.type

For IRT, the type of model to fit for each item. The default is "2PL" for dichotomous items and "graded" for polytomous items. See mirt for more options and details.

irt.scoring

What type of IRT scoring procedure should be used? Passed to the method argument of fscores. See help(fscores, mirt).

Details

This function is a wrapper around dif_analysis, dif_models, effect_robustness, and dif_report in order to simplify report production when desired.

Value

a summary report of the DIF analysis, treatment effect robustness checks, or both

Examples

data("mdat")

# prep data
dif.data <- dif_data_prep(item.data = mdat`[`5:ncol(mdat)],
                          dif.group.id = mdat$gender,
                          tx.group.id = mdat$treated,
                          cluster.id = mdat$clusterid,
                          na.to.0 = TRUE)

summary_report(dif.data = dif.data,
               file.name = "DIF-Effects-Gender-MDAT-Language",
               report.type = "dif.effects",
               report.title = "MDAT Language: Gender DIF and Tx Effects",
               measure.name = "MDAT Language")

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