Lesson 1
OLS Assumptions, R² and t-Tests
Ordinary Least Squares (OLS) estimates regression coefficients by minimising the sum of squared residuals. Under the classical (Gauss–Markov) assumptions, OLS is the Best Linear Unbiased Estimator (BLUE). R² measures goodness of fit, and t-tests assess whether individual coefficients are statistically significant.
OLS and Its Assumptions
- Model: y = b0 + b1x1 + ... + bkxk + u; OLS chooses the b's to minimise the sum of (y - y_hat)².
- A1 Linearity in parameters.
- A2 Random sampling (or zero conditional mean): E(u|X) = 0, so there is no omitted-variable correlation.
- A3 No perfect multicollinearity among the regressors.
- A4 Homoscedasticity: Var(u|X) = sigma², a constant.
- A5 No autocorrelation: Cov(ui, uj) = 0 for i ≠ j.
- A6 (for exact inference) Normality: u ~ N(0, sigma²).
- Gauss–Markov theorem: under A1–A5, OLS is BLUE.
R² and Adjusted R²
- R² = ESS/TSS = 1 - RSS/TSS, where TSS = ESS + RSS.
- R² is the share of the variation in y explained by the model and lies between 0 and 1.
- R² never falls when a regressor is added, so it can reward overfitting.
- Adjusted R² = 1 - (1 - R²)(n - 1)/(n - k - 1) penalises extra regressors.
- A high R² does not imply causality or a correctly specified model.
t-Tests
- H0: bj = 0 vs H1: bj ≠ 0.
- t = (bj_hat - 0)/se(bj_hat), with n - k - 1 degrees of freedom.
- Reject H0 if |t| > the critical value (about 1.96 at 5% in large samples) or if the p-value < alpha.
- A 95% CI is bj_hat ± t_crit × se.
Key terms
- OLS
- An estimator that minimises the sum of squared residuals.
- BLUE
- Best Linear Unbiased Estimator: the linear unbiased estimator with the smallest variance.
- R²
- The proportion of the total variation in y explained by the regressors.
- Adjusted R²
- R² corrected for the number of regressors.
- t-statistic
- An estimated coefficient divided by its standard error.
- p-value
- The probability of a result at least as extreme as the one observed, assuming H0 is true.
Lesson 2
Multicollinearity and VIF
Multicollinearity occurs when regressors are highly correlated with one another. It inflates the variances of the coefficient estimates but does not bias them. The Variance Inflation Factor (VIF) measures how severe the problem is for each regressor.
What Multicollinearity Is
- Perfect multicollinearity means one regressor is an exact linear combination of others; OLS cannot then be computed (example: the dummy variable trap).
- Imperfect (high) multicollinearity: OLS remains unbiased and BLUE, but standard errors are large.
Symptoms
- A high R² and a significant F-test, but few individually significant t-statistics.
- Coefficients with unexpected signs or magnitudes.
- Estimates that change sharply when observations or variables are added or dropped.
- High pairwise correlations between regressors.
VIF
- VIFj = 1/(1 - Rj²), where Rj² comes from regressing xj on all the other regressors.
- Var(bj_hat) = sigma² / [SSTj(1 - Rj²)], so VIF is the factor by which the variance is inflated.
- VIF = 1 means no correlation; VIF > 10 (some use > 5) signals serious multicollinearity.
- Tolerance = 1/VIF.
Remedies
- Collect more data.
- Drop or combine redundant variables.
- Use ratios, first differences, principal components or ridge regression.
- Often do nothing if the goal is prediction or if the variables of interest are unaffected.
Key terms
- Multicollinearity
- High correlation among the explanatory variables.
- VIF
- 1/(1 - Rj²); the factor by which collinearity inflates a coefficient's variance.
- Tolerance
- 1 - Rj², the reciprocal of VIF.
- Dummy variable trap
- Perfect collinearity caused by including all dummy categories together with an intercept.
Lesson 3
Heteroscedasticity and Autocorrelation (Durbin–Watson Test)
Heteroscedasticity (non-constant error variance) and autocorrelation (correlated errors) both violate Gauss–Markov assumptions. OLS stays unbiased, but it is no longer efficient and its usual standard errors are wrong. The Durbin–Watson statistic tests for first-order autocorrelation.
Heteroscedasticity
- Var(ui|X) = sigma_i², which differs across observations; it is common in cross-section data (e.g. income vs spending).
- Consequences: OLS is unbiased but not BLUE, and the usual SEs, t-tests and F-tests are invalid.
- Detection: residual plots (a fan shape), the Breusch–Pagan test, the White test and the Goldfeld–Quandt test.
- Remedies: White heteroscedasticity-robust standard errors, WLS/GLS, or a log transformation.
Autocorrelation
- Cov(ut, ut-1) ≠ 0; it is common in time series. AR(1) form: ut = rho·ut-1 + et.
- Causes: inertia, omitted variables, wrong functional form, lags.
- Consequences: OLS is unbiased but inefficient; with positive autocorrelation, SEs are usually understated, so t-statistics are inflated.
- Remedies: Newey–West (HAC) standard errors, GLS (Cochrane–Orcutt or Prais–Winsten), or adding lags.
Durbin–Watson Test
- d = sum(e_t - e_t-1)² / sum(e_t²), and d ≈ 2(1 - rho_hat).
- d ranges from 0 to 4: d ≈ 2 means no autocorrelation; d near 0 means positive and d near 4 means negative autocorrelation.
- Decision rule using dL and dU: if d < dL, positive autocorrelation; if dL ≤ d ≤ dU, the test is inconclusive; if dU < d < 4 - dU, no autocorrelation; if d > 4 - dL, negative autocorrelation.
- Limitations: it detects only AR(1), the model needs an intercept, and it is invalid with a lagged dependent variable (use Durbin's h or the Breusch–Godfrey test instead).
Key terms
- Heteroscedasticity
- An error variance that changes across observations.
- Autocorrelation
- Correlation between error terms across time periods or observations.
- Durbin–Watson statistic
- A test for AR(1) errors; d ≈ 2(1 - rho).
- Robust standard errors
- SEs that remain valid under heteroscedasticity (White) or autocorrelation (HAC/Newey–West).
- Breusch–Pagan test
- Regresses the squared residuals on the regressors to test for heteroscedasticity.
Lesson 4
Dummy Variables and Stationarity in Regression
Dummy variables let qualitative factors (gender, region, season, policy periods) enter a regression as 0/1 indicators that shift the intercept or slope. Stationarity means a time series has a constant mean, variance and autocovariance over time, and it is required for valid regression inference with time-series data.
Dummy Variables
- A dummy takes the value 1 if a category applies and 0 otherwise.
- Intercept dummy: Y = b0 + b1 D + b2 X + u; b1 is the difference in mean Y between the category and the base group, holding X constant.
- Slope (interaction) dummy: include D*X to let the effect of X differ across groups.
- For a variable with m categories, include m-1 dummies alongside an intercept.
- Including all m dummies plus an intercept causes perfect multicollinearity (the dummy variable trap).
- The omitted category is the benchmark (reference group).
- Common uses: seasonal effects, structural breaks, and policy or event effects.
Stationarity
- Weak (covariance) stationarity: constant mean, constant variance, and autocovariance that depends only on the lag.
- Non-stationary examples: a random walk Y_t = Y_(t-1) + e_t (unit root), and trending series.
- Regressing one non-stationary series on another can produce a spurious regression: high R-squared and significant t-statistics with no real relationship.
- A warning sign of spurious regression is R-squared greater than the Durbin-Watson statistic.
Testing and Remedies
- Detect non-stationarity with the correlogram (ACF) or unit root tests such as Dickey-Fuller, Augmented Dickey-Fuller (ADF) and Phillips-Perron.
- ADF null hypothesis: the series has a unit root (is non-stationary).
- Difference-stationary series: take differences; a series is I(d) if it must be differenced d times to become stationary.
- Trend-stationary series: remove the deterministic trend (detrending).
- Cointegration: non-stationary I(1) series whose linear combination is stationary have a genuine long-run relationship.
Key terms
- Dummy variable
- A 0/1 variable indicating whether a qualitative attribute is present.
- Dummy variable trap
- Perfect multicollinearity caused by including a dummy for every category together with an intercept.
- Stationarity
- Mean, variance and autocovariance of a series do not change over time.
- Unit root
- A property of a series such as a random walk that makes it non-stationary.
- Spurious regression
- A misleading significant relationship found between unrelated non-stationary series.
- Cointegration
- A stationary linear combination of non-stationary series, indicating a long-run equilibrium relationship.
