Comprehensive Lecture Notes on Empirical Economics, Linear Regression, and Causal Inference

Linear Regression and the California School District Case

Econometric analysis typically addresses two fundamental types of questions. An empirical question examines whether an observed empirical association exists between two variables, such as class size and student learning outcomes. A policy question goes further by exploring the causal effect of an intervention, seeking to quantify the ceteris paribus impact on learning outcomes when class size is reduced by a single student.

Evaluating these questions requires measuring educational achievement. Educational outcomes can be proxied through various metrics, including parental satisfaction, future earnings of pupils, long-term child welfare, or standardized comparative examination scores such as those from the Programme for International Student Assessment (PISA).

In the California Test Score dataset from 1999, the sample comprises all n=420n = 420 elementary (K–6\text{K–6} and K–8\text{K–8}) school districts across the state. The primary variables of interest are TestScore\text{TestScore}, which represents the district average performance of fifth graders on the Stanford-9 standardized achievement test combining reading and mathematics, and STR\text{STR} (Student-Teacher Ratio), defined as the total number of enrolled students in a district divided by the number of full-time equivalent teachers. Summary statistics reveal that STR\text{STR} has a sample mean of 19.619.6 students per teacher with a standard deviation of 1.91.9, having a 10%10\% quantile of 17.317.3, a median (50%50\% quantile) of 19.719.7, and a 90%90\% quantile of 21.921.9. Meanwhile, TestScore\text{TestScore} has a sample mean of 654.2654.2 with a standard deviation of 19.119.1, displaying a 10%10\% quantile of 630.4630.4, a median of 654.5654.5, and a 90%90\% quantile of 678.9678.9.

The theoretical framework begins with the true, unobserved population regression relationship, expressed as TestScore=β0+β1⋅STR\text{TestScore} = \beta_0 + \beta_1 \cdot \text{STR}. In generalized bivariate notation, this is formulated as Yi=β0+β1Xi+uiY_i = \beta_0 + \beta_1 X_i + u_i for i=1,…,ni = 1, \dots, n. Here, the independent variable XX is alternatively known as the regressor, explanatory variable, exogenous variable, right-hand side variable, or cofactor. The dependent variable YY is known as the endogenous, explained, or left-hand side variable. The parameter β0\beta_0 is the intercept, denoting the expected baseline value of YY when X=0X = 0, while β1\beta_1 represents the slope parameter defining the marginal effect β1=ΔYΔX=ΔTestScoreΔSTR\beta_1 = \frac{\Delta Y}{\Delta X} = \frac{\Delta \text{TestScore}}{\Delta \text{STR}}. The term uiu_i is the unobserved population error term or disturbance, which encompasses all determinants of YY outside of XX, including omitted exogenous variables and measurement error in the dependent variable.


Linear regression line with data points and error terms
Ordinary Least Squares (OLS) Estimation and Properties

Because the population parameters are fundamentally unobservable, sample estimators b0b_0 and b1b_1 are chosen to minimize the sum of squared differences between observed values and the fitted regression line, a quantity termed the Sum of Squared Residuals (SSR\text{SSR}): min⁡b0,b1∑i=1n(Yi−(b0+b1Xi))2\min_{b_0, b_1} \sum_{i=1}^n \left( Y_i - (b_0 + b_1 X_i) \right)^2. Taking the first-order partial derivatives with respect to b0b_0 and b1b_1, setting them to zero, and solving yields the analytical Ordinary Least Squares (OLS) estimators: β^1=∑i=1n(Xi−Xˉ)(Yi−Yˉ)∑i=1n(Xi−Xˉ)2\hat{\beta}_1 = \frac{\sum_{i=1}^n (X_i - \bar{X})(Y_i - \bar{Y})}{\sum_{i=1}^n (X_i - \bar{X})^2} and β^0=Yˉ−β^1Xˉ\hat{\beta}_0 = \bar{Y} - \hat{\beta}_1 \bar{X}. Using these parameter estimates, the fitted or predicted values are given by Y^i=β^0+β^1Xi\hat{Y}_i = \hat{\beta}_0 + \hat{\beta}_1 X_i, while the sample residuals are computed as u^i=Yi−Y^i\hat{u}_i = Y_i - \hat{Y}_i.

OLS estimation is preferred for multiple theoretical and practical reasons. First, OLS serves as a natural generalization of the sample mean; imposing the slope restriction β1=0\beta_1 = 0 reduces the OLS intercept estimator directly to the sample mean of the dependent variable (β^0=Yˉ\hat{\beta}_0 = \bar{Y}). Second, under standard Gauss-Markov conditions, OLS estimators are unbiased, meaning E(β^1)=β1E(\hat{\beta}_1) = \beta_1. Third, OLS estimators achieve efficiency, having the lowest variance among all linear unbiased estimators (attaining Best Linear Unbiased Estimator, or BLUE, status). Finally, OLS is universally adopted as the lingua franca across empirical economic research.

Applying bivariate OLS estimation to the California dataset yields the sample regression line TestScore^=698.9−2.28⋅STR\widehat{\text{TestScore}} = 698.9 - 2.28 \cdot \text{STR}, where the intercept estimate is β^0=698.9\hat{\beta}_0 = 698.9 and the slope estimate is β^1=−2.28\hat{\beta}_1 = -2.28. For example, the Antelope School District exhibits an observed STR\text{STR} of 19.3319.33 and an actual TestScore\text{TestScore} of 657.8657.8. The predicted score for Antelope is calculated as Y^Antelope=698.9−2.28×19.33=654.8\hat{Y}_{\text{Antelope}} = 698.9 - 2.28 \times 19.33 = 654.8, which produces an estimated residual of u^Antelope=657.8−654.8=3.0\hat{u}_{\text{Antelope}} = 657.8 - 654.8 = 3.0.


California test score dataset scatterplot and fitted OLS regression line
Goodness-of-Fit Measures

Assessing regression fit starts with the algebraic decomposition of the sample variation based on the identity Yi=Y^i+u^iY_i = \hat{Y}_i + \hat{u}_i. This yields the sum of squares decomposition TSS=ESS+SSR\text{TSS} = \text{ESS} + \text{SSR}, or ∑i=1n(Yi−Yˉ)2=∑i=1n(Y^i−Yˉ)2+∑i=1nu^i2\sum_{i=1}^n (Y_i - \bar{Y})^2 = \sum_{i=1}^n (\hat{Y}_i - \bar{Y})^2 + \sum_{i=1}^n \hat{u}_i^2. Here, the Total Sum of Squares (TSS\text{TSS}) quantifies total sample variation in the dependent variable, the Explained Sum of Squares (ESS\text{ESS}) measures variation accounted for by the model, and the Sum of Squared Residuals (SSR\text{SSR}) represents unexplained sample variation.

