iptw_pipeline | R Documentation |
Estimate the DID g-formula using inverse-probability-of-treatment-weights.
iptw_pipeline( data, Tt, den_formula, num_formula = NULL, tibble = TRUE, pt_link_fun = NULL, binomial_n = 1, models = TRUE )
data |
Wide format data frame with one row per individual, and columns Lt, At, Yt for t = 0,1,...,Tt. |
Tt |
int. Final period in dataset (t=0,1,...,Tt) |
den_formula |
chr. Right-hand-side glue-style formula to use in fitting treatment models for denominator. Format: '~L{t}+L{t-1}' etc. |
num_formula |
chr. Right-hand-side glue-style formula to use in fitting treatment models for numerator Format: '~L{t}+L{t-1}' etc. |
tibble |
logical. Should the results be returned as a tibble with columns (t, estimates) (TRUE) or a vector of just the estimates (FALSE)? |
pt_link_fun |
function. The scale on which parallel trends is assumed (e.g., |
binomial_n |
int length nrow(data). Group sizes for aggregate binomial data. |
models |
logical. Return all models as an attribute? |
Estimates of E(Yt(a) - Yt-1(a)), in the form of a tibble or vector (dependening on argument tibble), for times t=1,2,...,Tt (in that order).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.