Inverse probability of treatment weighting for marginal structural models

Share:

Description

iptw uses gbm to estimate propensity scores for sequential treatments.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
 
iptw(formula,
   data,
   timeInvariant = NULL,
   n.trees = 10000,
   stop.method = "es.max",
   cumulative = TRUE,
   timeIndicators = NULL,
   ID = NULL,
   priorTreatment = TRUE, ...)

Arguments

formula

Either a single formula (long format) or a list with formulas

data

The dataset, includes treatment assignment as well as covariates

timeInvariant

An optional formula (with no left-hand variable) specifying time-invariant chararacteristics.

n.trees

number of gbm iterations passed on to gbm

stop.method

A method or methods of measuring and summarizing balance across pretreatment variables. Current options are ks.mean, ks.max, es.mean, and es.max. ks refers to the Kolmogorov-Smirnov statistic and es refers to standardized effect size. These are summarized across the pretreatment variables by either the maximum (.max) or the mean (.mean).

cumulative

If TRUE, the time t model includes time-varying characteristics from times 1 through t-1.

timeIndicators

For long format fits, a vector of times for each observation.

ID

For long format fits, a vector of numeric identifiers for unique analytic units.

priorTreatment

For long format fits, includes treatment levels from previous times if TRUE. This argument is ignored for wide format fits.

...

Additional arguments that are passed to ps function.

Details

This function uses generalized boosted models to estimate inverse probability of treatment weights for sequential treatments.

Value

Returns an object of class iptw, a list containing

psList

A list of ps objects with length equal to the number of time periods.

estimand

The specified estimand.

stop.methods

The stopping rules used to optimize iptw balance.

nFits

The number of ps objects (i.e., the number of distinct time points.)

uniqueTimes

The unique times in the specified model.

See Also

ps

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.