The Coefficient of Determination (R2R^2) reflects the proportion of sample variance in YY explained by the regressor XX, defined as R2=ESSTSS=1−SSRTSSR^2 = \frac{\text{ESS}}{\text{TSS}} = 1 - \frac{\text{SSR}}{\text{TSS}}. It is a dimensionless metric strictly bounded such that 0≤R2≤10 \le R^2 \le 1. An R2R^2 of zero indicates that the regressor explains none of the variation in YY, whereas an R2R^2 of one signifies that every data point lies on the fitted regression line (Y^i=Yi\hat{Y}_i = Y_i). In a simple bivariate linear regression, R2R^2 is mathematically identical to the square of the sample correlation coefficient between XX and YY, satisfying R2=rXY2R^2 = r_{XY}^2.

The Standard Error of the Regression (SER\text{SER}) provides an estimator of the standard deviation of the error term uiu_i, capturing the typical magnitude of a sample residual: SER=1n−2∑i=1nu^i2\text{SER} = \sqrt{\frac{1}{n - 2} \sum_{i=1}^n \hat{u}_i^2}. The SER\text{SER} is expressed in the identical units of measurement as the dependent variable YY. In the California test score application, the regression yields R2=0.051R^2 = 0.051 (5.1%5.1\% of variance explained) and SER=18.58\text{SER} = 18.58 (rounded to 18.618.6). Although STR\text{STR} accounts for only a modest share of the dispersion in test scores and typical prediction errors remain substantial, this low fit does not imply that class size lacks economic or policy relevance.

Core Least Squares Assumptions and Sampling Distributions

To conduct valid statistical inference, bivariate OLS relies on three classical assumptions. Assumption 1 specifies that the conditional expectation of the error term given the regressor is zero: E(u∣X=x)=0E(u|X = x) = 0 for all xx. This ensures that the disturbance contains no systematic information regarding XX, which implies Cov(X,u)=0\text{Cov}(X, u) = 0. In the class size application, the error term uiu_i encompasses family background, parental learning support, and extra school facilities. If family income acts as a proxy for these omitted factors, E(u∣X)=0E(u|X) = 0 requires that average family income is invariant across all levels of STR\text{STR}, an assumption frequently violated in observational data. Assumption 2 mandates that observations (Xi,Yi)(X_i, Y_i) for i=1,…,ni = 1, \dots, n are independently and identically distributed (i.i.d.), which naturally holds under simple random sampling from a single large population but is routinely violated in time-series data due to autocorrelation. Assumption 3 requires finite fourth moments, E(X4)<∞E(X^4) < \infty and E(u4)<∞E(u^4) < \infty, ensuring that the distributions of XX and uu possess finite kurtosis and thin tails, preventing extreme outliers from dominating the estimator.

The OLS estimator β^1\hat{\beta}_1 is a random variable characterized by sampling variability across draws. Under Assumptions 1 and 2, β^1\hat{\beta}_1 is unbiased (E(β^1)=β1E(\hat{\beta}_1) = \beta_1). For large sample sizes nn, the asymptotic variance is defined by σβ^12=Var(β^1)=1nVar((Xi−E(Xi))ui)(Var(Xi))2\sigma^2_{\hat{\beta}_1} = \text{Var}(\hat{\beta}_1) = \frac{1}{n} \frac{\text{Var}\left( (X_i - E(X_i)) u_i \right)}{\left( \text{Var}(X_i) \right)^2}. Invoking the Central Limit Theorem, as n→∞n \to \infty, the estimators converge to normal asymptotic distributions: β^1∼aN(β1,σβ^12)\hat{\beta}_1 \overset{a}{\sim} N\left(\beta_1, \sigma^2_{\hat{\beta}_1}\right) and β^0∼aN(β0,σβ^02)\hat{\beta}_0 \overset{a}{\sim} N\left(\beta_0, \sigma^2_{\hat{\beta}_0}\right). Asymptotic normality requires only Assumptions 1 through 3 and does not depend on the underlying error terms uiu_i being normally distributed, allowing standardization to standard normal distributions: β^1−β1σβ^1∼aN(0,1)\frac{\hat{\beta}_1 - \beta_1}{\sigma_{\hat{\beta}_1}} \overset{a}{\sim} N(0, 1) and β^0−β0σβ^0∼aN(0,1)\frac{\hat{\beta}_0 - \beta_0}{\sigma_{\hat{\beta}_0}} \overset{a}{\sim} N(0, 1).

Hypothesis Testing and Confidence Intervals in Bivariate Models

A classical tt-statistic is constructed as the ratio t=estimator−hypothetical valuestandard errort = \frac{\text{estimator} - \text{hypothetical value}}{\text{standard error}}. For testing the null hypothesis H0:β1=β1,0H_0: \beta_1 = \beta_{1,0} against the two-sided alternative H1:β1≠β1,0H_1: \beta_1 \neq \beta_{1,0}, the test statistic is t=β^1−β1,0SE(β^1)t = \frac{\hat{\beta}_1 - \beta_{1,0}}{\text{SE}(\hat{\beta}_1)}. The consistent estimator of the variance σ^β^12\hat{\sigma}^2_{\hat{\beta}_1} is computed as σ^β^12=1n1n−2∑i=1n(Xi−Xˉ)2u^i2[1n∑i=1n(Xi−Xˉ)2]2\hat{\sigma}^2_{\hat{\beta}_1} = \frac{1}{n} \frac{\frac{1}{n - 2} \sum_{i=1}^n (X_i - \bar{X})^2 \hat{u}_i^2}{\left[ \frac{1}{n} \sum_{i=1}^n (X_i - \bar{X})^2 \right]^2}, whose square root yields the standard error SE(β^1)\text{SE}(\hat{\beta}_1). Under asymptotic normality, the decision rule dictates rejecting H0H_0 at the 5%5\% significance level (α=0.05\alpha = 0.05) if ∣t∣>1.96|t| > 1.96, and at the 1%1\% significance level (α=0.01\alpha = 0.01) if ∣t∣>2.58|t| > 2.58. The two-sided pp-value is given by p-value=P(∣Z∣>∣t∣)=2Φ(−∣t∣)p\text{-value} = P(|Z| > |t|) = 2 \Phi(-|t|).

In the California class size application, testing H0:β1=0H_0: \beta_1 = 0 against H1:β1≠0H_1: \beta_1 \neq 0 uses the point estimate β^1=−2.28\hat{\beta}_1 = -2.28, heteroskedasticity-robust standard error SE(β^1)=0.52\text{SE}(\hat{\beta}_1) = 0.52, and intercept standard error SE(β^0)=10.4\text{SE}(\hat{\beta}_0) = 10.4. The resulting tt-statistic is t=−2.28−00.52=−4.38t = \frac{-2.28 - 0}{0.52} = -4.38. Because ∣−4.38∣>1.96|-4.38| > 1.96 and exceeds 2.582.58, the null hypothesis of no relationship is rejected at both the 5%5\% and 1%1\% significance levels (p-value≈1.45×10−5p\text{-value} \approx 1.45 \times 10^{-5} under robust estimation). A 95%95\% confidence interval is constructed as CI0.95=β^1±1.96×SE(β^1)\text{CI}_{0.95} = \hat{\beta}_1 \pm 1.96 \times \text{SE}(\hat{\beta}_1), which evaluates to −2.28±1.96×0.52=(−3.30,−1.26)-2.28 \pm 1.96 \times 0.52 = (-3.30, -1.26). Because this interval excludes zero, the null hypothesis is rejected.

