Week 12

Heteroskedasticity

Heteroskedasticity

Part of: Intro Econometrics | Key concepts: Heteroskedasticity, Weighted Least Squares, White Correction, Robust Standard Errors, Gauss-Markov Theorem, Classical Assumptions, Generalized Least Squares


Where this lecture sits

The thread from the classical model

The OLS inference machinery — the t-statistics and F-statistics we have leaned on since Lec_08-Goodness of Fit & Multicollinearity — rests on a quiet but crucial assumption: that every observation's error has the same variance. The last lecture (Lec_11-Interaction Terms) already hinted at the cure when it noted that running separate regressions per group lets each group's error variance differ. This lecture confronts that assumption head-on. When heteroskedasticity is present, OLS coefficients are still fine, but the standard errors are wrong, and every hypothesis test built on them is invalid. We need either to (a) transform the model so the errors become well-behaved (WLS), or (b) keep OLS but compute a corrected standard error that is robust to the problem (White correction).

The lecture has three strands:

  1. The diagnosis: what heteroskedasticity is, where it comes from, exactly which results break (and which survive), and an informal "eyeball" test.
  2. Weighted Least Squares (WLS): when we know the functional form of the variance, transform the model to restore the classical assumptions and recover efficiency.
  3. White robust standard errors: when we don't know the form, keep the OLS estimates but fix the standard-error formula.

Part 0 — Recall: the assumption at stake (A4)

The classical assumption of homoskedasticity

In the linear model yi=β0+β1x1i+⋯+βkxki+uiy_i = \beta_0 + \beta_1 x_{1i} + \dots + \beta_k x_{ki} + u_i with E[ui∣xi]=0\mathbb{E}[u_i \mid x_i] = 0, assumption A4 (homoskedasticity) states the conditional variance of the error is constant across all observations: Var⁡(ui∣xi)=σ2for every i.\operatorname{Var}(u_i \mid x_i) = \sigma^2 \quad \text{for every } i.

Heteroskedasticity is precisely the failure of A4: the error variance depends on ii — on the level of an explanatory variable, on group membership, or on time:

Var⁡(ui∣xi)=σi2(varies with i)\boxed{\operatorname{Var}(u_i \mid x_i) = \sigma_i^2 \quad (\text{varies with } i)}
The classic intuition — returns to education

When estimating the returns to education, ability is unobserved and sits inside the error uu. At low education levels there is little spread in ability; among the highly educated, ability varies enormously (some have a PhD by talent, some by persistence). So the spread of uu — its variance — grows with the education level. The variance of the thing we cannot see is itself a function of the thing we can.


Part 1 — Where heteroskedasticity comes from

The error variance can be non-constant for several structurally different reasons. Recognising which one you face dictates the fix.

Pattern Mechanism Canonical example
Varies with a regressor Var⁡(ui)\operatorname{Var}(u_i) rises/falls with an xx Income–consumption: spending is more variable at high income
Differs across groups Each subpopulation has its own variance Wage model: Var⁡(ui)\operatorname{Var}(u_i) differs for men vs women
Changes over time Stable vs turbulent periods Macro models: calm decades vs crisis periods
Heteroskedasticity is not "in the model" — it is in the errors

The variance can depend on a variable exogenously, even one not included as a regressor. The point is about the spread of the unobserved uiu_i, not about which controls you put in the equation. Adding the variable as a control does not automatically cure it.


Part 2 — The problem: what breaks and what survives

This is the single most important slide of the lecture, and the most common exam trap. Be precise about which results die and which live.

Consequences of heteroskedasticity

What SURVIVES (the good news):

  • OLS estimators β^j\hat\beta_j are still unbiased and consistent. Assumptions A1 (linearity) and A2 (mean independence E[u∣x]=0\mathbb{E}[u\mid x]=0) are untouched — and unbiasedness rests only on those. The coefficient point estimates are fine.

