compute_g_level_summaries {staggered} | R Documentation |
Calculate group level summary statistics
Description
This function computes the mean-vector and covariance matrix of the outcomes for each cohort, where a cohort g is a group of units first treated in period g
Usage
compute_g_level_summaries(df, is_balanced = TRUE)
Arguments
df |
A data frame containing panel data with the variables y (an outcome), i (an individual identifier), t (the period in which the outcome is observe), g (the period in which i is first treated, with Inf denoting never treated) |
is_balanced |
If true, the df has previously been balanced so this does not need to be done internally. |
Value
Y_bar_list A list of the means of the outcomes for each cohort g
S_g_list A list of covariance matrices for the outcomes for each cohort g
N_g_list A list of the number of observations for each cohort g
g_list A list of when the cohorts were first treated
t_list A list of the the time periods for the outcome. The vector of outcomes corresponds with this order.