Academic reporting conventions summarize regression equations with standard errors placed directly in parentheses below the estimated coefficients: TestScore^=698.9(10.4)−2.28(0.52)⋅STR\widehat{\text{TestScore}} = \underset{(10.4)}{698.9} - \underset{(0.52)}{2.28} \cdot \text{STR}, alongside R2=0.051R^2 = 0.051 and SER=18.58\text{SER} = 18.58. Across software platforms, default outputs often assume homoskedasticity unless robust options are selected. In R, lm yields an intercept estimate of 698.9330698.9330 (SE=9.4675\text{SE} = 9.4675, t=73.825t = 73.825) and an STR\text{STR} slope of −2.2798-2.2798 (SE=0.4798\text{SE} = 0.4798, t=−4.751t = -4.751) under homoskedastic defaults, but robust adjustment via vcovHC shifts SE(STR)\text{SE}(\text{STR}) to 0.51950.5195 (t=−4.3886t = -4.3886, p=1.447×10−5p = 1.447 \times 10^{-5}). Python's statsmodels OLS reports unadjusted standard errors of 9.4679.467 and 0.4800.480 with an FF-statistic of 22.5822.58, AIC=3648\text{AIC} = 3648, BIC=3657\text{BIC} = 3657, and Durbin-Watson statistic of 0.1290.129. EViews provides identical unadjusted parameters with mean dependent variable 654.1565654.1565 and log-likelihood −1822.250-1822.250. Stata (regress testscr str, r) defaults directly to robust variance estimation, yielding SE(STR)=0.5194892\text{SE}(\text{STR}) = 0.5194892 (t=−4.39t = -4.39) and a 95%95\% confidence interval of [−3.300945,−1.258671][-3.300945, -1.258671]. Microsoft Excel computes solely homoskedastic statistics, reporting a multiple correlation of 0.22640.2264, R2=0.0512R^2 = 0.0512, and adjusted R2=0.0490R^2 = 0.0490.


Spreadsheet output showing regression summary statistics and coefficients
Binary Independent Variables (Dummy Variables)

A binary independent variable or dummy variable takes on strictly two values: Di∈{0,1}D_i \in \{0, 1\}. In the regression model Yi=β0+β1Di+uiY_i = \beta_0 + \beta_1 D_i + u_i, the conditional expectations for the two subsamples are E(Yi∣Di=0)=β0E(Y_i | D_i = 0) = \beta_0 and E(Yi∣Di=1)=β0+β1E(Y_i | D_i = 1) = \beta_0 + \beta_1. Under this formulation, β0\beta_0 represents the baseline reference group mean where Di=0D_i = 0, while β1\beta_1 represents the difference in population expectations between the two groups, defined as β1=E(Yi∣Di=1)−E(Yi∣Di=0)\beta_1 = E(Y_i | D_i = 1) - E(Y_i | D_i = 0).

In the California school district context, defining an indicator variable for small classes such that Di=1D_i = 1 if STRi<20\text{STR}_i < 20 and Di=0D_i = 0 if STRi≥20\text{STR}_i \ge 20 produces the estimated regression line TestScore^=650.0(1.3)+7.4(1.8)⋅D\widehat{\text{TestScore}} = \underset{(1.3)}{650.0} + \underset{(1.8)}{7.4} \cdot D. This result indicates that school districts with small student-teacher ratios average an estimated 7.47.4 points higher on standardized examinations. Testing H0:β1=0H_0: \beta_1 = 0 against H1:β1≠0H_1: \beta_1 \neq 0 yields a tt-statistic of t=7.41.8=4.1t = \frac{7.4}{1.8} = 4.1, demonstrating that the score difference between small and large class sizes is statistically significant beyond the 1%1\% level (∣4.1∣>2.58|4.1| > 2.58).

Homoskedasticity vs. Heteroskedasticity

The conditional variance of the error term determines whether errors are homoskedastic or heteroskedastic. Errors are homoskedastic if the conditional variance given the regressor is constant for all values of xx, satisfying Var(u∣X=x)=σu2\text{Var}(u|X = x) = \sigma^2_u. Errors are heteroskedastic if the conditional variance varies as a function of the regressor: Var(u∣X=x)=σu2(x)\text{Var}(u|X = x) = \sigma^2_u(x). Under homoskedasticity, the Gauss-Markov theorem proves that the OLS estimator achieves BLUE status, and the estimator variance simplifies to Var(β^1)=σu2nσX2\text{Var}(\hat{\beta}_1) = \frac{\sigma^2_u}{n \sigma^2_X}, estimated by σ^β^1homo=1n⋅1n−2∑i=1nu^i21n∑i=1n(Xi−Xˉ)2\hat{\sigma}^{\text{homo}}_{\hat{\beta}_1} = \sqrt{\frac{1}{n} \cdot \frac{\frac{1}{n - 2} \sum_{i=1}^n \hat{u}_i^2}{\frac{1}{n} \sum_{i=1}^n (X_i - \bar{X})^2}}.

Under heteroskedasticity, the Eicker-Huber-White robust standard error formula must be employed: σ^β^1hetero=1n⋅1n−2∑i=1n(Xi−Xˉ)2u^i2[1n∑i=1n(Xi−Xˉ)2]2\hat{\sigma}^{\text{hetero}}_{\hat{\beta}_1} = \sqrt{\frac{1}{n} \cdot \frac{\frac{1}{n - 2} \sum_{i=1}^n (X_i - \bar{X})^2 \hat{u}_i^2}{\left[ \frac{1}{n} \sum_{i=1}^n (X_i - \bar{X})^2 \right]^2}}. Because statistical software packages routinely default to homoskedastic formulas unless manually overridden, applying homoskedastic standard errors in the presence of heteroskedasticity leads to systematically biased standard errors, erroneous tt-statistics, invalid pp-values, and incorrect confidence intervals. In contrast, heteroskedasticity-robust standard errors remain asymptotically valid even if the errors are purely homoskedastic, as both formulas converge to identical values when n→∞n \to \infty. Consequently, modern empirical practice dictates using heteroskedasticity-robust standard errors as standard protocol.

Causality and the Ideal Randomized Controlled Experiment

The negative empirical association observed between class size and test scores (β^1=−2.28\hat{\beta}_1 = -2.28) does not establish a causal mechanism. In observational settings, affluent school districts possess higher tax revenues, enabling them to hire more teachers (reducing STR\text{STR}) while concurrently funding superior learning facilities, instructional technology, and tutoring support. Consequently, the error term and the regressor are correlated (Cov(ui,STRi)≠0\text{Cov}(u_i, \text{STR}_i) \neq 0), which violates OLS Assumption 1 (E(u∣X)=0E(u|X) = 0).

