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:
Selection probability among cases exposed (1),
Selection probability among cases unexposed (2),
Selection probability among noncases exposed (3), and
Selection probability among noncases unexposed (4).
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:
constant: constant value,
uniform: min, max,
triangular: lower limit, upper limit, mode,
trapezoidal: min, lower mode, upper mode, max.
normal: truncated normal with lower bound, upper bound, mean, sd,
beta: alpha, beta.
- 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))
#>
#> ── Observed data ───────────────────────────────────────────────────────────────
#> • Outcome: UM+
#> • Comparing: Mobile+ vs. Mobile-
#>
#> Mobile+ Mobile-
#> UM+ 136 107
#> UM- 297 165
#> 2.5% 97.5%
#> Observed Relative Risk: 0.7984287 0.6518303 0.9779975
#> Observed Odds Ratio: 0.7061267 0.5143958 0.9693215
#> ── Bias-adjusted measures ──
#>
#>
#> Selection Bias Corrected Relative Risk: 1.483780
#> Selection Bias Corrected Odds Ratio: 1.634608
selection(matrix(c(136, 107, 297, 165),
dimnames = list(c("UM+", "UM-"), c("Mobile+", "Mobile-")),
nrow = 2, byrow = TRUE),
bias_parms = 0.43)
#> ── Observed data ───────────────────────────────────────────────────────────────
#> • Outcome: UM+
#> • Comparing: Mobile+ vs. Mobile-
#>
#> Mobile+ Mobile-
#> UM+ 136 107
#> UM- 297 165
#> 2.5% 97.5%
#> Observed Relative Risk: 0.7984287 0.6518303 0.9779975
#> Observed Odds Ratio: 0.7061267 0.5143958 0.9693215
#> ── Bias-adjusted measures ──
#>
#>
#> Selection Bias Corrected Relative Risk: 1.856811
#> Selection Bias Corrected Odds Ratio: 1.642155
#
# 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)))
#> ℹ Calculating observed measures
#> ⠙ Assign probability distributions
#> ✔ Assign probability distributions [9ms]
#>
#> ⠙ Simple bias analysis
#> ✔ Simple bias analysis [19ms]
#>
#> ⠙ Incorporating random error
#> ⠹ Incorporating random error
#> ✔ Incorporating random error [50ms]
#>
#>
#> ── Observed data ───────────────────────────────────────────────────────────────
#> • Outcome: Melanoma+
#> • Comparing: Mobile+ vs. Mobile-
#>
#> Mobile+ Mobile-
#> Melanoma+ 139 114
#> Melanoma- 369 377
#> 2.5% 97.5%
#> Observed Relative Risk: 1.1784950 0.9511190 1.4602277
#> Observed Odds Ratio: 1.2457329 0.9356479 1.6585839
#> ── Bias-adjusted measures ──
#>
#> Median 2.5th percentile 97.5th percentile
#> Relative Risk -- systematic error: 1.476791 1.354749 1.605029
#> total error: 1.398159 1.257867 1.551445
#> Odds Ratio -- systematic error: 1.624847 1.461463 1.799469
#> total error: 1.510434 1.320161 1.722604