Skip to contents

Probabilistic sensitivity analysis to correct for unknown or unmeasured confounding and random error simultaneously.

Usage

probsens.conf(
  case,
  exposed,
  reps = 1000,
  prev.exp = list(dist = c("constant", "uniform", "triangular", "trapezoidal",
    "logit-logistic", "logit-normal", "beta"), parms = NULL),
  prev.nexp = list(dist = c("constant", "uniform", "triangular", "trapezoidal",
    "logit-logistic", "logit-normal", "beta"), parms = NULL),
  risk = list(dist = c("constant", "uniform", "triangular", "trapezoidal",
    "log-logistic", "log-normal"), parms = NULL),
  corr.p = NULL,
  discard = TRUE,
  alpha = 0.05
)

Arguments

case

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

exposed

Exposure variable.

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, logit-logistic, logit-normal, or beta) and the second its parameters as a vector. Logit-logistic and logit-normal distributions can be shifted by providing lower and upper bounds. Avoid providing these values if a non-shifted distribution is desired.

  1. constant: constant value,

  2. uniform: min, max,

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

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

  5. logit-logistic: location, scale, lower bound shift, upper bound shift,

  6. logit-normal: location, scale, lower bound shift, upper bound shift.

  7. 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.

discard

A logical scalar. In case of negative adjusted count, should the draws be discarded? If set to FALSE, negative counts are set to zero.

alpha

Significance level.

Value

A list with elements:

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.

References

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

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.
set.seed(123)
probsens.conf(matrix(c(105, 85, 527, 93),
dimnames = list(c("HIV+", "HIV-"), c("Circ+", "Circ-")), nrow = 2, byrow = TRUE),
reps = 20000,
prev.exp = list("triangular", c(.7, .9, .8)),
prev.nexp = list("trapezoidal", c(.03, .04, .05, .06)),
risk = list("triangular", c(.6, .7, .63)),
corr.p = .8)
#> --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
#> ---
#>                                             Median 2.5th percentile
#>            RR (SMR) -- systematic error: 0.4788554        0.4530199
#> RR (SMR) -- systematic and random error: 0.4782128        0.3768346
#>            OR (SMR) -- systematic error: 0.3658305        0.3361242
#> OR (SMR) -- systematic and random error: 0.3652279        0.2524362
#>                                          97.5th percentile
#>            RR (SMR) -- systematic error:         0.5080583
#> RR (SMR) -- systematic and random error:         0.6074774
#>            OR (SMR) -- systematic error:         0.4020439
#> OR (SMR) -- systematic and random error:         0.5292252

set.seed(123)
probsens.conf(matrix(c(105, 85, 527, 93),
dimnames = list(c("HIV+", "HIV-"), c("Circ+", "Circ-")), nrow = 2, byrow = TRUE),
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)
#> --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
#> ---
#>                                             Median 2.5th percentile
#>            RR (SMR) -- systematic error: 0.4224373        0.4080628
#> RR (SMR) -- systematic and random error: 0.4224873        0.3338074
#>            OR (SMR) -- systematic error: 0.2951712        0.2812857
#> OR (SMR) -- systematic and random error: 0.2957358        0.2051573
#>                                          97.5th percentile
#>            RR (SMR) -- systematic error:         0.4414193
#> RR (SMR) -- systematic and random error:         0.5329528
#>            OR (SMR) -- systematic error:         0.3174300
#> OR (SMR) -- systematic and random error:         0.4239638