In econometric theory, a causal effect is formally defined as the quantitative impact that would be measured within an ideal randomized controlled experiment. Such an experiment is ideal because all subjects comply fully with the experimental protocol without attrition, non-response, or measurement error. It is randomized because individuals from the population are randomly sampled and assigned to treatment or control arms, ensuring that treatment status is statistically independent of all baseline characteristics. Finally, it is controlled because an untreated baseline control group is retained to benchmark counterfactual outcomes.

Multiple Linear Regression and Omitted Variable Bias

Omitted variable bias occurs when an excluded variable causes the OLS estimator to be biased and inconsistent. Specifically, an omitted variable ZZ introduces bias in the coefficient of XX if and only if two conditions hold: first, ZZ must be a determinant of the dependent variable YY (i.e., contained within uu); second, ZZ must be correlated with the included regressor XX (Cov(X,Z)≠0\text{Cov}(X, Z) \neq 0). Under these conditions, the estimator converges according to the asymptotic bias formula: β^1→pβ1+σuσX⋅ρXu\hat{\beta}_1 \xrightarrow{p} \beta_1 + \frac{\sigma_u}{\sigma_X} \cdot \rho_{Xu}, where ρXu\rho_{Xu} represents the population correlation coefficient between XX and the error term uu.

This bias can be demonstrated using the percentage of English language learners (PctEL\text{PctEL}). Because English learners face instructional barriers, higher PctEL\text{PctEL} directly lowers test scores, meaning PctEL\text{PctEL} is a determinant of YY. Furthermore, districts with high immigrant shares often face budget constraints, leading to higher STR\text{STR} (Cov(X,Z)>0\text{Cov}(X, Z) > 0). Because higher PctEL\text{PctEL} lowers uu (ρZu<0\rho_{Zu} < 0), the resulting error-regressor correlation is negative (ρXu<0\rho_{Xu} < 0). Consequently, the simple regression slope β^1\hat{\beta}_1 is negatively biased away from zero, exaggerating the true magnitude of the class size effect.

An empirical subsample analysis across English learner quartiles highlights this omitted variable bias. Across all districts combined, small classes (STR<20\text{STR} < 20, n=238n = 238) average a score of 657.4657.4, whereas large classes (STR≥20\text{STR} \ge 20, n=182n = 182) average 650.0650.0, generating a difference of 7.47.4 points (t=4.04t = 4.04). However, when evaluating districts within homogeneous demographic strata, the differences shrink dramatically: for PctEL<1.9%\text{PctEL} < 1.9\%, the difference is −0.9-0.9 points (t=−0.30t = -0.30); for PctEL∈[1.9%,8.8%)\text{PctEL} \in [1.9\%, 8.8\%), the difference is 3.33.3 points (t=1.13t = 1.13); for PctEL∈[8.8%,23.0%)\text{PctEL} \in [8.8\%, 23.0\%), the difference is 5.25.2 points (t=1.72t = 1.72); and for PctEL≥23.0%\text{PctEL} \ge 23.0\%, the difference is 1.91.9 points (t=0.68t = 0.68). Controlling for English proficiency reveals that within similar demographic groups, the difference attributable to class size becomes statistically indistinguishable from zero.

To control for confounding factors, the general multiple regression model incorporates kk regressors: Yi=β0+β1X1i+β2X2i+⋯+βkXki+uiY_i = \beta_0 + \beta_1 X_{1i} + \beta_2 X_{2i} + \dots + \beta_k X_{ki} + u_i. In this framework, the slope coefficient β1\beta_1 reflects a ceteris paribus marginal effect: β1=ΔYΔX1\beta_1 = \frac{\Delta Y}{\Delta X_1}, holding all other regressors X2,…,XkX_2, \dots, X_k constant. Estimating the California class size model with an added control for English learners yields TestScore^=686.0−1.10⋅STR−0.65⋅PctEL\widehat{\text{TestScore}} = 686.0 - 1.10 \cdot \text{STR} - 0.65 \cdot \text{PctEL}. Incorporating PctEL\text{PctEL} cuts the estimated class size effect by more than half, moving the coefficient from −2.28-2.28 to −1.10-1.10.

In multiple regression, goodness-of-fit is assessed using the Standard Error of the Regression, SER=1n−k−1∑i=1nu^i2\text{SER} = \sqrt{\frac{1}{n - k - 1} \sum_{i=1}^n \hat{u}_i^2}, and the Adjusted Coefficient of Determination (Rˉ2\bar{R}^2), defined as Rˉ2=1−n−1n−k−1SSRTSS\bar{R}^2 = 1 - \frac{n - 1}{n - k - 1} \frac{\text{SSR}}{\text{TSS}}. While unadjusted R2R^2 mechanically increases or stays constant whenever another regressor is added, Rˉ2\bar{R}^2 penalizes the loss of degrees of freedom, is strictly less than R2R^2, and can take negative values. In California, moving from a single regressor (STR\text{STR}) to two regressors (STR\text{STR} and PctEL\text{PctEL}) increases R2R^2 from 0.0510.051 to 0.4260.426, raises Rˉ2\bar{R}^2 from 0.0490.049 to 0.4240.424, and reduces SER\text{SER} from 18.618.6 to 14.514.5.

Multiple regression requires four core OLS assumptions: first, E(u∣X1=x1,…,Xk=xk)=0E(u|X_1 = x_1, \dots, X_k = x_k) = 0; second, (X1i,…,Xki,Yi)(X_{1i}, \dots, X_{ki}, Y_i) are i.i.d. draws for i=1,…,ni = 1, \dots, n; third, finite fourth moments hold such that E(Xji4)<∞E(X_{ji}^4) < \infty for all j=1,…,kj=1,\dots,k and E(ui4)<∞E(u_i^4) < \infty; and fourth, no perfect multicollinearity exists. Perfect multicollinearity occurs when one regressor is an exact linear combination of other regressors, which prevents matrix inversion during estimation, such as including dummy variables for both small and large classes alongside a common intercept.

Hypothesis Testing with Multiple Restrictions

When evaluating multiple parameter restrictions, conducting separate univariate tt-tests distorts the overall Type I error rate. For instance, in a model specified as TestScorei=β0+β1STRi+β2Expni+β3PctELi+ui\text{TestScore}_i = \beta_0 + \beta_1 \text{STR}_i + \beta_2 \text{Expn}_i + \beta_3 \text{PctEL}_i + u_i, testing the joint null hypothesis that school resources have zero impact (H0:β1=0 and β2=0H_0: \beta_1 = 0 \text{ and } \beta_2 = 0 against H1:β1≠0 or β2≠0H_1: \beta_1 \neq 0 \text{ or } \beta_2 \neq 0) by rejecting H0H_0 whenever either ∣t1∣>1.96|t_1| > 1.96 or ∣t2∣>1.96|t_2| > 1.96 inflates the true significance level well beyond the nominal 5%5\%.

