acc_ebg: PVB correction by extended Begg and Greenes' method

View source: R/PVBcorrect_functions.R

acc_ebgR Documentation

PVB correction by extended Begg and Greenes' method

Description

Perform PVB correction by Begg and Greenes' method (as extended by Alonzo & Pepe, 2005).

Usage

acc_ebg(
  data,
  test,
  disease,
  covariate = NULL,
  saturated_model = FALSE,
  show_fit = FALSE,
  show_boot = FALSE,
  description = TRUE,
  ci = FALSE,
  ci_level = 0.95,
  ci_type = "basic",
  R = 999,
  seednum = NULL,
  r_print_freq = 100
)

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.

saturated_model

Set as TRUE to obtain the original Begg and Greenes' (1983) when all possible interactions are included.

show_fit

Set to TRUE to view model fit summary for the logistic regression model.

show_boot

Set to TRUE to show bootstrap iterations.

description

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

ci

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

ci_level

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

ci_type

Set confidence interval (CI) type. Acceptable types are "norm", "basic", "perc", and "bca", for bootstrapped CI. See boot.ci for details.

R

The number of bootstrap samples. Default R = 999.

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.

r_print_freq

Print the current bootstrap sample number at each specified interval. Default r_print_freq = 100.

Value

A list object containing:

boot_data

An object of class "boot" from boot. Contains Sensitivity, Specificity, PPV, and NPV

boot_ci_data

A list of objects of type "bootci" from boot.ci. Contains Sensitivity, Specificity, PPV, NPV.

acc_results

The accuracy results.

References

  1. Alonzo, T. A., & Pepe, M. S. (2005). Assessing accuracy of a continuous screening test in the presence of verification bias. Journal of the Royal Statistical Society: Series C (Applied Statistics), 54(1), 173–190.

  2. Begg, C. B., & Greenes, R. A. (1983). Assessment of diagnostic tests when disease verification is subject to selection bias. Biometrics, 207–215.

  3. He, H., & McDermott, M. P. (2012). A robust method using propensity score stratification for correcting verification bias for binary tests. Biostatistics, 13(1), 32–47.

Examples

# point estimates
acc_ebg(data = cad_pvb, test = "T", disease = "D")
acc_ebg(data = cad_pvb, test = "T", disease = "D", covariate = "X3")
acc_ebg(data = cad_pvb, test = "T", disease = "D", covariate = "X3", saturated_model = TRUE)

# with bootstrapped confidence interval
acc_ebg(data = cad_pvb, test = "T", disease = "D", ci = TRUE, seednum = 12345)
acc_ebg(data = cad_pvb, test = "T", disease = "D", covariate = "X3", ci = TRUE, seednum = 12345)
acc_ebg(data = cad_pvb, test = "T", disease = "D", covariate = "X3", saturated_model = TRUE,
        ci = TRUE, seednum = 12345)

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