acc_mi: PVB correction by multiple imputation

View source: R/PVBcorrect_functions.R

acc_miR Documentation

PVB correction by multiple imputation

Description

Perform PVB correction by multiple imputation.

Usage

acc_mi(
  data,
  test,
  disease,
  covariate = NULL,
  ci = FALSE,
  ci_level = 0.95,
  m = 100,
  method = "logreg",
  seednum = NA,
  mi_print = FALSE,
  description = TRUE
)

Arguments

data

A data frame, with at least "Test" and "Disease" variables.

test

The "Test" variable name, i.e. the test result. The variable must be in binary; positive = 1, negative = 0 format.

disease

The "Disease" variable name, i.e. the true disease status. The variable must be in binary; positive = 1, negative = 0 format.

covariate

The name(s) of covariate(s), i.e. other variables associated with either test or disease status. Specify as name vector, e.g. c("X1", "X2") for two or more variables. The variables must be in formats acceptable to GLM.

ci

View confidence interval (CI). The default is FALSE.

ci_level

Set the CI width. The default is 0.95 i.e. 95% CI.

m

The number of imputation, m.

method

Imputation method. The default is "logreg". Other allowed methods are "logreg.boot", "pmm", "midastouch", "sample", "cart", "rf". See mice for details of these methods.

seednum

Set the seed number for the bootstrapped CI. The default is not set, so it depends on the user to set it outside or inside the function.

mi_print

Print multiple imputation history on console. This is mice print option. The default is FALSE.

description

Print the name of this analysis. The default is TRUE. This can be turned off for repeated analysis, for example in bootstrapped results.

Value

A list object containing:

acc_results

The accuracy results.

References

  1. Harel, O., & Zhou, X.-H. (2006). Multiple imputation for correcting verification bias. Statistics in Medicine, 25(22), 3769–3786.

Examples

# no covariate
acc_mi(data = cad_pvb, test = "T", disease = "D", ci = TRUE, seednum = 12345, m = 10)

# with other imputation method. e.g. random forest "rf"
acc_mi(data = cad_pvb, test = "T", disease = "D", ci = TRUE, seednum = 12345, m = 10,
       method = "rf")

# with three covariates
acc_mi(data = cad_pvb, test = "T", disease = "D", covariate = c("X1", "X2", "X3"),
       ci = TRUE, seednum = 12345, m = 10)

wnarifin/PVBcorrect documentation built on May 12, 2024, 4:13 p.m.