To maintain the correct size of the test, an FF-test must be employed. For two joint restrictions (H0:β1=β1,0,β2=β2,0H_0: \beta_1 = \beta_{1,0}, \beta_2 = \beta_{2,0}), the heteroskedasticity-robust FF-statistic is defined as F=12(t12+t22−2ρ^t1t2t1t21−ρ^t1t22)F = \frac{1}{2} \left( \frac{t_1^2 + t_2^2 - 2 \hat{\rho}_{t_1 t_2} t_1 t_2}{1 - \hat{\rho}^2_{t_1 t_2}} \right), where ρ^t1t2\hat{\rho}_{t_1 t_2} is the estimated correlation between the two individual tt-statistics. Under H0H_0, this statistic asymptotically follows a χq2/q\chi^2_q / q distribution, where qq represents the number of restrictions. Large-sample critical values for FF-tests at the 5%5\% and 1%1\% levels are, respectively: 3.843.84 and 6.636.63 for q=1q = 1; 3.003.00 and 4.614.61 for q=2q = 2; 2.602.60 and 3.783.78 for q=3q = 3; 2.372.37 and 3.323.32 for q=4q = 4; and 2.212.21 and 3.023.02 for q=5q = 5.

In the California dataset, estimating the model with expenditure per student yields TestScore^=649.58(15.46)−0.286(0.482)⋅STR+0.00387(0.00158)⋅Expn−0.656(0.0318)⋅PctEL\widehat{\text{TestScore}} = \underset{(15.46)}{649.58} - \underset{(0.482)}{0.286} \cdot \text{STR} + \underset{(0.00158)}{0.00387} \cdot \text{Expn} - \underset{(0.0318)}{0.656} \cdot \text{PctEL}. While individual tt-statistics report t=−0.594t = -0.594 (p=0.553p = 0.553) for STR\text{STR} and t=2.45t = 2.45 (p=0.015p = 0.015) for Expn\text{Expn}, testing the joint restriction H0:β1=0 and β2=0H_0: \beta_1 = 0 \text{ and } \beta_2 = 0 yields an FF-statistic of 5.43375.4337 (p-value=0.00468p\text{-value} = 0.00468). Because 5.4337>4.615.4337 > 4.61, the joint null hypothesis is rejected at the 1%1\% level, confirming that school resource variables are jointly significant despite the statistical insignificance of class size in this specification.

Testing single linear restrictions across coefficients (H0:β1=β2H_0: \beta_1 = \beta_2) can be accomplished through reparameterization or direct FF-testing. Under reparameterization, defining γ=β1−β2\gamma = \beta_1 - \beta_2 allows the regression to be rewritten as Yi=β0+γX1i+β2Wi+uiY_i = \beta_0 + \gamma X_{1i} + \beta_2 W_i + u_i (where Wi=X1i+X2iW_i = X_{1i} + X_{2i}), permitting a standard tt-test of H0:γ=0H_0: \gamma = 0. Alternatively, direct software testing of str = expn_stu yields F=0.3638F = 0.3638 (p-value=0.5467p\text{-value} = 0.5467), which fails to reject equality. Furthermore, the 95%95\% joint confidence region for two coefficients constitutes an ellipse defined by all parameter pairs that cannot be rejected at the 5%5\% significance level: {(β1,0,β2,0):F(β1,0,β2,0)<3.00}\left\{ (\beta_{1,0}, \beta_{2,0}) : F(\beta_{1,0}, \beta_{2,0}) < 3.00 \right\}. Constructing independent square regions from univariate intervals is methodologically invalid because it ignores correlation between estimators.

Model Specification and Comparative Analysis

Sound model specification strategy entails establishing a baseline specification and contrasting it against plausible alternatives that incorporate additional control variables. An increase in R2R^2 or Rˉ2\bar{R}^2 does not demonstrate causality, validate regressor selection, or prove the absence of omitted variable bias; model selection must always be guided by economic theory.

A comparative analysis across five benchmark specifications for California school districts (n=420n = 420) demonstrates how coefficient estimates stabilize once relevant socioeconomic variables are introduced:

In Model (1), a simple bivariate regression on STR\text{STR} produces a slope of −2.28-2.28 (SE=0.52\text{SE} = 0.52, p<0.01p < 0.01) with an intercept of 698.9698.9 (SE=10.4\text{SE} = 10.4), SER=18.58\text{SER} = 18.58, and Rˉ2=0.049\bar{R}^2 = 0.049.

In Model (2), adding the percentage of English learners shifts the STR\text{STR} coefficient to −1.10-1.10 (SE=0.43\text{SE} = 0.43, p<0.05p < 0.05) and yields an English learner coefficient of −0.65-0.65 (SE=0.03\text{SE} = 0.03, p<0.01p < 0.01), an intercept of 686.0686.0 (SE=8.7\text{SE} = 8.7), SER=14.46\text{SER} = 14.46, and Rˉ2=0.424\bar{R}^2 = 0.424.

In Model (3), including the percentage of students qualifying for subsidized lunch yields an STR\text{STR} slope of −1.00-1.00 (SE=0.27\text{SE} = 0.27, p<0.01p < 0.01), an English learner coefficient of −0.12-0.12 (SE=0.03\text{SE} = 0.03, p<0.01p < 0.01), a subsidized lunch coefficient of −0.55-0.55 (SE=0.02\text{SE} = 0.02, p<0.01p < 0.01), an intercept of 700.2700.2 (SE=5.6\text{SE} = 5.6), SER=9.08\text{SER} = 9.08, and Rˉ2=0.773\bar{R}^2 = 0.773.

In Model (4), substituting the percentage qualifying for income assistance in place of subsidized lunch results in an STR\text{STR} slope of −1.31-1.31 (SE=0.34\text{SE} = 0.34, p<0.01p < 0.01), an English learner coefficient of −0.49-0.49 (SE=0.03\text{SE} = 0.03, p<0.01p < 0.01), an income assistance coefficient of −0.79-0.79 (SE=0.07\text{SE} = 0.07, p<0.01p < 0.01), an intercept of 698.0698.0 (SE=6.9\text{SE} = 6.9), SER=11.65\text{SER} = 11.65, and Rˉ2=0.626\bar{R}^2 = 0.626.

In Model (5), incorporating all four regressors results in an STR\text{STR} coefficient of −1.01-1.01 (SE=0.27\text{SE} = 0.27, p<0.01p < 0.01), an English learner coefficient of −0.13-0.13 (SE=0.04\text{SE} = 0.04, p<0.01p < 0.01), a subsidized lunch coefficient of −0.53-0.53 (SE=0.04\text{SE} = 0.04, p<0.01p < 0.01), an income assistance coefficient of 0.050.05 (SE=0.06\text{SE} = 0.06, not statistically significant), an intercept of 700.4700.4 (SE=5.5\text{SE} = 5.5), SER=9.08\text{SER} = 9.08, and Rˉ2=0.773\bar{R}^2 = 0.773.

Nonlinear Regression Models

