selection {episensr} | R Documentation |
Selection bias.
Description
selection()
and probsens.sel()
allow to provide adjusted measures of
association corrected for selection bias.
Usage
selection(case, exposed, bias_parms = NULL, alpha = 0.05)
probsens.sel(
case,
exposed,
reps = 1000,
case_exp = list(dist = c("constant", "uniform", "triangular", "trapezoidal", "normal",
"beta"), parms = NULL),
case_nexp = list(dist = c("constant", "uniform", "triangular", "trapezoidal", "normal",
"beta"), parms = NULL),
ncase_exp = list(dist = c("constant", "uniform", "triangular", "trapezoidal", "normal",
"beta"), parms = NULL),
ncase_nexp = list(dist = c("constant", "uniform", "triangular", "trapezoidal",
"normal", "beta"), parms = NULL),
alpha = 0.05
)
Arguments
case |
Outcome variable. If a variable, this variable is tabulated against. |
exposed |
Exposure variable. |
bias_parms |
Selection probabilities. Either a vector of 4 elements between 0 and 1 defining the following probabilities in this order can be provided:
or a single positive selection-bias factor which is the ratio of the exposed versus unexposed selection probabilities comparing cases and noncases ((14)/(23) from above). |
alpha |
Significance level. |
reps |
Number of replications to run. |
case_exp |
If or_parms not provided, defines the selection probability among case exposed. The first argument provides the probability distribution function and the second its parameters as a vector:
|
case_nexp |
Same among cases non-exposed. |
ncase_exp |
Same among non-cases exposed. |
ncase_nexp |
Same among non-cases non-exposed. |
Value
A list with elements:
model |
Bias analysis performed. |
obs_data |
The analyzed 2 x 2 table from the observed data. |
corr_data |
The same table corrected for selection proportions. |
obs_measures |
A table of odds ratios and relative risk with confidence intervals. |
adj_measures |
Selection bias corrected measures of outcome-exposure relationship. |
bias_parms |
Input bias parameters: selection probabilities. |
selbias_or |
Selection bias odds ratio based on the bias parameters chosen. |
A list with elements (for probsens.sel()
):
obs_data |
The analyzed 2 x 2 table from the observed data. |
obs_measures |
A table of observed odds ratio with confidence intervals. |
adj_measures |
A table of corrected odds ratios. |
sim_df |
Data frame of random parameters and computed values. |
reps |
Number of replications. |
Simple bias analysis with selection()
selection()
allows you to run a simple sensitivity analysis to correct for
selection bias using estimates of the selection proportions.
Probabilistic sensitivity analysis with probsens.sel()
probsens.sel()
performs a summary-level probabilistic sensitivity analysis to
correct for selection bias.
References
Fox, M.P, MacLehose, R.F., Lash, T.L., 2021 Applying Quantitative Bias Analysis to Epidemiologic Data, pp.90–91, 274–279, Springer.
See Also
Other selection:
mbias()
Examples
# The data for this example come from:
# Stang A., Schmidt-Pokrzywniak A., Lehnert M., Parkin D.M., Ferlay J., Bornfeld N.
# et al.
# Population-based incidence estimates of uveal melanoma in Germany. Supplementing
# cancer registry data by case-control data.
# Eur J Cancer Prev 2006;15:165-70.
selection(matrix(c(136, 107, 297, 165),
dimnames = list(c("UM+", "UM-"), c("Mobile+", "Mobile-")),
nrow = 2, byrow = TRUE),
bias_parms = c(.94, .85, .64, .25))
selection(matrix(c(136, 107, 297, 165),
dimnames = list(c("UM+", "UM-"), c("Mobile+", "Mobile-")),
nrow = 2, byrow = TRUE),
bias_parms = 0.43)
#
# The data for this example come from:
# Stang A., Schmidt-Pokrzywniak A., Lehnert M., Parkin D.M., Ferlay J., Bornfeld N. et al.
# Population-based incidence estimates of uveal melanoma in Germany.
# Supplementing cancer registry data by case-control data.
# Eur J Cancer Prev 2006;15:165-70.
set.seed(1234)
probsens.sel(matrix(c(139, 114, 369, 377),
dimnames = list(c("Melanoma+", "Melanoma-"), c("Mobile+", "Mobile-")), nrow = 2, byrow = TRUE),
reps = 5000,
case_exp = list("beta", c(139, 5.1)),
case_nexp = list("beta", c(114, 11.9)),
ncase_exp = list("beta", c(369, 96.1)),
ncase_nexp = list("beta", c(377, 282.9)))