Skip to contents

confounders() and probsens_conf() allow to provide adjusted measures of association corrected for unknown or unmeasured confounding without effect modification.

Usage

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

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

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

probsens_conf(
  case,
  exposed,
  reps = 1000,
  prev_exp = list(dist = c("constant", "uniform", "triangular", "trapezoidal", "normal",
    "beta"), parms = NULL),
  prev_nexp = list(dist = c("constant", "uniform", "triangular", "trapezoidal", "normal",
    "beta"), parms = NULL),
  risk = list(dist = c("constant", "uniform", "triangular", "trapezoidal",
    "log-logistic", "log-normal"), parms = NULL),
  corr_p = 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, 4, or 6 necessary bias parameters.

  • This vector has 3 elements for the confounders() function, 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).

  • This vector has 4 elements for the confounders.emm() function, in the following order:

    1. the association between the confounder and the outcome among those who were exposed,

    2. the association between the confounder and the outcome among those who were not exposed,

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

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

  • This vector has 6 elements for the confounders.poly() function, in the following order:

    1. the association between the highest level confounder and the outcome,

    2. the association between the mid-level confounder and the outcome,

    3. the prevalence of the highest level confounder among the exposed (between 0 and 1),

    4. the prevalence of the highest level confounder among the unexposed (between 0 and 1),

    5. the prevalence of the mid-level confounder among the exposed (between 0 and 1), and

    6. the prevalence of the mid-level confounder among the unexposed (between 0 and 1).

alpha

Significance level.

reps

Number of replications to run.

prev_exp

List defining the prevalence of exposure among the exposed. The first argument provides the probability distribution function (constant, uniform, triangular, trapezoidal, truncated normal, or beta) and the second its parameters as a vector. Lower bound of the truncated normal cannot be less than zero. Upper bound is Inf by default.

  1. constant: constant value,

  2. uniform: min, max,

  3. triangular: lower limit, upper limit, mode,

  4. trapezoidal: min, lower mode, upper mode, max.

  5. normal: lower bound, upper bound, mean, sd.

  6. beta: alpha, beta.

prev_nexp

List defining the prevalence of exposure among the unexposed.

risk

List defining the confounder-disease relative risk or the confounder-exposure odds ratio. The first argument provides the probability distribution function (constant, uniform, triangular, trapezoidal, log-logistic, or log-normal) and the second its parameters as a vector:

  1. constant: constant value,

  2. uniform: min, max,

  3. triangular: lower limit, upper limit, mode,

  4. trapezoidal: min, lower mode, upper mode, max.

  5. log-logistic: shape, rate. Must be strictly positive,

  6. log-normal: meanlog, sdlog. This is the mean and standard deviation on the log scale.

corr_p

Correlation between the exposure-specific confounder prevalences.

Value

A list with elements:

obs_data

The analyzed 2 x 2 table from the observed data.

cfder_data

The same table for Confounder +.

cfder1.data

The same table for Mid-level Confounder + (for confounders.poly()).

cfder2.data

The same table for Highest-level Confounder + (for confounders.poly()).

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.

A list with elements (for probsens_conf()):

obs_data

The analyzed 2 x 2 table from the observed data.

obs_measures

A table of observed relative risk and odds ratio with confidence intervals.

adj_measures

A table of corrected relative risks and odds ratios.

sim_df

Data frame of random parameters and computed values.

reps

Number of replications.

Details

confounders.emm() allows to provide for adjusted measures of association corrected for unknown or unmeasured confounding in the presence of effect modification.

confounders.poly() allows to provide for adjusted measures of association corrected for unknown or unmeasured polychotomous (3-level) confounding without effect modification.

Simple bias analysis with confounders()

confounders() allows you to run a 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).

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}\) (i.e., RR, OR or RD due to confounding from the unmeasured confounder).

Probabilistic sensitivity analysis with probsens_conf()