Linear models impose the restriction that the marginal effect of XX on YY remains constant. When economic phenomena display diminishing or accelerating returns, a linear model suffers from functional form misspecification. In the general nonlinear regression model Yi=f(X1i,…,Xki)+uiY_i = f(X_{1i}, \dots, X_{ki}) + u_i with E(u∣X1,…,Xk)=0E(u|X_1, \dots, X_k) = 0, the estimated marginal change is evaluated as ΔY^=f^(X1+ΔX1,X2,…,Xk)−f^(X1,X2,…,Xk)\Delta \hat{Y} = \hat{f}(X_1 + \Delta X_1, X_2, \dots, X_k) - \hat{f}(X_1, X_2, \dots, X_k).

One common method for capturing nonlinearity is polynomial regression, which expresses the conditional mean as an rr-th degree polynomial: Yi=β0+β1Xi+β2Xi2+⋯+βrXir+uiY_i = \beta_0 + \beta_1 X_i + \beta_2 X_i^2 + \dots + \beta_r X_i^r + u_i. When applied to district average income (avginc\text{avginc}, in thousands of dollars), the estimated quadratic regression function is TestScore^=607.3+3.85⋅avginc−0.0423⋅avginc2\widehat{\text{TestScore}} = 607.3 + 3.85 \cdot \text{avginc} - 0.0423 \cdot \text{avginc}^2. The heteroskedasticity-robust tt-statistic on avginc2\text{avginc}^2 is t=−0.042310.00478=−8.85t = \frac{-0.04231}{0.00478} = -8.85, strongly rejecting the hypothesis of a linear functional form. The marginal effect of income diminishes at higher baseline levels: an income increase from $5,000\$5,000 to $6,000\$6,000 yields ΔTestScore^=+3.4\Delta \widehat{\text{TestScore}} = +3.4; from $25,000\$25,000 to $26,000\$26,000, the change is +1.7+1.7; from $45,000\$45,000 to $46,000\$46,000, the change is 0.00.0; and from $65,000\$65,000 to $66,000\$66,000, the change becomes −1.7-1.7.

Another approach relies on logarithmic transformations, exploiting the mathematical property that ln⁡(x+Δx)−ln⁡(x)≈Δxx\ln(x + \Delta x) - \ln(x) \approx \frac{\Delta x}{x} for small changes. Three specifications are widely used:

In a linear-log model, given by Yi=β0+β1ln⁡(Xi)+uiY_i = \beta_0 + \beta_1 \ln(X_i) + u_i, a 1%1\% increase in XX leads to an absolute change in YY of approximately 0.01×β10.01 \times \beta_1. For the California data, TestScore^=557.83+36.42⋅ln⁡(avginc)\widehat{\text{TestScore}} = 557.83 + 36.42 \cdot \ln(\text{avginc}), implying that a 1%1\% increase in district income increases test scores by roughly 0.36420.3642 points.

In a log-linear model, specified as ln⁡(Yi)=β0+β1Xi+ui\ln(Y_i) = \beta_0 + \beta_1 X_i + u_i, a one-unit absolute increase in XX induces a relative proportional change in YY of approximately (β1×100)%(\beta_1 \times 100)\%, where β1\beta_1 represents a semi-elasticity.

In a log-log model, formulated as ln⁡(Yi)=β0+β1ln⁡(Xi)+ui\ln(Y_i) = \beta_0 + \beta_1 \ln(X_i) + u_i, a 1%1\% change in XX leads to a β1%\beta_1\% change in YY, making β1\beta_1 an elasticity. For California, ln⁡(TestScore)^=6.336+0.0554⋅ln⁡(avginc)\widehat{\ln(\text{TestScore})} = 6.336 + 0.0554 \cdot \ln(\text{avginc}), indicating that a 1%1\% increase in income produces a 0.0554%0.0554\% increase in test scores. Notably, goodness-of-fit metrics (R2R^2 and Rˉ2\bar{R}^2) cannot be compared between specifications that use different transformations of the dependent variable (YY versus ln⁡(Y)\ln(Y)).

Interaction Effects

Interaction terms allow the marginal effect of one regressor to depend on the level of another regressor. Three primary interaction specifications are commonly implemented.

First, interactions between two dummy variables are specified as Yi=β0+β1D1i+β2D2i+β3(D1i⋅D2i)+uiY_i = \beta_0 + \beta_1 D_{1i} + \beta_2 D_{2i} + \beta_3 (D_{1i} \cdot D_{2i}) + u_i. In this model, the conditional expectation when both indicators equal zero is E(Y∣D1=0,D2=0)=β0E(Y | D_1 = 0, D_2 = 0) = \beta_0, whereas the difference in expectations between D1=1D_1 = 1 and D1=0D_1 = 0 for a given d2d_2 is β1+β3d2\beta_1 + \beta_3 d_2. In the College Distance dataset, modeling years of completed education (ED\text{ED}) as a function of parental college attainment (DadColl\text{DadColl} and MomColl\text{MomColl}) yields ED^=13.50+1.18⋅DadColl+0.92⋅MomColl−0.48⋅(DadColl×MomColl)\widehat{\text{ED}} = 13.50 + 1.18 \cdot \text{DadColl} + 0.92 \cdot \text{MomColl} - 0.48 \cdot (\text{DadColl} \times \text{MomColl}). Expected education is 13.5013.50 years when neither parent completed college, 14.4214.42 years when only the mother completed college, 14.6814.68 years when only the father completed college, and 15.1215.12 years (13.50+1.18+0.92−0.4813.50 + 1.18 + 0.92 - 0.48) when both parents completed college.

Second, interactions between a continuous variable and a dummy variable take the form Yi=β0+β1Xi+β2Di+β3(Xi⋅Di)+uiY_i = \beta_0 + \beta_1 X_i + \beta_2 D_i + \beta_3 (X_i \cdot D_i) + u_i. This specification generates two distinct regression lines: for Di=0D_i = 0, the line is Yi=β0+β1Xi+uiY_i = \beta_0 + \beta_1 X_i + u_i, while for Di=1D_i = 1, the line is Yi=(β0+β2)+(β1+β3)Xi+uiY_i = (\beta_0 + \beta_2) + (\beta_1 + \beta_3) X_i + u_i, yielding a marginal effect of ΔYΔX=β1+β3D\frac{\Delta Y}{\Delta X} = \beta_1 + \beta_3 D. In California, defining HiEL=1\text{HiEL} = 1 if PctEL≥10\text{PctEL} \ge 10 and 00 otherwise yields TestScore^=682.2(11.9)−0.97(0.59)⋅STR+5.6(19.5)⋅HiEL−1.28(0.97)⋅(STR×HiEL)\widehat{\text{TestScore}} = \underset{(11.9)}{682.2} - \underset{(0.59)}{0.97} \cdot \text{STR} + \underset{(19.5)}{5.6} \cdot \text{HiEL} - \underset{(0.97)}{1.28} \cdot (\text{STR} \times \text{HiEL}). The slope is −0.97-0.97 for low English learner districts and −2.25-2.25 (−0.97−1.28-0.97 - 1.28) for high English learner districts. A joint test of group differences (H0:β2=0,β3=0H_0: \beta_2 = 0, \beta_3 = 0) yields an FF-statistic of 89.9489.94 (p<2.2×10−16p < 2.2 \times 10^{-16}).

