Bootstrap resampling for selection and misclassification bias models.
Source:R/boot.bias.R
boot.bias.Rd
Generate R
bootstrap replicates of either selection or misclassification bias functions.
It then generates a confidence interval of the parameter, by first order normal approximation or the bootstrap percentile interval.
Replicates giving negative cell(s) in the adjusted 2-by-2 table are silently ignored.
Usage
boot.bias(bias_model, R = 1000, conf = 0.95, ci_type = c("norm", "perc"))
Arguments
- bias_model
An object of class "episensr.boot", i.e. either selection bias function or misclassification bias function.
- R
The number of bootstrap replicates.
- conf
Confidence level.
- ci_type
A character string giving the type of interval required. Values can be either "norm" or "perc", default to "norm".
Value
A list with elements:
- model
Model ran.
- boot_mod
Bootstrap resampled object, of class
boot
.- nrep
Number of replicates used.
- bias_ciRR
Bootstrap confidence interval object for relative risk.
- bias_ciOR
Bootstrap confidence interval object for odds ratio.
- ci
Confidence intervals for the bias adjusted association measures.
- conf
Confidence interval.
See also
boot, selection, misclassification
Examples
misclass_eval <- misclassification(matrix(c(215, 1449, 668, 4296),
dimnames = list(c("Breast cancer+", "Breast cancer-"),
c("Smoker+", "Smoker-")),
nrow = 2, byrow = TRUE),
type = "exposure",
bias_parms = c(.78, .78, .99, .99))
set.seed(123)
boot.bias(misclass_eval)
#> 95 % confidence interval of the bias adjusted measures:
#> RR: 0.8376288 1.102813
#> OR: 0.7903447 1.137001
#> ---
#> Based on 1000 bootstrap replicates