% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/areg.center.R
\name{areg.center}
\alias{areg.center}
\title{Group-center akin to Stata's \code{areg}}
\usage{
areg.center(mm, grp, wts = NULL, grand_mean_center = FALSE)
}
\arguments{
\item{mm}{Matrix of variables to center}

\item{grp}{Group to center on}

\item{wts}{Optional weights}

\item{grand_mean_center}{Optional center output at \code{mean(var)}}
}
\value{
Vector of group-centered values
}
\description{
From the Stata documentation: \code{areg} begins by recalculating Y and X
and to have mean 0 within the groups specified by \code{absorb()}. The
overall mean of each variable is then added back in.
}
\keyword{internal}