Third, interactions between two continuous variables are formulated as Yi=β0+β1X1i+β2X2i+β3(X1i⋅X2i)+uiY_i = \beta_0 + \beta_1 X_{1i} + \beta_2 X_{2i} + \beta_3 (X_{1i} \cdot X_{2i}) + u_i, producing the marginal effect ΔYΔX1=β1+β3X2\frac{\Delta Y}{\Delta X_1} = \beta_1 + \beta_3 X_2. Modeling the interaction between class size and English learners yields TestScore^=686.3(11.8)−1.12(0.59)⋅STR−0.67(0.37)⋅PctEL+0.0012(0.019)⋅(STR×PctEL)\widehat{\text{TestScore}} = \underset{(11.8)}{686.3} - \underset{(0.59)}{1.12} \cdot \text{STR} - \underset{(0.37)}{0.67} \cdot \text{PctEL} + \underset{(0.019)}{0.0012} \cdot (\text{STR} \times \text{PctEL}), which establishes the marginal effect of class size as ΔTestScoreΔSTR=−1.12+0.0012⋅PctEL\frac{\Delta \text{TestScore}}{\Delta \text{STR}} = -1.12 + 0.0012 \cdot \text{PctEL}.

Assessing Validity in Econometric Studies

Evaluating empirical studies requires distinguishing between internal and external validity. Internal validity requires that statistical inferences regarding causal parameters are correct for the population under study. External validity requires that these inferences can be generalized across different populations, geographical contexts, time periods, and institutional environments.

Internal validity faces five primary threats. The first threat is omitted variable bias, which arises when omitted determinants correlate with included regressors; it can be mitigated using control variables, randomized experiments, panel data, or instrumental variables. The second threat is functional form misspecification, which occurs when linear functions are applied to nonlinear relationships, causing biased estimates of marginal effects; this is addressed through polynomial or logarithmic transformations.

The third threat is errors-in-variables, caused by measurement error in the regressors due to recording errors, recollection errors, or intentional misreporting. When the observed variable is X~i=Xi+wi\tilde{X}_i = X_i + w_i, the estimated regression becomes Yi=β0+β1X~i+u~iY_i = \beta_0 + \beta_1 \tilde{X}_i + \tilde{u}_i, where u~i=ui−β1(X~i−Xi)\tilde{u}_i = u_i - \beta_1 (\tilde{X}_i - X_i). Because the covariance between the measured regressor and composite error is Cov(X~i,u~i)=−β1Var(wi)≠0\text{Cov}(\tilde{X}_i, \tilde{u}_i) = -\beta_1 \text{Var}(w_i) \neq 0, classical attenuation bias pulls the estimator toward zero, rendering OLS biased and inconsistent.

The fourth threat is sample selection bias, which arises when the sampling mechanism depends on the value of the dependent variable YY. For example, studying ten-year investment returns exclusively using active funds that survived the full decade creates positive selection bias (Cov(ActiveFundi,ui)>0\text{Cov}(\text{ActiveFund}_i, u_i) > 0) because underperforming funds were liquidated, thereby overestimating average returns.

The fifth threat is simultaneous causality or endogeneity, which occurs when bidirectional feedback exists between YY and XX. In the system Yi=β0+β1Xi+uiY_i = \beta_0 + \beta_1 X_i + u_i and Xi=γ0+γ1Yi+viX_i = \gamma_0 + \gamma_1 Y_i + v_i, a shock uiu_i directly changes YiY_i, which in turn alters XiX_i if γ1>0\gamma_1 > 0, inducing Cov(Xi,ui)≠0\text{Cov}(X_i, u_i) \neq 0. If educational authorities allocate extra funding to reduce class sizes specifically in districts with low examination scores (γ1>0\gamma_1 > 0), the OLS estimate β^1\hat{\beta}_1 suffers from positive bias, obscuring the beneficial impacts of smaller classes.

Instrumental Variables Regression

Instrumental variables (IV) regression addresses omitted variable bias, measurement error, and simultaneous causality by decomposing an endogenous regressor XX into an uncorrelated exogenous component and a correlated endogenous component. A valid instrument ZZ must fulfill two conditions: instrument relevance, requiring Cov(Z,X)≠0\text{Cov}(Z, X) \neq 0, and instrument exogeneity, requiring Cov(Z,u)=0\text{Cov}(Z, u) = 0.

Two-Stage Least Squares (TSLS) operationalizes IV regression in two sequential steps. In Stage 1, the endogenous regressor XX is regressed on the instrument ZZ and any included exogenous regressors WW to isolate the exogenous variation: Xi=π0+π1Zi+viX_i = \pi_0 + \pi_1 Z_i + v_i, generating predicted values X^i=π^0+π^1Zi\hat{X}_i = \hat{\pi}_0 + \hat{\pi}_1 Z_i. In Stage 2, the dependent variable YY is regressed on the predicted values X^\hat{X} and controls WW: Yi=β0+β1X^i+uiY_i = \beta_0 + \beta_1 \hat{X}_i + u_i. Analytically, the simple IV estimator is expressed as β^1TSLS=sYZsXZ=∑i=1n(Yi−Yˉ)(Zi−Zˉ)∑i=1n(Xi−Xˉ)(Zi−Zˉ)\hat{\beta}_1^{\text{TSLS}} = \frac{s_{YZ}}{s_{XZ}} = \frac{\sum_{i=1}^n (Y_i - \bar{Y})(Z_i - \bar{Z})}{\sum_{i=1}^n (X_i - \bar{X})(Z_i - \bar{Z})}. Standard OLS errors from the second stage must never be used because they ignore the estimation uncertainty associated with X^i\hat{X}_i; specialized TSLS routines must be utilized.

Identification depends on the relationship between the number of instruments (mm) and the number of endogenous regressors (kk). A model is exactly identified when m=km = k, allowing unique parameter estimation. It is over-identified when m>km > k, providing excess instruments that permit empirical tests of instrument exogeneity. It is under-identified when m<km < k, in which case the parameters cannot be estimated without additional instruments.

Empirical applications illustrate these principles. In butter demand estimation, equilibrium price and quantity are determined simultaneously by supply and demand; rainfall in dairy-producing regions serves as an instrument because it shifts supply exogenously without shifting consumer demand. In cigarette demand across 48 U.S. states in 1995, estimating ln⁡(Qicig)=β0+β1ln⁡(Picig)+β2ln⁡(Incomei)+ui\ln(Q_i^{\text{cig}}) = \beta_0 + \beta_1 \ln(P_i^{\text{cig}}) + \beta_2 \ln(\text{Income}_i) + u_i with m=1m = 1 instrument (sales tax) yields a price elasticity of −1.14-1.14 (SE=0.37\text{SE} = 0.37). Adding a second instrument (cigarette-specific tax) produces an over-identified model (m=2m = 2) with a price elasticity of −1.28-1.28 (SE=0.25\text{SE} = 0.25), where the additional instrument sharpens estimation precision by shrinking the standard error.

