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

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

\item{lags}{Integer: number of lags of CSAs to include (0 = contemporaneous
only). Can also be a named integer vector for per-variable lags.}
}
\value{
The input \code{panel} with additional CSA columns appended.
}
\description{
Computes cross-sectional means of \code{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.
}
\keyword{internal}
