% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/csa_utils.R
\name{.build_cluster_csa}
\alias{.build_cluster_csa}
\title{Build cluster-level cross-sectional averages}
\usage{
.build_cluster_csa(panel, vars, lags = 0L, by)
}
\arguments{
\item{panel}{A panel data.frame from \code{.make_panel()}.}

\item{vars}{Character vector of variable names.}

\item{lags}{Integer or named integer vector of CSA lags.}

\item{by}{Character: name of the grouping variable in \code{panel}.}
}
\value{
\code{panel} with CSA columns appended (group-specific averages).
}
\description{
Computes cross-sectional means within groups defined by column \code{by}.
Useful for models with group-specific common factors.
}
\keyword{internal}