Instrument diagnostics focus on detecting weak instruments and testing exogeneity. Instruments are weak when they have little explanatory power in the first-stage regression (coefficients πj≈0\pi_j \approx 0). When Cov(X,Z)≈0\text{Cov}(X, Z) \approx 0, the sample covariance sXZs_{XZ} in the denominator approaches zero, leading to unstable estimators and non-normal sampling distributions. As a diagnostic rule of thumb, the first-stage FF-statistic testing H0:π1=⋯=πm=0H_0: \pi_1 = \dots = \pi_m = 0 must exceed 1010; values below 1010 signify weak instruments. Exogeneity cannot be tested in an exactly identified model, but in an over-identified model (m>km > k), a Hansen-Sargan JJ-test can test the joint null hypothesis that all instruments are uncorrelated with the disturbance.

Panel Data Models and Fixed Effects

Longitudinal panel data track the same nn cross-sectional entities across T≥2T \ge 2 time periods, represented as (Xit,Yit)(X_{it}, Y_{it}) for i=1,…,ni = 1, \dots, n and t=1,…,Tt = 1, \dots, T. A balanced panel contains complete observations across all entities and periods (n×Tn \times T observations), whereas an unbalanced panel contains missing records for some entities in certain periods.

In the U.S. state traffic fatality and beer tax dataset (n=48n = 48 states from 1982 to 1988, T=7T = 7, N=336N = 336), cross-sectional bivariate regressions yield positive slope coefficients: FatalityRate^1982=2.01(0.15)+0.15(0.13)⋅BeerTax\widehat{\text{FatalityRate}}_{1982} = \underset{(0.15)}{2.01} + \underset{(0.13)}{0.15} \cdot \text{BeerTax} (t=1.15t = 1.15, not statistically significant) and FatalityRate^1988=1.86(0.11)+0.44(0.13)⋅BeerTax\widehat{\text{FatalityRate}}_{1988} = \underset{(0.11)}{1.86} + \underset{(0.13)}{0.44} \cdot \text{BeerTax} (t=3.43,p<0.01t = 3.43, p < 0.01). This counterintuitive positive relationship is driven by omitted variable bias: unobserved, time-invariant state characteristics, such as highway infrastructure quality, rural road density, and cultural drinking norms, confound the cross-sectional estimates.


Scatterplots showing the cross-sectional relationship between beer tax and traffic fatalities in 1982 and 1988

When T=2T = 2, a before-and-after comparison using first differences eliminates time-invariant omitted variables ZiZ_i. Differencing the regression equations between 1988 and 1982 yields: FatalityRatei,1988−FatalityRatei,1982=β1(BeerTaxi,1988−BeerTaxi,1982)+(ui,1988−ui,1982)\text{FatalityRate}_{i,1988} - \text{FatalityRate}_{i,1982} = \beta_1 (\text{BeerTax}_{i,1988} - \text{BeerTax}_{i,1982}) + (u_{i,1988} - u_{i,1982}). Estimating this difference model produces ΔFatalityRate^=−0.072(0.065)−1.04(0.35)⋅ΔBeerTax\widehat{\Delta \text{FatalityRate}} = \underset{(0.065)}{-0.072} - \underset{(0.35)}{1.04} \cdot \Delta \text{BeerTax}. By purging the time-invariant state characteristics, the estimated slope flips from positive to a statistically significant negative coefficient (t=−2.97,p<0.01t = -2.97, p < 0.01), indicating that a $1\$1 increase in beer tax per case reduces traffic fatalities by 1.041.04 deaths per 10,00010,000 people.


Scatterplot showing the negative relationship between changes in fatality rate and changes in beer tax from 1982 to 1988

For panels where T≥2T \ge 2, the entity fixed effects model is specified as Yit=β1Xit+αi+uitY_{it} = \beta_1 X_{it} + \alpha_i + u_{it}, where αi\alpha_i captures entity-specific intercepts representing fixed effects. The model can be written equivalently using n−1n - 1 dummy variables: Yit=β0+β1Xit+γ2D2,i+⋯+γnDn,i+uitY_{it} = \beta_0 + \beta_1 X_{it} + \gamma_2 D_{2,i} + \dots + \gamma_n D_{n,i} + u_{it}. To estimate the model efficiently without inverting large matrices, the entity-demeaned (within) algorithm computes entity-specific time averages Yˉi=1T∑t=1TYit\bar{Y}_i = \frac{1}{T} \sum_{t=1}^T Y_{it} and Xˉi=1T∑t=1TXit\bar{X}_i = \frac{1}{T} \sum_{t=1}^T X_{it}, subtracts them to eliminate αi\alpha_i, and estimates Yit−Yˉi=β1(Xit−Xˉi)+(uit−uˉi)Y_{it} - \bar{Y}_i = \beta_1 (X_{it} - \bar{X}_i) + (u_{it} - \bar{u}_i) via OLS. In the traffic fatality application, state fixed effects yield β^1=−0.66\hat{\beta}_1 = -0.66 (SE=0.29\text{SE} = 0.29), which is statistically significant at the 5%5\% level.

Time fixed effects models control for unobserved variables that vary over time but affect all entities equally, such as national macroeconomic conditions or federal automobile safety regulations: Yit=β1Xit+λt+uitY_{it} = \beta_1 X_{it} + \lambda_t + u_{it}, where λt\lambda_t denotes time-specific intercepts. Combining both dimensions yields the entity and time fixed effects model, Yit=β1X1,it+⋯+βkXk,it+αi+λt+uitY_{it} = \beta_1 X_{1,it} + \dots + \beta_k X_{k,it} + \alpha_i + \lambda_t + u_{it}, which eliminates bias from both time-invariant entity variables and entity-invariant temporal shocks. Applied to the traffic fatality data, the estimated model is FatalityRate^=−0.64(0.36)⋅BeerTax+State Fixed Effects+Time Fixed Effects\widehat{\text{FatalityRate}} = \underset{(0.36)}{-0.64} \cdot \text{BeerTax} + \text{State Fixed Effects} + \text{Time Fixed Effects}. The resulting coefficient is statistically significant at the 10%10\% level (t=−0.640.36=−1.78t = \frac{-0.64}{0.36} = -1.78), though not at the 5%5\% level.

Fixed effects estimation requires strict exogeneity (E(uit∣Xi1,…,XiT,αi)=0E(u_{it}|X_{i1}, \dots, X_{iT}, \alpha_i) = 0), i.i.d. draws across entities, finite fourth moments, and no perfect multicollinearity. Furthermore, because errors within the same entity over time are typically autocorrelated, standard errors must be computed using Heteroskedasticity- and Autocorrelation-Consistent (HAC) estimators clustered at the entity level to prevent severe underestimation of sampling uncertainty.