- [[variance estimators]]
# Idea
Equation sandwich for calculating standard errors (or variance) of coefficients:
$
\operatorname{Var}(\hat{\beta})=\left(X^{T} X\right)^{-1} (X^{T} \Omega X)\left(X^{T} X\right)^{-1}
$
- $\left(X^{T} X\right)^{-1}$ on each side (bread)
- $X^{T} \Omega X$ in the middle (beef/patty/meat)
- where $\Omega = \sigma^2I_n$, which is a matrix with nothing but $\sigma^2$ on the diagonal and 0's everywhere else
Note that to calculate [[robust standard errors]], we replace the "meat" in the middle $X^{T} \Omega X$ with another new kind of meat.
# References
- [Understanding Robust Standard Errors | University of Virginia Library Research Data Services + Sciences](https://data.library.virginia.edu/understanding-robust-standard-errors/)
- [On standard-errors • fixest](https://lrberge.github.io/fixest/articles/standard_errors.html)