probsens_conf() performs a summary-level probabilistic sensitivity analysis to correct for unknown or unmeasured confounding and random error simultaneously. It returns the Mantel-Haenszel risk ratio.

Correlations between prevalences of exposure classification among cases and controls can be specified and use the NORmal To Anything (NORTA) transformation (Li & Hammond, 1975).

Simple bias analysis with confounders.emm()

confounders.emm() allows you to run a simple sensitivity analysis to correct for unknown or unmeasured confounding in the presence of effect modification. Implementation for ratio measures (relative risk – RR, or odds ratio – OR) and difference measures (risk difference – RD).

Simple bias analysis with confounders.poly()

confounders.poly() allows you to run a simple sensitivity analysis to correct for unknown or unmeasured polychotomous (3-level) confounding without effect modification. Implementation for ratio measures (relative risk – RR, or odds ratio – OR) and difference measures (risk difference – RD).

Updated calculations

episensr 2.0.0 introduced updated calculations of probabilistic bias analyses by (1) using the NORTA transformation to define a correlation between distributions, and (2) sampling true prevalences and then sampling the adjusted cell counts rather than just using the expected cell counts from a simple quantitative bias analysis. This updated version should be preferred but if you need to run an old analysis, you can easily revert to the computation using probsens.conf_legacy() as follows:

library(episensr)
probsens.conf <- probsens.conf_legacy

References

Fox, M.P, MacLehose, R.F., Lash, T.L., 2021 Applying Quantitative Bias Analysis to Epidemiologic Data, pp.105–140, 256–262, Springer.

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

