Computes cross-sectional means of vars at each time period and appends
contemporaneous plus lagged CSAs as new columns. For unbalanced panels,
means are computed using only observed units at each period.
.build_csa(panel, vars, lags = 0L)The input panel with additional CSA columns appended.
A panel data.frame from .make_panel().
Character vector of variable names to average.
Integer: number of lags of CSAs to include (0 = contemporaneous only). Can also be a named integer vector for per-variable lags.