What BREAKS (the bad news):

  • The usual formula for Var⁡^(β^j)\widehat{\operatorname{Var}}(\hat\beta_j) assumes constant variance (A4). Under heteroskedasticity it is biased and inconsistent.
  • Therefore the standard errors are wrong, so t-statistics and F-statistics are invalid — you cannot trust any hypothesis test or confidence interval.
  • Gauss–Markov no longer holds, so OLS is no longer efficient (not BLUE) — some other linear unbiased estimator has a smaller variance.
The practical reading of R output

Under heteroskedasticity, in the summary(ols) table only the first column (the coefficient Estimates) is reliable. The Std. Error, t value, and Pr(>|t|) columns are all built on the broken variance formula and must not be trusted until corrected.

Why unbiasedness survives but efficiency dies — the intuition

Unbiasedness is a statement about the average of β^\hat\beta over repeated samples; it only needs the error to be mean-zero and independent of xx (A1–A2). The error variance never enters that argument. Efficiency, by contrast, is about how tightly β^\hat\beta clusters — and that depends entirely on the variance structure. OLS weights every observation equally; when some observations are far noisier than others, equal weighting is wasteful, so a better (smaller-variance) estimator exists.


Part 3 — Detecting it: the "eyeball" test

Since heteroskedasticity lives in the variance of the unobservable uiu_i, we proxy uiu_i with the residual u^i\hat u_i and look at how its squared size moves with a suspect regressor.

The eyeball (graphical) test

For yi=β0+β1xi+uiy_i = \beta_0 + \beta_1 x_i + u_i:

  1. Estimate the model by OLS to get β^0,β^1\hat\beta_0, \hat\beta_1.
  2. Compute the squared residuals {u^12,u^22,…,u^N2}\{\hat u_1^2, \hat u_2^2, \dots, \hat u_N^2\}. (Squaring because variance is about magnitude, not sign — u^i2\hat u_i^2 is the natural sample analogue of Var⁡(ui)\operatorname{Var}(u_i) when the mean is zero.)
  3. Plot u^i2\hat u_i^2 (vertical) against the suspicious exogenous variable xx.
r
ols <- lm(lwage ~ schooling + age + age_sq, mydata)
plot(ols$model[,'schooling'], (ols$residuals)^2)

What the cloud of points tells you:

Shape of u^i2\hat u_i^2 vs xx Diagnosis Implied form
Flat band, no trend Homoskedastic Var⁡(ui)=σu2\operatorname{Var}(u_i) = \sigma_u^2
Fans out as xx rises Increasing variance Var⁡(ui)=σu2 xi\operatorname{Var}(u_i) = \sigma_u^2\, x_i
Fans in as xx rises Decreasing variance Var⁡(ui)=σu2/xi\operatorname{Var}(u_i) = \sigma_u^2 / x_i
Why "eyeball"