Li, S.T., Hammond, J.L., 1975. Generation of Pseudorandom Numbers with Specified Univariate Distributions and Correlation Coefficients. IEEE Trans Syst Man Cybern 5:557-561.

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                    
#> ── Bias-adjusted measures ──
#> 
#>                                         RR due to confounding
#> 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                    
#> ── Bias-adjusted measures ──
#> 
#>                                         OR due to confounding
#> 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                        
#> ── Bias-adjusted measures ──
#> 
#>                              RD due to unmeasured confounder
#> Mantel-Haenszel: -0.03388885                     -0.27750000
#
confounders.emm(matrix(c(105, 85, 527, 93),
dimnames = list(c("HIV+", "HIV-"), c("Circ+", "Circ-")),
nrow = 2, byrow = TRUE),
type = "RR",
bias_parms = c(.4, .7, .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.3765894                    
#> Relative Risk, Confounder -: 0.6590315                    
#> ── Bias-adjusted measures ──
#> 
#>                                         RR due to confounding
#> Standardized Morbidity Ratio: 0.4509163             0.7715736
#>              Mantel-Haenszel: 0.6369911             0.5461852

confounders.emm(matrix(c(105, 85, 527, 93),
dimnames = list(c("HIV+", "HIV-"), c("Circ+", "Circ-")),
nrow = 2, byrow = TRUE),
type = "OR",
bias_parms = c(.4, .7, .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.2359595                    
#> Odds Ratio, Confounder -: 0.4129292                    
#> ── Bias-adjusted measures ──
#> 
#>                                         OR due to confounding
#> Standardized Morbidity Ratio: 0.2825305             0.7715736
#>              Mantel-Haenszel: 0.3969272             0.5492017

confounders.emm(matrix(c(105, 85, 527, 93),
dimnames = list(c("HIV+", "HIV-"), c("Circ+", "Circ-")),
nrow = 2, byrow = TRUE),
type = "RD",
bias_parms = c(-.6, -.3, .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.3113888 -0.3902969 -0.2324808
#> Risk Difference, Confounder +: -0.1463888                      
#> Risk Difference, Confounder -:  0.1536112                      
#> ── Bias-adjusted measures ──
#> 
#>                             RD due to unmeasured confounder
#> Mantel-Haenszel:  0.1212498                      -0.4326386
#
# 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.poly(matrix(c(105, 85, 527, 93),
dimnames = list(c("HIV+", "HIV-"), c("Circ+", "Circ-")),
nrow = 2, byrow = TRUE),
type = "RR",
bias_parms = c(.4, .8, .6, .05, .2, .2))
#> ── 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 +, Highest Level: 0.5392684                    
#>     Relative Risk, Confounder +, Mid-Level: 0.5392684                    
#>                Relative Risk, Confounder -: 0.5392684                    
#> ── Bias-adjusted measures ──
#> 
#>                                         RR due to confounding
#> Standardized Morbidity Ratio: 0.5392684             0.6451613
#>              Mantel-Haenszel: 0.5392684             0.6451613

confounders.poly(matrix(c(105, 85, 527, 93),
dimnames = list(c("HIV+", "HIV-"), c("Circ+", "Circ-")),
nrow = 2, byrow = TRUE),
type = "OR",
bias_parms = c(.4, .8, .6, .05, .2, .2))
#> ── 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 +, Highest Level: 0.3378893                    
#>     Odds Ratio, Confounder +, Mid-Level: 0.3378893                    
#>                Odds Ratio, Confounder -: 0.3378893                    
#> ── Bias-adjusted measures ──
#> 
#>                                         OR due to confounding
#> Standardized Morbidity Ratio: 0.3378893             0.6451613
#>              Mantel-Haenszel: 0.3378893             0.6451613

confounders.poly(matrix(c(105, 85, 527, 93),
dimnames = list(c("HIV+", "HIV-"), c("Circ+", "Circ-")),
nrow = 2, byrow = TRUE),
type = "RD",
bias_parms = c(-.4, -.2, .6, .05, .2, .2))
#> ── Observed data ───────────────────────────────────────────────────────────────
#> • Outcome: HIV+
#> • Comparing: Circ+ vs. Circ-
#> 
#>      Circ+ Circ-
#> HIV+   105    85
#> HIV-   527    93
#>                                                                  2.5%
#>                        Crude Risk Difference: -0.31138885 -0.39029685
#> Risk Difference, Confounder +, Highest Level: -0.09138885            
#>     Risk Difference, Confounder +, Mid-Level: -0.09138885            
#>                Risk Difference, Confounder -: -0.09138885            
#>                                                     97.5%
#>                        Crude Risk Difference: -0.23248085
#> Risk Difference, Confounder +, Highest Level:            
#>     Risk Difference, Confounder +, Mid-Level:            
#>                Risk Difference, Confounder -:            
#> ── Bias-adjusted measures ──
#> 
#>                              RD due to unmeasured confounder
#> Mantel-Haenszel: -0.09138885                     -0.22000000
#
# 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.
tyndall <- matrix(c(105, 85, 527, 93),
dimnames = list(c("HIV+", "HIV-"), c("Circ+", "Circ-")), nrow = 2, byrow = TRUE)
set.seed(1234)
probsens_conf(tyndall, reps = 100000,
prev_exp = list("trapezoidal", c(.7, .75, .85, .9)),
prev_nexp = list("trapezoidal", c(.03, .04, .07, .1)),
risk = list("trapezoidal", c(.5, .6, .7, .8)))
#>  Calculating observed measures
#> ⠙ Simple bias analysis
#> ! Samplings lead to 4955 instances in which
#> sampled cell counts were zero and discarded.
#> ⠙ Simple bias analysis

#>  Simple bias analysis [690ms]
#> 
#> ⠙ Incorporating random error
#>  Incorporating random error [332ms]
#> 
#> 
#> ── Observed data ───────────────────────────────────────────────────────────────
#> • Outcome: HIV+
#> • Comparing: Circ+ vs. Circ-
#> 
#>      Circ+ Circ-
#> HIV+   105    85
#> HIV-   527    93
#>                                        2.5%     97.5%
#> Observed Relative Risk: 0.3479151 0.2757026 0.4390417
#>    Observed Odds Ratio: 0.2179931 0.1519254 0.3127916
#> ── Bias-adjusted measures ──
#> 
#>                                             Median 2.5th percentile
#>            RR (MH) -- systematic error:  0.4718237        0.4193620
#> RR (MH) -- systematic and random error:  0.4737796        0.3278156
#>            OR (SMR) -- systematic error: 0.3784800        0.3093185
#> OR (SMR) -- systematic and random error: 0.3797567        0.2541708
#>                                          97.5th percentile
#>            RR (MH) -- systematic error:          0.5487088
#> RR (MH) -- systematic and random error:          0.6865544
#>            OR (SMR) -- systematic error:         0.4747021
#> OR (SMR) -- systematic and random error:         0.5765223

set.seed(123)
probsens_conf(tyndall, reps = 20000,
prev_exp = list("beta", c(200, 56)),
prev_nexp = list("beta", c(10, 16)),
risk = list("triangular", c(.6, .7, .63)),
corr_p = .8)
#>  Calculating observed measures
#> ⠙ Simple bias analysis
#>  Simple bias analysis [127ms]
#> 
#> ⠙ Incorporating random error
#>  Incorporating random error [214ms]
#> 
#> 
#> ── Observed data ───────────────────────────────────────────────────────────────
#> • Outcome: HIV+
#> • Comparing: Circ+ vs. Circ-
#> 
#>      Circ+ Circ-
#> HIV+   105    85
#> HIV-   527    93
#>                                        2.5%     97.5%
#> Observed Relative Risk: 0.3479151 0.2757026 0.4390417
#>    Observed Odds Ratio: 0.2179931 0.1519254 0.3127916
#> ── Bias-adjusted measures ──
#> 
#>                                             Median 2.5th percentile
#>            RR (MH) -- systematic error:  0.4164506        0.3887593
#> RR (MH) -- systematic and random error:  0.4154461        0.3177594
#>            OR (SMR) -- systematic error: 0.3143084        0.2757823
#> OR (SMR) -- systematic and random error: 0.3125220        0.2366656
#>                                          97.5th percentile
#>            RR (MH) -- systematic error:          0.4416943
#> RR (MH) -- systematic and random error:          0.5434347
#>            OR (SMR) -- systematic error:         0.3540558
#> OR (SMR) -- systematic and random error:         0.4220445

set.seed(123)
probsens_conf(tyndall, reps = 20000,
prev_exp = list("normal", c(.01, .12, 0.03, 0.005)),
prev_nexp = list("normal", c(0, Inf, 0.01, 0.0001)),
risk = list("triangular", c(.6, .7, .63)), corr_p = .8)
#>  Calculating observed measures
#> ⠙ Simple bias analysis
#> ! Samplings lead to 14823 instances in which
#> sampled cell counts were zero and discarded.
#> ⠙ Simple bias analysis

#>  Simple bias analysis [80ms]
#> 
#> ⠙ Incorporating random error
#>  Incorporating random error [33ms]
#> 
#> 
#> ── Observed data ───────────────────────────────────────────────────────────────
#> • Outcome: HIV+
#> • Comparing: Circ+ vs. Circ-
#> 
#>      Circ+ Circ-
#> HIV+   105    85
#> HIV-   527    93
#>                                        2.5%     97.5%
#> Observed Relative Risk: 0.3479151 0.2757026 0.4390417
#>    Observed Odds Ratio: 0.2179931 0.1519254 0.3127916
#> ── Bias-adjusted measures ──
#> 
#>                                             Median 2.5th percentile
#>            RR (MH) -- systematic error:  0.3504271        0.3492607
#> RR (MH) -- systematic and random error:  0.3508567        0.2786680
#>            OR (SMR) -- systematic error: 0.2777951        0.1905188
#> OR (SMR) -- systematic and random error: 0.2770873        0.1714845
#>                                          97.5th percentile
#>            RR (MH) -- systematic error:          0.3516856
#> RR (MH) -- systematic and random error:          0.4396944
#>            OR (SMR) -- systematic error:         0.5052257
#> OR (SMR) -- systematic and random error:         0.5218266

# Fox M.P., MacLehose R.F., Lash T.L.
# SAS and R code for probabilistic quantitative bias analysis for
# misclassified binary variables and binary unmeasured confounders
# Int J Epidemiol 2023:1624-1633.
fox <- matrix(c(40, 20, 60, 80),
dimnames = list(c("Diseased", "Non-diseased"), c("Exposed", "Unexposed")),
nrow = 2, byrow = TRUE)
set.seed(1234)
probsens_conf(fox, reps = 10^5,
prev_exp = list("beta", c(10, 20)),
prev_nexp = list("beta", c(5, 20)),
risk = list("trapezoidal", c(1.5, 1.7, 2.3, 2.5)))
#>  Calculating observed measures
#> ⠙ Simple bias analysis
#> ! Samplings lead to 866 instances in which
#> sampled cell counts were zero and discarded.
#> ⠙ Simple bias analysis

#>  Simple bias analysis [512ms]
#> 
#> ⠙ Incorporating random error
#>  Incorporating random error [133ms]
#> 
#> 
#> ── Observed data ───────────────────────────────────────────────────────────────
#> • Outcome: Diseased
#> • Comparing: Exposed vs. Unexposed
#> 
#>              Exposed Unexposed
#> Diseased          40        20
#> Non-diseased      60        80
#>                                      2.5%    97.5%
#> Observed Relative Risk: 2.000000 1.263006 3.167047
#>    Observed Odds Ratio: 2.666667 1.416591 5.019874
#> ── Bias-adjusted measures ──
#> 
#>                                            Median 2.5th percentile
#>            RR (MH) -- systematic error:  1.807012         1.490737
#> RR (MH) -- systematic and random error:  1.806806         1.090223
#>            OR (SMR) -- systematic error: 2.970871         2.070874
#> OR (SMR) -- systematic and random error: 3.007636         1.633805
#>                                          97.5th percentile
#>            RR (MH) -- systematic error:           2.157624
#> RR (MH) -- systematic and random error:           2.942567
#>            OR (SMR) -- systematic error:          4.840507
#> OR (SMR) -- systematic and random error:          5.756663

set.seed(1234)
probsens_conf(fox, reps = 20000,
prev_exp = list("beta", c(10, 20)),
prev_nexp = list("beta", c(5, 20)),
risk = list("log-normal", c(log(2), .23)))
#>  Calculating observed measures
#> ⠙ Simple bias analysis
#> ! Samplings lead to 227 instances in which
#> sampled cell counts were zero and discarded.
#> ⠙ Simple bias analysis

#>  Simple bias analysis [119ms]
#> 
#> ⠙ Incorporating random error
#>  Incorporating random error [53ms]
#> 
#> 
#> ── Observed data ───────────────────────────────────────────────────────────────
#> • Outcome: Diseased
#> • Comparing: Exposed vs. Unexposed
#> 
#>              Exposed Unexposed
#> Diseased          40        20
#> Non-diseased      60        80
#>                                      2.5%    97.5%
#> Observed Relative Risk: 2.000000 1.263006 3.167047
#>    Observed Odds Ratio: 2.666667 1.416591 5.019874
#> ── Bias-adjusted measures ──
#> 
#>                                            Median 2.5th percentile
#>            RR (MH) -- systematic error:  1.820843         1.424229
#> RR (MH) -- systematic and random error:  1.804394         1.073150
#>            OR (SMR) -- systematic error: 2.953981         2.017705
#> OR (SMR) -- systematic and random error: 3.009254         1.616688
#>                                          97.5th percentile
#>            RR (MH) -- systematic error:           2.157546
#> RR (MH) -- systematic and random error:           2.948684
#>            OR (SMR) -- systematic error:          5.580012
#> OR (SMR) -- systematic and random error:          6.337040