Computes confidence intervals for cumulative risk estimates using the influence curve or supplied bootstrap replicates to estimate standard errors.

compute_cumrisk_effect_ci(
  obj,
  alpha = 0.05,
  ic = FALSE,
  risk_time = NULL,
  ref = 1,
  effect_measure_type = "RD",
  boot_method = "normal"
)

Arguments

obj

A cumrisk object containing the risk estimates, e.g., as computed by estimate_ipwrisk

alpha

The desired nominal significance level of the confidence intervals.

ic

If the supplied object contains a bootstrap risk estimates, setting ic = TRUE will requests that estimated standard errors be derived from the influence curve.

risk_time

The time at which the cumulative risk estimates should be returned (the default value of NULL returns all times)

ref

The category to use as the reference for effect measure calculations.

effect_measure_type

A string identifying the type of effect measure to be computed from among the following options: "RD" (risk difference), "RR" (risk ratio), "logRR" (logarithm of the risk ratio), or "AR" (attributable risk). Note that when obj was created using bootstrap estimation and boot_method is "log-normal", then only effect measures with support on the positive real line can be used (i.e. "RR"). See the Effect measure types section for the definitions of the various effect measures.

boot_method

The specific bootstrap approach used to compute confidence intervals (default method = "normal" for a normal approximation on the risk scale, other choices include "log-normal" for normal approximation on the log scale). When obj was created without using bootstrap estimation then the value of boot_method is ignored. Note that when obj was created using bootstrap estimation and boot_method is "log-normal", then only effect measures specified via effect_measure_type with support on the positive real line can be used.

Value

A matrix containing the cumulative risk and confidence interval for each time point and treatment group.

Cumulative risk effect measure types

Risk difference

Mean: \(\mathrm{E}[Y^{1}] - \mathrm{E}[Y^{0}]\)

Variance with IPW: \( \mathrm{Var}[Y^{1}] + \mathrm{Var}[Y^{0}] + \frac{2}{n} \mathrm{E}[Y^{1}] \, \mathrm{E}[Y^{0}] \)

Variance otherwise: \(\mathrm{Var}[Y^{1}] + \mathrm{Var}[Y^{0}]\)

Risk ratio

Mean: \(\frac{\mathrm{E}[Y^{1}]}{\mathrm{E}[Y^{0}]}\)

Variance with IPW: \( \frac{\mathrm{Var}[Y^{1}]}{(\mathrm{E}[Y^{0}])^{2}} + \frac{\mathrm{Var}[Y^{0}]\,(\mathrm{E}[Y^{1}])^2} {(\mathrm{E}[Y^{0}])^{4}} + \frac{2\,(\mathrm{E}[Y^{1}])^2}{n\,(\mathrm{E}[Y^{0}])^2} \)

Variance otherwise: \( \frac{\mathrm{Var}[Y^{1}]}{(\mathrm{E}[Y^{0}])^{2}} + \frac{\mathrm{Var}[Y^{0}]\,(\mathrm{E}[Y^{1}])^2} {(\mathrm{E}[Y^{0}])^{4}} \)

Logarithm of the risk ratio

Mean: \(\mathrm{log}\frac{\mathrm{E}[Y^{1}]}{\mathrm{E}[Y^{0}]}\)

Variance with IPW: \( \frac{\mathrm{Var}[Y^{1}]}{(\mathrm{E}[Y^{1}])^{2}} + \frac{\mathrm{Var}[Y^{0}]}{(\mathrm{E}[Y^{0}])^{2}} + \frac{2}{n} \)

Variance otherwise: \( \frac{\mathrm{Var}[Y^{1}]}{(\mathrm{E}[Y^{1}])^{2}} + \frac{\mathrm{Var}[Y^{0}]}{(\mathrm{E}[Y^{0}])^{2}} \)

Attributable risk

Mean: \(\frac{\mathrm{E}[Y^{1}] - \mathrm{E}[Y^{0}]}{\mathrm{E}[Y^{1}]}\)

Variance with IPW: \( \frac{\mathrm{Var}[Y^{0}]}{(\mathrm{E}[Y^{1}])^{2}} + \frac{\mathrm{Var}[Y^{1}]\,(\mathrm{E}[Y^{0}])^{2}} {(\mathrm{E}[Y^{1}])^{4}} + \frac{2\,(\mathrm{E}[Y^{0}])^{2}}{n\,(\mathrm{E}[Y^{1}])^{2}} \)

Variance otherwise: \( \frac{\mathrm{Var}[Y^{0}]}{(\mathrm{E}[Y^{1}])^{2}} + \frac{\mathrm{Var}[Y^{1}]\,(\mathrm{E}[Y^{0}])^{2}} {(\mathrm{E}[Y^{1}])^{4}} \)

Author

M. Alan Brookhart