iptw_pipeline_long | R Documentation |
Estimate the DID g-formula using inverse-probability-of-treatment-weights with exposure models pooled over time periods.
iptw_pipeline_long( df_obs, df_interv, den_formula, num_formula, family, yvar = "Y", ylagvar = "Y_lag", idvar = "uid", timevar = "t", tibble = TRUE, pt_link_fun = NULL, binomial_n = NULL, models = TRUE )
df_obs |
long format data frame, ordered by person id, then time |
df_interv |
same data set as df_obs with exposure variable set to the intervened status |
den_formula |
chr or formula. |
num_formula |
chr or formula. |
family |
stats::families object for numerator and denominator |
yvar |
chr. Name of column in |
ylagvar |
chr. Name of column in |
idvar |
chr. Name of column in |
timevar |
chr. Name of column in |
tibble |
lgl. Return results as a tibble (TRUE) or vector (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.