% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/aggregate.R
\name{acs_aggregate}
\alias{acs_aggregate}
\title{Aggregate paired ACS estimate and MOE columns by group.}
\usage{
acs_aggregate(
  data,
  group_var,
  value_cols,
  moe_cols,
  cov_strategy = c("zero", "supplied", "constant"),
  cov_value = 0,
  conf = 0.9
)
}
\arguments{
\item{data}{A data frame containing ACS estimate and MOE columns.}

\item{group_var}{Name of the grouping column, supplied as a single string.}

\item{value_cols}{Character vector of estimate column names to aggregate.}

\item{moe_cols}{Character vector of MOE column names paired with
\code{value_cols}.}

\item{cov_strategy}{Covariance strategy: \code{"zero"}, \code{"supplied"}, or
\code{"constant"}.}

\item{cov_value}{For \code{"constant"}, a scalar correlation. For \code{"supplied"},
a named list of full covariance matrices keyed by estimate column.}

\item{conf}{Confidence level associated with input and output MOEs.}
}
\value{
A data frame with one row per group and aggregated estimate/MOE
columns.
}
\description{
Aggregate paired ACS estimate and MOE columns by group.
}
\details{
\code{cov_strategy = "constant"} interprets \code{cov_value} as a correlation,
not a covariance. This differs from scalar \code{cov} arguments in core
propagation functions, where a scalar means an off-diagonal covariance on
the standard-error scale.

Output rows are ordered by first appearance of each group level in \code{data},
not alphabetically.
}
\examples{
tracts <- data.frame(
  region = c("north", "north", "south", "south"),
  pop = c(1000, 1200, 900, 1100),
  pop_moe = c(120, 140, 100, 130)
)
acs_aggregate(tracts, "region", "pop", "pop_moe")
acs_aggregate(tracts, "region", "pop", "pop_moe",
              cov_strategy = "constant", cov_value = 0.25)
}
