% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/est_mg.R
\name{.unit_ols}
\alias{.unit_ols}
\title{Unit-level OLS}
\usage{
.unit_ols(y, X)
}
\arguments{
\item{y}{Numeric vector: dependent variable.}

\item{X}{Numeric matrix: regressors (including intercept if desired).}
}
\value{
A list with elements:
\describe{
\item{b}{Coefficient vector.}
\item{V}{Variance-covariance matrix of coefficients.}
\item{e}{Residual vector.}
\item{r2}{R-squared.}
\item{df_resid}{Residual degrees of freedom.}
\item{sigma2}{Residual variance (s^2).}
}
}
\description{
Fast OLS for a single cross-sectional unit. Uses normal equations
rather than \code{lm()} for speed when called in a loop.
}
\keyword{internal}
