Learn R Programming

PVBcorrect (version 0.3.1)

acc_ipw: PVB correction by Inverse Probability Weighting Estimator method

Description

Perform PVB correction by Inverse Probability Weighting Estimator method (Alonzo & Pepe, 2005).

Usage

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

Value

A list object containing:

acc_results

The accuracy results.

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.

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.

show_fit

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

show_boot

Set to TRUE to show bootstrap iterations.

r_print_freq

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

description

Print the name of this analysis. The default is TRUE. This can be turned off for repeated analysis, for example in bootstrapped 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. 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

Run this code
# point estimates
acc_ipw(data = cad_pvb, test = "T", disease = "D")
acc_ipw(data = cad_pvb, test = "T", disease = "D", covariate = "X3")

# with bootstrapped confidence interval
acc_ipw(data = cad_pvb, test = "T", disease = "D", ci = TRUE, R = 99, seednum = 12345)

Run the code above in your browser using DataLab