iorw: Inverse odds ratio weighting.

Description Usage Arguments References Examples

View source: R/iorw.R

Description

Mediation analysis for time fixed mediator using inverse odds ratio. Output contains total effect, natrual direct effect and natural indirect effect. The confidence interval will be calculated using 1000 bootstrap with normal approximation.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
iorw(
  fitY,
  data = NULL,
  exposure,
  mediator,
  family,
  ref = NULL,
  stabilized = TRUE,
  R = 1000
)

Arguments

fitY

model object of the final outcome, all variables of interest should be included except mediators.

data

Data set to be sued, if NULL, the data from outcome model will be used.

exposure

Intervention/Exposure variable, control or unexposure must be set to 0.

mediator

Name of the mediator(s).

family

a description of the error distribution and link function to be used in the exposure model. Only binomial, multinomial and gaussian supported now.

ref

Only for one categorical mediator, set to NULL for numerical mediator or multiple mediator. Reference value of the mediator, where the mediator is evaluated at its refrence value.

stabilized

Stabilized weights, TRUE(default) or FALSE.

R

The number of bootstrap replicates. Default is 1000.

References

Tchetgen Tchetgen, E. J. (2013). Inverse odds ratio‐weighted estimation for causal mediation analysis. Statistics in medicine, 32(26), 4567-4580. DOI:10.1002/sim.5864

Examples

1
2
3
4
5
6
7
8
data(lipdat)
dtbase <- lipdat[lipdat$time == 0, ]
out <- iorw(coxph(Surv(os, cvd) ~ bmi + age0 + smoke, data = dtbase),
exposure   = "smoke",
mediator   = "hdl",
family     = "binomial")

summary(out)

adayim/causalMed documentation built on June 2, 2020, 4:11 p.m.