Computes cross-sectional means within groups defined by column by.
Useful for models with group-specific common factors.
.build_cluster_csa(panel, vars, lags = 0L, by)panel with CSA columns appended (group-specific averages).
A panel data.frame from .make_panel().
Character vector of variable names.
Integer or named integer vector of CSA lags.
Character: name of the grouping variable in panel.