calc_iptw: Calculate total effect, natural direct and indirect effect.

Description Usage Arguments

View source: R/iptw.R

Description

Calculate total effect, natural direct and indirect effect.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
calc_iptw(
  data,
  id.vars,
  time.var,
  baseline.vars,
  exposure.model,
  exposure.vars,
  mediator.model,
  mediator.family,
  outcome,
  is.expL = TRUE,
  censor.model = NULL,
  bound.value = 0
)

Arguments

data

Data to be used to ceate matrix.

id.vars

ID variable name.

time.var

Time indexing varaible name.

baseline.vars

A vector of baseline variables and time-fixed variable names.

exposure.model

Exposure model, only binomial outcome supported.

exposure.vars

A vector of exposure variables, including lagged exposure variables.

mediator.model

Mediator model.

mediator.family

Model link function, gussian,binomial and multinomial. For multinomial model, multinom will be sued for model fitting. And glm for gussian and binomial link funciton model.

outcome

Outcome variable name.

is.expL

Is time-time varying exposure, defualt is TRUE.

censor.model

Censor model. Censoring indicator should be coded as remaing uncensored (as 1).

bound.value

Bound weights, between 0 and 0.5.


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