Learn R Programming

episensr (version 2.1.0)

probsens_irr_conf: Probabilistic sensitivity analysis for unmeasured confounding of person-time data and random error.

Description

Probabilistic sensitivity analysis to correct for unmeasured confounding when person-time data has been collected.

Usage

probsens_irr_conf(
  counts,
  pt = NULL,
  reps = 1000,
  prev_exp = list(dist = c("constant", "uniform", "triangular", "trapezoidal", "normal",
    "beta"), parms = NULL),
  prev.exp = deprecated(),
  prev_nexp = list(dist = c("constant", "uniform", "triangular", "trapezoidal", "normal",
    "beta"), parms = NULL),
  prev.nexp = deprecated(),
  risk = list(dist = c("constant", "uniform", "triangular", "trapezoidal",
    "log-logistic", "log-normal"), parms = NULL),
  corr_p = NULL,
  corr.p = deprecated(),
  alpha = 0.05
)

Value

A list with elements:

obs_data

The analyzed 2 x 2 table from the observed data.

obs_measures

A table of observed incidence rate ratio with exact confidence interval.

adj_measures

A table of corrected incidence rate ratios.

sim_df

Data frame of random parameters and computed values.

Arguments

counts

A table or matrix where first row contains disease counts and second row contains person-time at risk, and first and second columns are exposed and unexposed observations, as:

ExposedUnexposed
Casesab
Person-timeN1N0

pt

A numeric vector of person-time at risk. If provided, counts must be a numeric vector of disease counts.

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 and upper bounds for truncated normal distribution cannot be les than zero.

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

Deprecated. Please use prev_exp.

prev_nexp

List defining the prevalence of exposure among the unexposed.

prev.nexp

Deprecated. Please use prev_nexp.

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

corr.p

Deprecated. Please use corr_p.

alpha

Significance level.

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.irr.conf_legacy() as follows:

library(episensr)
probsens_irr_conf <- probsens.irr.conf_legacy

Details

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

References

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.

See Also

Other confounding: confounders(), confounders_array(), confounders_evalue(), confounders_ext(), confounders_limit()

Examples

Run this code
set.seed(123)
# Unmeasured confounding
probsens_irr_conf(matrix(c(77, 10000, 87, 10000),
dimnames = list(c("D+", "Person-time"), c("E+", "E-")), ncol = 2),
reps = 20000,
prev_exp = list("trapezoidal", c(.01, .2, .3, .51)),
prev_nexp = list("trapezoidal", c(.09, .27, .35, .59)),
risk = list("trapezoidal", c(2, 2.5, 3.5, 4.5)),
corr_p = .8)

Run the code above in your browser using DataLab