This is an informal visual diagnostic, not a formal hypothesis test (formal tests like Breusch–Pagan or White's test exist but are not the focus here). It tells you both whether there is a problem and, crucially, what functional form the variance might take — which is exactly the input WLS needs.


Part 4 — Weighted Least Squares (known variance form)

The strategy

If we know the functional form of the error variance — that it is σ2\sigma^2 times a known function h(xi)≡hih(x_i) \equiv h_i of the regressors — we can transform the model so the transformed errors are homoskedastic, then run OLS on the transformed model. This is Weighted Least Squares (WLS).

The transformation

Suppose

Var⁡(ui∣xi)=σ2h(xi)≡σ2hi,hi>0.\operatorname{Var}(u_i \mid x_i) = \sigma^2 h(x_i) \equiv \sigma^2 h_i, \qquad h_i > 0.

Divide every term of the original equation by hi\sqrt{h_i}:

yihi=β01hi+β1x1ihi+⋯+βkxkihi+uihi.\frac{y_i}{\sqrt{h_i}} = \beta_0 \frac{1}{\sqrt{h_i}} + \beta_1 \frac{x_{1i}}{\sqrt{h_i}} + \dots + \beta_k \frac{x_{ki}}{\sqrt{h_i}} + \frac{u_i}{\sqrt{h_i}}.

Rewrite as a new starred model (∗)(*) with transformed variables yi∗=yi/hiy_i^* = y_i/\sqrt{h_i}, xji∗=xji/hix_{ji}^* = x_{ji}/\sqrt{h_i}, and ui∗=ui/hiu_i^* = u_i/\sqrt{h_i}:

(∗)yi∗=β0x0i∗+β1x1i∗+⋯+βkxki∗+ui∗.(*)\qquad y_i^* = \beta_0 x_{0i}^* + \beta_1 x_{1i}^* + \dots + \beta_k x_{ki}^* + u_i^*.
The coefficients are the same β\beta's

The transformation does not change what we are estimating — the βj\beta_j in model (∗)(*) are the same structural parameters as in the original. We have only re-weighted the observations. (Note the constant becomes a genuine regressor x0i∗=1/hix_{0i}^* = 1/\sqrt{h_i} — the transformed model often has no ordinary intercept.)

Why the transformed error is homoskedastic — the derivation

This is the heart of the lecture; the exam can ask you to reproduce it.

Mean zero is preserved. Since hi\sqrt{h_i} is a function of xix_i alone (treated as fixed given xx):

E[ui∗]=E ⁣[uihi]=1hi E[ui]=0,\mathbb{E}[u_i^*] = \mathbb{E}\!\left[\frac{u_i}{\sqrt{h_i}}\right] = \frac{1}{\sqrt{h_i}}\,\mathbb{E}[u_i] = 0,
E[ui∗∣xi∗]=1hi E[ui∣xi]=0.\mathbb{E}[u_i^* \mid x_i^*] = \frac{1}{\sqrt{h_i}}\,\mathbb{E}[u_i \mid x_i] = 0.

The variance becomes constant. Because the conditional mean is zero, Var⁡(ui∗∣xi∗)=E[ui∗2∣xi∗]\operatorname{Var}(u_i^* \mid x_i^*) = \mathbb{E}[u_i^{*2}\mid x_i^*], and hih_i pulls out of the expectation as a constant:

Var⁡(ui∗∣xi∗)=E ⁣[ui2hi ∣ xi]=1hi E[ui2∣xi]=1hiVar⁡(ui∣xi)=1hi σ2hi=σ2.\operatorname{Var}(u_i^* \mid x_i^*) = \mathbb{E}\!\left[\frac{u_i^2}{h_i} \,\Big|\, x_i\right] = \frac{1}{h_i}\,\mathbb{E}[u_i^2 \mid x_i] = \frac{1}{h_i}\operatorname{Var}(u_i \mid x_i) = \frac{1}{h_i}\,\sigma^2 h_i = \sigma^2.
The payoff

In model (∗)(*) the errors ui∗u_i^* satisfy all the classical assumptions, including A4 (Var⁡(ui∗∣xi∗)=σ2\operatorname{Var}(u_i^*\mid x_i^*)=\sigma^2, constant). Gauss–Markov therefore applies to (∗)(*): the OLS estimates of (∗)(*) are efficient (BLUE) and their standard errors are unbiased. The WLS estimates differ numerically from the original OLS estimates — but both are unbiased; WLS is simply the more efficient of the two.

Worked WLS examples — picking the right divisor

The whole trick is matching the divisor to the assumed variance form so that the leftover variance collapses to a constant σu2\sigma_u^2.

Example 1 — Var⁡(ui∣xi)=σu2 xi\operatorname{Var}(u_i\mid x_i) = \sigma_u^2\, x_i

The variance is proportional to xix_i, so hi=xih_i = x_i and we divide by xi\sqrt{x_i}. Checking the transformed variance: Var⁡ ⁣(uixi)=E ⁣[ui2xi]=1xiVar⁡(ui)=σu2xixi=σu2.✓\operatorname{Var}\!\left(\frac{u_i}{\sqrt{x_i}}\right) = \mathbb{E}\!\left[\frac{u_i^2}{x_i}\right] = \frac{1}{x_i}\operatorname{Var}(u_i) = \frac{\sigma_u^2 x_i}{x_i} = \sigma_u^2. \checkmark (The original slide writes the proportional-to-xi2x_i^2 shorthand kxi2kx_i^2; the operative case here divides by the square root of the variance factor.)

Example 2 — Var⁡(ui∣xi)=σu2 xi2\operatorname{Var}(u_i\mid x_i) = \sigma_u^2\, x_i^2

The variance is proportional to xi2x_i^2, so divide by xix_i (i.e. hi=xi\sqrt{h_i} = x_i). The corrected model is yixi=β0xi+β1+uixi.\frac{y_i}{x_i} = \frac{\beta_0}{x_i} + \beta_1 + \frac{u_i}{x_i}. Notice β1\beta_1 now appears as the intercept of the new model, and 1/xi1/x_i is the single slope variable. Transformed variance: Var⁡ ⁣(uixi)=E ⁣[ui2xi2]=Var⁡(ui)xi2=σu2xi2xi2=σu2.✓\operatorname{Var}\!\left(\frac{u_i}{x_i}\right) = \mathbb{E}\!\left[\frac{u_i^2}{x_i^2}\right] = \frac{\operatorname{Var}(u_i)}{x_i^2} = \frac{\sigma_u^2 x_i^2}{x_i^2} = \sigma_u^2. \checkmark

Example 3 — Var⁡(ui∣xi)=σu2/xi\operatorname{Var}(u_i\mid x_i) = \sigma_u^2 / x_i

Here variance falls with xix_i, so we multiply by xi\sqrt{x_i} (equivalently hi=1/xih_i = 1/x_i). The corrected model: yixi=β0xi+β1xixi+uixi.y_i\sqrt{x_i} = \beta_0\sqrt{x_i} + \beta_1 x_i\sqrt{x_i} + u_i\sqrt{x_i}. Transformed variance: Var⁡ ⁣(uixi)=xi E[ui2]=xiVar⁡(ui)=xi⋅σu2xi=σu2.✓\operatorname{Var}\!\left(u_i\sqrt{x_i}\right) = x_i\,\mathbb{E}[u_i^2] = x_i \operatorname{Var}(u_i) = x_i \cdot \frac{\sigma_u^2}{x_i} = \sigma_u^2. \checkmark

The unifying rule

Divide every term by hi, where Var⁡(ui∣xi)=σ2hi.\boxed{\text{Divide every term by } \sqrt{h_i}, \text{ where } \operatorname{Var}(u_i\mid x_i) = \sigma^2 h_i.} You are scaling each observation by the inverse of its error's standard deviation, so noisy and quiet observations end up equally reliable. After the division, always verify the leftover variance reduces to a constant.

WLS as re-weighting — the deeper view

WLS minimises a weighted sum of squared residuals

Equivalently, WLS solves β^WLS=arg⁡min⁡β^ ∑iu^i2Var⁡(ui).\hat\beta_{WLS} = \arg\min_{\hat\beta}\ \sum_i \frac{\hat u_i^2}{\operatorname{Var}(u_i)}. Each observation is weighted by the inverse of its error variance. OLS weights every observation equally; WLS down-weights observations with high Var⁡(ui)\operatorname{Var}(u_i).

Why inverse-variance weighting is the right thing

An observation with a large error variance is less reliable — its yy carries more noise about the true line. Trusting it as much as a precise observation throws away information. Inverse-variance weighting gives each observation exactly the say it deserves. OLS is the special case of WLS where all variances are equal; and WLS is itself a special case of Generalized Least Squares (GLS) (not covered in this course).


Part 5 — White robust standard errors (unknown variance form)

When you don't know the form

WLS needs you to know h(xi)h(x_i) — and to have hi>0h_i > 0 for all ii. Often you suspect heteroskedasticity but cannot specify its shape (or the implied weights come out negative). The White correction keeps the ordinary OLS estimates and only replaces the standard-error formula with one that remains valid under arbitrary heteroskedasticity. These are also called robust or heteroskedasticity-consistent standard errors.

Where the usual formula fails — the Lecture 4 derivation revisited

Recall for the single-regressor model the slope error decomposes as

β^1=β1+∑i(Xi−Xˉ)ui∑i(Xi−Xˉ)2.\hat\beta_1 = \beta_1 + \frac{\sum_i (X_i - \bar X)u_i}{\sum_i (X_i - \bar X)^2}.

Taking the variance (the constant β1\beta_1 drops; the denominator is a constant so it squares and pulls out; A2 lets the XX's be treated as fixed):

Var⁡(β^1)=Var⁡ ⁣(∑i(Xi−Xˉ)ui)(∑i(Xi−Xˉ)2)2=∑i(Xi−Xˉ)2Var⁡(ui)(∑i(Xi−Xˉ)2)2.\operatorname{Var}(\hat\beta_1) = \frac{\operatorname{Var}\!\big(\sum_i (X_i-\bar X)u_i\big)}{\big(\sum_i (X_i-\bar X)^2\big)^2} = \frac{\sum_i (X_i-\bar X)^2 \operatorname{Var}(u_i)}{\big(\sum_i (X_i-\bar X)^2\big)^2}.
This is exactly as far as you can go without A4

Getting from the sum's variance to the sum of the variances uses A3 (errors uncorrelated across observations). The step that we cannot take without A4 is replacing every Var⁡(ui)\operatorname{Var}(u_i) with a single common σu2\sigma_u^2. Under homoskedasticity that substitution collapses the numerator to σu2∑(Xi−Xˉ)2\sigma_u^2 \sum (X_i-\bar X)^2 and yields the familiar σu2/∑(Xi−Xˉ)2\sigma_u^2 / \sum(X_i-\bar X)^2. Under heteroskedasticity each Var⁡(ui)\operatorname{Var}(u_i) is different, so the clean formula is simply wrong.

White's fix — plug in the squared residuals

White's insight: we cannot know each Var⁡(ui)\operatorname{Var}(u_i), but we can estimate it observation-by-observation with the squared residual u^i2\hat u_i^2. For coefficient jj in the multiple-regression model:

Var⁡^(β^j)=∑i=1nr^ij2 u^i2(∑i=1nr^ij2)2\boxed{\widehat{\operatorname{Var}}(\hat\beta_j) = \frac{\sum_{i=1}^{n} \hat r_{ij}^2\, \hat u_i^2}{\left(\sum_{i=1}^{n} \hat r_{ij}^2\right)^2}}

where r^ij\hat r_{ij} are the residuals from regressing xjx_j on all the other regressors (the part of xjx_j orthogonal to the rest), and u^i\hat u_i are the residuals from the main regression of yy on the xx's.

What White's correction does and does not do
  • It does not change the coefficient estimates — the model still has heteroskedasticity, so OLS is still not efficient.
  • It does produce a standard error that accounts for the heteroskedasticity, hence is unbiased/consistent — so the t- and F-tests become valid again.
  • Trade-off versus WLS: White is robust and assumption-light but leaves you with inefficient estimates; WLS restores efficiency but demands you know (and correctly specify) the variance form.

Doing it in R

The coeftest workflow
r
ols <- lm(lwage ~ schooling + age + age_sq, mydata)
coeftest(ols, vcov = hccm, type = "hc0")   # libraries: car, zoo, lmtest

The output looks like summary(ols), but:

  • The Estimate column is identical to plain OLS (coefficients unchanged).
  • The Std. Error column is recomputed robustly, so the t-statistic and p-value columns differ.
  • type = "hc0" selects one of several flavours of the correction (hc0, hc1, hc3, …) that differ in small-sample degrees-of-freedom adjustments.

Part 6 — Heteroskedasticity across groups

When the groups themselves have different variances

If the heteroskedasticity is between groups (men vs women) or time periods (calm vs crisis), the cleanest fix is to estimate a separate regression for each group. This directly allows each group its own error variance.

This ties back to the two versions of the Chow test:

Pooled with dummies/interactions Separate regressions per group
Error variance assumption Common across groups Group-specific (each estimated separately)
Under homoskedasticity Identical results Identical results
Under group heteroskedasticity Inefficient Preferred — yields efficient coefficient estimates
The Chow connection, sharpened

Under homoskedasticity the dummy-version and separate-regression versions of the Chow test are identical. The moment the groups differ in error variance, the separate-regression version is preferred because each regression uses its own variance and so produces efficient estimates — the pooled-dummy version is stuck with one common variance.


Part 7 — WLS vs White: the decision

WLS summary
  • Requires knowing the functional form of Var⁡(ui)\operatorname{Var}(u_i), with positive weights hi>0h_i > 0.
  • The coefficient estimates change (different from OLS), and so does R2R^2.
  • The standard errors and hypothesis tests change.
  • The estimates are efficient (BLUE).
White correction summary
  • No need to know the functional form of Var⁡(ui)\operatorname{Var}(u_i).
  • The coefficient estimates do not change, so neither does R2R^2.
  • The standard errors and hypothesis tests change.
  • The estimates are not efficient.
Which to use — the practical rule
Use WLS when… Use White when…
You "know" the variance is proportional to a known individual-level variable hih_i You don't know the functional form of the variance
hi>0h_i > 0 for all ii Weights would be negative / form unknown
You want efficient (BLUE) estimates You don't mind inefficient estimates, just want valid tests

In modern applied practice White/robust standard errors are the default workhorse precisely because they ask so little: you rarely know the true variance form, and getting valid inference usually matters more than squeezing out the last drop of efficiency.


Practice exam — model choice, OVB and assumptions

This question appeared on the slides as a worked exam item (medium/high difficulty). It revisits A2/A4 and omitted-variable reasoning — good integrative revision.

Setup

Researchers believed XX and ZZ alone explain YY (all of X,Y,ZX,Y,Z strictly positive): (1)ln⁡Y=γ0+γ1X+γ2Z+u\text{(1)}\quad \ln Y = \gamma_0 + \gamma_1 X + \gamma_2 Z + u A researcher suspects X2X^2 also matters and estimates by OLS: (2)ln⁡Y=β0+β1X+β2Z+β3X2+u\text{(2)}\quad \ln Y = \beta_0 + \beta_1 X + \beta_2 Z + \beta_3 X^2 + u (3)ln⁡Y=β0+β1X+β2Z+β3ln⁡X2+u\text{(3)}\quad \ln Y = \beta_0 + \beta_1 X + \beta_2 Z + \beta_3 \ln X^2 + u

1(a) — On which number did the researcher conclude X2X^2 affects the outcome? The p-value of β^3\hat\beta_3, here 5.18×10−75.18\times10^{-7}. It is far below 5%, so the coefficient is significant and the variable is relevant.

1(b) — On which numbers did the researcher conclude model (3) beats model (2)? The R2R^2 values: R(3)2=0.7778>R(2)2=0.7713R^2_{(3)} = 0.7778 > R^2_{(2)} = 0.7713 (the RSSs are equally acceptable). Model (3) explains more variation, so the ln⁡X2\ln X^2 specification fits better.

2 — If ZZ and ln⁡X2\ln X^2 are correlated, which assumption does model (1) violate? (assume model 3 is the true DGF)

If model (3) is true, model (1) omits the relevant regressor ln⁡X2\ln X^2, which is absorbed into the error uu. Since ZZ and ln⁡X2\ln X^2 are correlated, the error in model (1) is now correlated with the included regressor ZZ: cov⁡(u,Z)≠0\operatorname{cov}(u, Z) \neq 0. This violates A2 — answer (ii), E[ui∣x1i,…,xKi]=0\mathbb{E}[u_i \mid x_{1i},\dots,x_{Ki}] = 0. Note it is A2 that fails, not A4 (this is an omitted-variable/endogeneity problem, not a variance problem) — a deliberate trap in a heteroskedasticity lecture.

3 — If ZZ and ln⁡X2\ln X^2 are uncorrelated, how do γ^2\hat\gamma_2 and β2\beta_2 compare?

Omitting ln⁡X2\ln X^2 normally biases the other coefficients (OVB), so we'd expect E[γ^2]≠β2\mathbb{E}[\hat\gamma_2]\neq\beta_2. But OVB only transmits through correlation between the omitted and included regressors. If Z⊥ln⁡X2Z \perp \ln X^2, dropping ln⁡X2\ln X^2 does not bias the coefficient on ZZ: E[γ^2]=β2\mathbb{E}[\hat\gamma_2] = \beta_2 — answer (iii).


Summary

  1. Heteroskedasticity is the failure of assumption A4: the conditional error variance Var⁡(ui∣xi)=σi2\operatorname{Var}(u_i\mid x_i)=\sigma_i^2 varies across observations instead of being a constant σ2\sigma^2. It arises when the variance moves with a regressor, differs across groups, or changes over time.
  2. Consequences: OLS coefficients stay unbiased and consistent (A1, A2 untouched), but the usual variance estimate is biased, so t- and F-tests are invalid and OLS is no longer efficient (Gauss–Markov fails). In R output, only the Estimate column is trustworthy.
  3. Detection: the informal eyeball test — plot squared residuals u^i2\hat u_i^2 against a suspect regressor. A fanning pattern signals heteroskedasticity and even suggests the functional form.
  4. Weighted Least Squares (WLS) — when the variance form Var⁡(ui)=σ2hi\operatorname{Var}(u_i)=\sigma^2 h_i is known: divide every term by hi\sqrt{h_i}. The transformed errors satisfy A4 (Var⁡(ui∗)=σ2\operatorname{Var}(u_i^*)=\sigma^2), so the estimates become efficient (BLUE) with valid standard errors. The boxed rule: divide by hi\text{divide by }\sqrt{h_i}; always verify the leftover variance collapses to a constant.
  5. WLS is inverse-variance weighting: β^WLS=arg⁡min⁡∑u^i2/Var⁡(ui)\hat\beta_{WLS}=\arg\min\sum \hat u_i^2/\operatorname{Var}(u_i). Noisy (high-variance) observations get less weight because they are less reliable. OLS is the equal-weight special case; WLS is a special case of GLS.
  6. White / robust standard errors — when the form is unknown (or weights would be negative): keep OLS estimates, replace the standard error with Var⁡^(β^j)=∑r^ij2u^i2/(∑r^ij2)2\widehat{\operatorname{Var}}(\hat\beta_j)=\sum \hat r_{ij}^2 \hat u_i^2 / (\sum \hat r_{ij}^2)^2, plugging u^i2\hat u_i^2 in for each unknown Var⁡(ui)\operatorname{Var}(u_i). Coefficients and R2R^2 unchanged (still inefficient), but tests become valid. In R: coeftest(ols, vcov = hccm, type = "hc0").
  7. Across groups/time, estimate separate regressions per group — this lets each group keep its own variance and is the preferred Chow-test version under heteroskedasticity.
  8. Choosing: WLS for efficiency when you trust the variance form; White when you don't — robust SEs are the modern default because valid inference usually beats squeezing out efficiency.