Marginal

Advanced Econometrics

Econometrics at the level of a first graduate course: OLS in matrix form, projections and Frisch–Waugh–Lovell, the variance matrix and GLS, consistency and asymptotic bias, method of moments and GMM, Wald, LR and LM tests, maximum-likelihood logit, the bootstrap, quantile and kernel regression.

16 lessons in 3 units

Start your free trial14 days free. No card needed.
What you'll learn

16 lessons, one small step at a time

Each lesson states its goal, then works up to it in short steps with practice after each. A placement test at the start skips what you already know.

Linear Models in Matrix Form

6 lessons
  1. OLS in matrix formSet up the normal equations XᵀXβ̂ = Xᵀy from data, and solve them for the OLS coefficients.
  2. Projections & residualsUse the projection and residual-maker matrices and the orthogonality of residuals to regressors to find traces, missing residuals and degrees of freedom.
  3. The Frisch–Waugh–Lovell theoremPartial controls out of a regressor, compute a multiple-regression coefficient from the residualized variables, and explain what controlling for a variable means.
  4. The variance of OLSRead the variances and covariances of OLS coefficients from σ²(XᵀX)⁻¹, compute the standard error of a simple-regression slope, and find the variance of a combination of coefficients.
  5. GLS & weighted least squaresCombine estimates by weighting each by its precision, and compute the precision gained.
  6. Robust & clustered SEsCompute a heteroskedasticity-robust sandwich standard error, adjust standard errors for clustering, and choose the right standard errors in practice.

Asymptotics & Estimation

7 lessons
  1. Asymptotic biasCompute the probability limit of OLS when a regressor is correlated with the error, and identify the sources of endogeneity.
  2. Attenuation biasCompute how much measurement error attenuates an OLS slope from the reliability ratio, and correct a slope for it.
  3. Method of momentsEstimate parameters by matching sample moments to population moments, in linear and in nonlinear cases.
  4. GMM & overidentificationCount moment conditions and overidentifying restrictions, apply Hansen's J test, and recognize familiar estimators as GMM.
  5. The Wald testCompute the Wald statistic for one restriction and for several, and decide a test with it.
  6. LR & LM testsCompute likelihood ratio and Lagrange multiplier statistics, and choose among the Wald, likelihood ratio and Lagrange multiplier tests.
  7. Logit by maximum likelihoodCompute logit probabilities and marginal effects, and evaluate the log-likelihood that maximum likelihood maximizes.

Resampling & Nonparametrics

3 lessons
  1. The bootstrapCompute bootstrap standard errors and percentile intervals, and recognize the bootstrap's limits.
  2. Quantile regressionCompute the check loss and the quantile it targets, and interpret quantile regression coefficients.
  3. Nonparametric regressionCompute a kernel regression estimate as a local average, and explain the bandwidth trade-off.
Sample lesson

OLS in matrix form

Goal: Set up the normal equations XᵀXβ̂ = Xᵀy from data, and solve them for the OLS coefficients.

With many regressors, writing OLS one coefficient at a time becomes hopeless. Matrix notation handles any number of regressors with one formula, and it is the language of every graduate econometrics text and statistical package.

We will set up the normal equations and finish with solving for β̂.

Step 1: The normal equations

Stack the observations: y is an n-vector and X an n × k matrix, with n rows and k columns, whose first column is ones. Minimizing the sum of squared residuals (y − Xβ)ᵀ(y − Xβ) gives the normal equations, Xᵀ(y − Xβ̂) = 0: the residuals are orthogonal to every column of X. Rearranged,

XᵀX·β̂ = Xᵀy
with an intercept and one regressor: XᵀX = [ n Σx ; Σx Σx² ], Xᵀy = [ Σy ; Σxy ]

Example: x = (1, 2, 3) and y = (2, 3, 7) give n = 3, Σx = 6, Σx² = 14, Σy = 12 and Σxy = 29. The system has a unique solution when XᵀX is invertible: no regressor is an exact linear combination of the others. Including a 0/1 indicator for every category together with an intercept breaks this, since the indicators add up to the column of ones.

Step 2: Solving for β̂

Stack the regressors into X, compute XᵀX and Xᵀy, invert XᵀX, and multiply:

β̂ = (XᵀX)⁻¹Xᵀy
slope: b₁ = (n·Σxy − Σx·Σy) ÷ (n·Σx² − (Σx)²), intercept: b₀ = (Σy − b₁Σx)/n = ȳ − b₁x̄

In the example, b₁ = (87 − 72) ÷ (42 − 36) = 2.5 and b₀ = (12 − 15)/3 = −1. The fitted values 1.5, 4 and 6.5 leave residuals 0.5, −1 and 0.5, which sum to zero, as the normal equations require.

In the app, each step ends with practice questions, new ones every time, and the lesson comes back later in spaced reviews.

Start Advanced Econometrics

Lessons that need something you haven't learned yet bring it in first, from any course.

Start your free trial14 days free. No card needed.