Skip to contents

Simple sensitivity analysis to correct for unknown or unmeasured confounding without effect modification. Implementation for ratio measures (relative risk -- RR, or odds ratio -- OR) and difference measures (risk difference -- RD).

Usage

confounders(
  case,
  exposed,
  type = c("RR", "OR", "RD"),
  bias_parms = NULL,
  alpha = 0.05
)

Arguments

case

Outcome variable. If a variable, this variable is tabulated against.

exposed

Exposure variable.

type

Choice of implementation, with no effect measure modification for ratio measures (relative risk -- RR; odds ratio -- OR) or difference measures (risk difference -- RD).

bias_parms

Numeric vector defining the 3 necessary bias parameters. This vector has 3 elements, in the following order:

  1. the association between the confounder and the outcome among those who were not exposed (RR, OR, or RD according to choice of implementation),

  2. the prevalence of the confounder among the exposed (between 0 and 1), and

  3. the prevalence of the confounder among the unexposed (between 0 and 1).

alpha

Significance level.

Value

A list with elements:

obs.data

The analyzed 2 x 2 table from the observed data.

cfder.data

The same table for Confounder +.

nocfder.data

The same table for Confounder -.

obs.measures

A table of relative risk with confidence intervals; for Total, Confounder +, and Confounder -.

adj.measures

A table of Standardized Morbidity Ratio and Mantel-Haenszel estimates.

bias.parms

Input bias parameters.

Details

The analytic approach uses the "relative risk due to confounding" as defined by Miettinen (1972), i.e. \(RR_{adj} = \frac{RR_{crude}}{RR_{conf}}\) where RR_adj is the standardized (adjusted) risk ratio, RR_crude is the crude risk ratio, and RR_conf is the relative risk component attributable to confounding by the stratification factors. The output provides both RR_adj (SMR or Mantel-Haenszel) and the RR_conf.

References

Lash, T.L., Fox, M.P, Fink, A.K., 2009 Applying Quantitative Bias Analysis to Epidemiologic Data, pp.59--78, Springer.

Miettinen, 1971. Components of the Crude Risk Ratio. Am J Epidemiol 96(2):168-172.

Examples

# The data for this example come from:
# Tyndall M.W., Ronald A.R., Agoki E., Malisa W., Bwayo J.J., Ndinya-Achola J.O.
# et al.
# Increased risk of infection with human immunodeficiency virus type 1 among
# uncircumcised men presenting with genital ulcer disease in Kenya.
# Clin Infect Dis 1996;23:449-53.
confounders(matrix(c(105, 85, 527, 93),
dimnames = list(c("HIV+", "HIV-"), c("Circ+", "Circ-")),
nrow = 2, byrow = TRUE),
type = "RR",
bias_parms = c(.63, .8, .05))
#> --Observed data-- 
#>          Outcome: HIV+ 
#>        Comparing: Circ+ vs. Circ- 
#> 
#>      Circ+ Circ-
#> HIV+   105    85
#> HIV-   527    93
#> 
#>                                             2.5%     97.5%
#>         Crude Relative Risk: 0.3479151 0.2757026 0.4390417
#> Relative Risk, Confounder +: 0.4850550                    
#> Relative Risk, Confounder -: 0.4850550                    
#> ---
#>                                           RR_conf
#> Standardized Morbidity Ratio: 0.4850550 0.7172695
#>              Mantel-Haenszel: 0.4850550 0.7172695

confounders(matrix(c(105, 85, 527, 93),
dimnames = list(c("HIV+", "HIV-"), c("Circ+", "Circ-")),
nrow = 2, byrow = TRUE),
type = "OR",
bias_parms = c(.63, .8, .05))
#> --Observed data-- 
#>          Outcome: HIV+ 
#>        Comparing: Circ+ vs. Circ- 
#> 
#>      Circ+ Circ-
#> HIV+   105    85
#> HIV-   527    93
#> 
#>                                          2.5%     97.5%
#>         Crude Odds Ratio: 0.2179931 0.1519254 0.3127916
#> Odds Ratio, Confounder +: 0.3039207                    
#> Odds Ratio, Confounder -: 0.3039207                    
#> ---
#>                                           OR_conf
#> Standardized Morbidity Ratio: 0.3039207 0.7172695
#>              Mantel-Haenszel: 0.3039207 0.7172695

confounders(matrix(c(105, 85, 527, 93),
dimnames = list(c("HIV+", "HIV-"), c("Circ+", "Circ-")),
nrow = 2, byrow = TRUE),
type = "RD",
bias_parms = c(-.37, .8, .05))
#> --Observed data-- 
#>          Outcome: HIV+ 
#>        Comparing: Circ+ vs. Circ- 
#> 
#>      Circ+ Circ-
#> HIV+   105    85
#> HIV-   527    93
#> 
#>                                                   2.5%       97.5%
#>         Crude Risk Difference: -0.31138885 -0.39029685 -0.23248085
#> Risk Difference, Confounder +: -0.03388885                        
#> Risk Difference, Confounder -: -0.03388885                        
#> ---
#>                                  RD_conf
#> Mantel-Haenszel: -0.03388885 -0.27750000