- Learn how to deal heteroscedasticity
- Learn how to deal with dependent errors
Last updated in April 2022
mod1 = lm(infantMortality ~ tfr, data = un) plot(mod1, which = 1)
\[ SE_\beta = \frac{\sigma^2 \sum(x_i - \bar{x})^2}{[\sum(x_i - \bar{x})^2]^2} = \frac{\sigma^2}{\sum(x_i - \bar{x})^2} \]
We simply go through the work of estimating residual variance for each level.
From the classic formula:
\[ SE_\beta = \frac{\sigma^2 \sum(x_i - \bar{x})^2}{[\sum(x_i - \bar{x})^2]^2} \]
\[ SE_\beta = \frac{\sum(x_i - \bar{x})^2*\sigma_i^2}{[\sum(x_i - \bar{x})^2]^2} \]
\[ SE_\beta = \frac{\sum(x_i - \bar{x})^2*\sigma_i^2}{[\sum(x_i - \bar{x})^2]^2} \]
The previous formula is the original approach
Works well in big samples, biased in small ones.
Various corrections proposed:
- in R all implemented in the estimatr
package