compute_g_level_summaries: Calculate group level summary statistics

View source: R/compute_efficient_estimator_and_se.R

compute_g_level_summariesR 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 table 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_DT A data table 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.


staggered documentation built on Sept. 24, 2024, 5:07 p.m.