Skip to contents

Simple sensitivity analysis to correct for selection bias using estimates of the selection proportions.

Usage

selection(case, exposed, bias_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:

  1. Selection probability among cases exposed (1),

  2. Selection probability among cases unexposed (2),

  3. Selection probability among noncases exposed (3), and

  4. 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 [(1*4)/(2*3) from above].

alpha

Significance level.

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.

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
#> ---
#>                                                 
#> 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
#> ---
#>                                                 
#> Selection Bias Corrected Relative Risk: 1.856811
#>    Selection Bias Corrected Odds Ratio: 1.642155