04.ECTRIE SLRM

📚 04.ECTRIE_SLRM (2).pdf

Brief overview

This document introduces the fundamental concepts of linear regression analysis. It details the Ordinary Least Squares (OLS) method for estimating model coefficients and explores measures of goodness of fit, laying the groundwork for statistical inference.

Key points

  • Introduction to the basic linear regression model and its components.
  • Detailed explanation of the Ordinary Least Squares (OLS) method for estimating coefficients.
  • Assessment of model quality using R-squared and the Standard Error of the Regression.
  • Exploration of fundamental assumptions for OLS and the sampling distribution of estimators.
  • Application of large-sample approximations, including the Law of Large Numbers and Central Limit Theorem.

1. Introduction to the linear regression model

The linear regression model helps estimate the impact of one variable on another. It aims to find the slope of the population regression line.

This slope shows the expected change in the dependent variable (YiY_i) for a one-unit increase in the independent variable (XiX_i). The model can be extended to include an error term to account for other influencing factors 4 6.

1.1 The linear regression model

The basic linear regression model with a single regressor is written as: Yi=β0+β1Xi+uiY_i = \beta_0 + \beta_1X_i + u_i

Where:

  • YiY_i: the dependent variable.
  • XiX_i: the independent variable.
  • β0\beta_0: the intercept of the population regression line.
  • β1\beta_1: the slope of the population regression line.
  • uiu_i: the error term, representing other factors.

The population regression line describes the average relationship between YY and XX across the entire population 7.

The model can be visualized with a scatterplot of observations, the population regression line, and the regression errors. The slope coefficient (β1\beta_1) indicates the change in YY for a unit change in XX 8.

This scatterplot visualizes hypothetical data showing the relationship between student-teacher ratio and test scores, with a regression line indicating the average trend.

1.2 Estimating regression coefficients

Estimating the coefficients (β0\beta_0 and β1\beta_1) involves finding the line that best fits the data. This is typically done using the Ordinary Least Squares (OLS) method.

OLS minimizes the sum of the squared differences between the observed values and the values predicted by the regression line.

The objective is to minimize: ∑i=1n(Yi−Y^i)2=∑i=1n[Yi−(b0+b1Xi)]2\sum_{i=1}^{n} (Y_i - \hat{Y}_i)^2 = \sum_{i=1}^{n} [Y_i - (b_0 + b_1X_i)]^2

This minimization problem leads to specific formulas for the OLS estimators 11.

1.2.1 Derivation of OLS estimators

The OLS estimators, denoted as β^0\hat{\beta}_0 and β^1\hat{\beta}_1, are derived by setting the partial derivatives of the sum of squared errors with respect to b0b_0 and b1b_1 to zero. This yields a system of equations that can be solved for β^0\hat{\beta}_0 and β^1\hat{\beta}_1 12.

The derivation leads to the formula for the slope estimator: β^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}

Mathematical derivation of the OLS estimator for the slope coefficient b1.

The intercept estimator is then derived from the estimated slope and the sample means: β^0=Yˉ−β^1Xˉ\hat{\beta}_0 = \bar{Y} - \hat{\beta}_1\bar{X} 14.

The formulas for the OLS estimators are:

CoefficientFormula
Slopeβ^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}
Interceptβ^0=Yˉ−β^1Xˉ\hat{\beta}_0 = \bar{Y} - \hat{\beta}_1\bar{X}

15

1.2.2 OLS notation and concepts

Key notations in OLS estimation include:

  • β^0\hat{\beta}_0, β^1\hat{\beta}_1: The estimated population coefficients.
  • Y^i=β^0+β^1Xi\hat{Y}_i = \hat{\beta}_0 + \hat{\beta}_1X_i: The predicted value of YiY_i from the sample regression line.
  • u^i=Yi−Y^i\hat{u}_i = Y_i - \hat{Y}_i: The residual for the ii-th observation, which is the sample counterpart of the population error uiu_i.

1.3 Application: California test scores

The California test score data set provides an example to illustrate OLS. It includes test scores and student-teacher ratios (STR) for school districts 19.

The relationship between test scores and the student-teacher ratio is often negative. A lower student-teacher ratio (more teachers per student) is typically associated with higher test scores 20 21.

This scatterplot visualizes the relationship between student-teacher ratio and test scores for California school districts.

This scatter plot visualizes the relationship between student-teacher ratio and test scores, showing a negative correlation.

An example regression output for California school districts shows an estimated relationship: TestScore^i=698.9−2.28×STRi\widehat{\text{TestScore}}_i = 698.9 - 2.28 \times \text{STR}_i

This suggests that for every one-student increase in the student-teacher ratio, the average test score is predicted to decrease by 2.28 points 22.

This diagram shows the output of a linear regression analysis, including coefficients, standard errors, t-statistics, p-values, and confidence intervals.

🔑 Important: OLS is the standard method for estimating linear regression coefficients, aiming to minimize the sum of squared prediction errors. Understanding the derivation and interpretation of coefficients is crucial for econometric analysis 10 17.

2. Goodness of fit measures (part 1)

2.1 Measuring how well the regression line fits the data

Two statistics assess how well a regression line explains the data. The regression R-squared (R2) measures the proportion of variance in the dependent variable that is explained by the independent variable.

It ranges from zero (no explanation) to one (perfect explanation). The Standard Error of the Regression (SER) measures the typical distance of observations from the regression line 24.

2.1.1 The R-squared statistic

The R-squared (R2) is the fraction of the total sum of squares (TSS) that is explained by the regression. It is calculated as the explained sum of squares (ESS) divided by the TSS.

Alternatively, it can be calculated as 1 minus the ratio of the residual sum of squares (SSR) to the TSS. For simple linear regression with one predictor, R2 is the square of the correlation coefficient between Y and X 25.

The following table breaks down the components of the R-squared calculation:

ComponentFormulaRepresents
Total Sum of Squares (TSS)∑i=1n(Yi−Yˉ)2\sum_{i=1}^{n}(Y_i - \bar{Y})^2Total variation in Y
Explained Sum of Squares (ESS)∑i=1n(Y^i−Yˉ)2\sum_{i=1}^{n}(\hat{Y}_i - \bar{Y})^2Variation in Y explained by X
Residual Sum of Squares (SSR)∑i=1nu^i2\sum_{i=1}^{n}\hat{u}_i^2Variation in Y not explained by X (error)

R2=ESSTSS=1−SSRTSSR^2 = \frac{ESS}{TSS} = 1 - \frac{SSR}{TSS}

2.1.2 Standard Error of the Regression (SER)

The Standard Error of the Regression (SER) estimates the standard deviation of the regression error, uiu_i. It measures the typical size of the OLS residuals, representing the average "mistake" the regression line makes.

The SER has the same units as the dependent variable (YiY_i), making it more interpretable than R2 for understanding the magnitude of prediction errors.

The formula for the SER is the square root of the residual sum of squares divided by the degrees of freedom (n−2n-2) 28.

The formula for the Standard Error of the Regression (SER) is presented, showing its equivalence to the square root of the sum of squared residuals divided by n-2.

The Root Mean Squared Error (RMSE) is closely related to the SER. The main difference is that RMSE divides the SSR by nn instead of n−2n-2.

For large sample sizes, the difference between SER and RMSE is negligible 29.

The formula for Root Mean Squared Error (RMSE) is presented, which is closely related to the Standard Error of the Regression (SER).

2.1.3 Regression output example

Regression software typically provides both R2 and SER values. For example, in a regression of test scores on student-teacher ratio (STR), the R2 might be low, indicating that STR explains only a small fraction of the variation in test scores 30.

StatisticValue
R-squared0.0497
Prob > F0.0000
Number of obs.421

Low R2 does not necessarily mean the independent variable is unimportant for policy decisions.

2.2 The Least Squares Assumptions (LSA)

To understand the properties of the OLS estimator, like its unbiasedness and variance, we must make assumptions about the data and the relationship between variables. These are called the Least Squares Assumptions (LSA) 32.

2.2.1 The three core assumptions

The LSA for a simple linear regression model (Yi=β0+β1Xi+uiY_i = \beta_0 + \beta_1X_i + u_i) are:

  1. Zero conditional mean of the error term: E(ui∣Xi)=0E(u_i | X_i) = 0. This means that any "other factors" captured in uiu_i are unrelated to XiX_i. This is crucial for β^1\hat{\beta}_1 to be unbiased.
  2. IID sampling: (Xi,Yi)(X_i, Y_i) are independently and identically distributed. This holds when data is collected using simple random sampling from the population.
  3. No large outliers: Large outliers in XiX_i or YiY_i are rare. Technically, this means XiX_i and YiY_i have finite fourth moments. Outliers can disproportionately influence the OLS estimates 33.

LSA #1: E(ui∣Xi)=0E(u_i | X_i) = 0 implies "other factors" are uncorrelated with XiX_i.

2.2.2 Understanding LSA #1: Zero conditional mean

The assumption E(ui∣Xi)=0E(u_i | X_i) = 0 is best understood by considering a randomized controlled experiment. In such an experiment, subjects are randomly assigned to treatment (X=1X=1) or control (X=0X=0).

This random assignment ensures that all other individual characteristics (the error term uiu_i) are distributed independently of XiX_i. Therefore, uiu_i and XiX_i are uncorrelated.

For observational data, we aim for XiX_i to be "as if" randomly assigned, requiring careful consideration of whether this assumption holds 35.

This diagram illustrates the conditional probability distributions and the population regression line for test scores based on the student-teacher ratio.

2.2.3 Understanding LSA #2: IID sampling

The assumption that (Xi,Yi)(X_i, Y_i) are independently and identically distributed (IID) naturally arises from simple random sampling. "Identically distributed" means that each observation comes from the same population distribution.

"Independently distributed" means that the selection of one observation does not affect the selection of another. Violations of this assumption are more common in time series data where observations from the same entity over time are not independent 36.

2.2.4 Understanding LSA #3: No large outliers

The assumption that large outliers are rare is important because extreme values can heavily influence OLS estimates. While technically related to finite fourth moments, the practical implication is that we need to identify and understand extreme data points.

Outliers can arise from data entry errors or represent genuine but unusual observations that may need to be excluded or investigated further. Plotting the data is essential for detecting outliers 37 38.

This scatter plot illustrates the sensitivity of Ordinary Least Squares (OLS) regression to large outliers.

🔑 Important: The three LSA are fundamental for ensuring the OLS estimator has desirable statistical properties like unbiasedness and for deriving its sampling distribution.

2.3 Sampling distribution of the OLS estimator

The OLS estimator (β^1\hat{\beta}_1) is calculated from a specific sample, meaning different samples will produce different estimates. This "sampling uncertainty" necessitates understanding the estimator's sampling distribution.

This involves quantifying this uncertainty, testing hypotheses (e.g., β1=0\beta_1 = 0), and constructing confidence intervals 40.

2.3.1 Framework for the distribution

The three Least Squares Assumptions (LSA) provide the probability framework for linear regression. These assumptions define the population, the relationship between variables, and the sampling method.

They collectively inform us about the behavior of the OLS estimator 41.

2.3.2 Properties of the OLS estimator

Our goal is to determine the mean, variance, and distribution of the OLS estimator β^1\hat{\beta}_1 42.

  • Mean: If E(β^1)=β1E(\hat{\beta}_1) = \beta_1, the OLS estimator is unbiased.
  • Variance: The variance of β^1\hat{\beta}_1 measures its sampling uncertainty.
  • Distribution: In large samples, β^1\hat{\beta}_1 is normally distributed, which is crucial for inference and hypothesis testing.

🔑 Important: The LSA are the bedrock for understanding the statistical properties of OLS estimators, enabling us to make reliable inferences from sample data.

3. Goodness of fit measures (part 2)

3.1 Sampling distribution of OLS estimators

The sampling distribution of an estimator describes how it varies across different samples. For Ordinary Least Squares (OLS) estimators, understanding their mean and variance is crucial.

When the Least Squares Assumptions (LSAs) hold, OLS estimators are unbiased and consistent. This means their expected value equals the true population parameter, and they converge to the true value as the sample size increases.

The derivation of the mean and variance of the β^1\hat{\beta}_1 estimator involves algebraic manipulation of the regression equation. This process relates the estimator to the regressors (XiX_i) and the error terms (uiu_i).

This slide displays a derivation of the mean and variance of the beta-1 estimator in econometrics, showing algebraic steps and formulas.

The expression for β^1−β1\hat{\beta}_1 - \beta_1 highlights its dependence on the sum of products of deviations from the mean of XX and the errors.

β^1−β1=∑i=1n(Xi−Xˉ)(ui−uˉ)∑i=1n(Xi−Xˉ)2\hat{\beta}_1 - \beta_1 = \frac{\sum_{i=1}^{n}(X_i - \bar{X})(u_i - \bar{u})}{\sum_{i=1}^{n}(X_i - \bar{X})^2} 45.

The mean of β^1\hat{\beta}_1 is derived using the law of iterated expectations. Under LSA #1 (zero conditional mean of errors) and LSA #2 (independent and identically distributed errors), the expected value of the error term conditional on the regressors is zero.

This leads to the conclusion that β^1\hat{\beta}_1 is an unbiased estimator of β1\beta_1 46.

The variance of the OLS estimator is also derived through algebraic steps. It involves the variance of the numerator, which depends on the variance of the error terms and the regressors, divided by the square of the variance of the regressors.

This diagram shows the derivation of the mean and variance of the OLS estimator, starting with a formula for beta-hat minus beta. Mathematical derivation of the variance of the OLS estimator, focusing on the denominator term.

3.1.1 Mean and variance properties

The derivation shows that the variance of β^1\hat{\beta}_1 is influenced by two key components: the variance of the error terms (uiu_i) and the variance of the independent variable (XiX_i).

  • Variance of errors (var(ui)\text{var}(u_i)): A larger variance in the error terms leads to a larger variance in the OLS estimator. This means more unpredictable factors affecting YY increase the uncertainty in our estimate of β1\beta_1.
  • Variance of regressors (var(Xi)\text{var}(X_i)): A larger variance in the independent variable generally leads to a smaller variance in the OLS estimator. Wider spread in XX values provides more information for estimating the relationship with YY.

The variance of β^1\hat{\beta}_1 is inversely related to the variance of XiX_i.

The formula for the variance of β^1\hat{\beta}_1 under large-sample assumptions is:

σβ^12=var[(Xi−μX)ui]n[var(Xi)]2\sigma^2_{\hat{\beta}_1} = \frac{\text{var}[(X_i - \mu_X)u_i]}{n[\text{var}(X_i)]^2} 49.

This formula shows that as the sample size (nn) increases, the variance of the estimator decreases. This aligns with the principle that larger samples provide more precise estimates.

This diagram illustrates the sampling distribution of the OLS estimator, showing formulas for the variance of the estimator under large-sample assumptions.

The implication of these properties is that OLS estimators are consistent. This means that as the sample size approaches infinity, the OLS estimator converges in probability to the true population parameter.

This scatter plot illustrates the variance of beta-1 and the variance of X, showing how different variances of X affect the spread of data points.

When the sample size (nn) is large, the sampling distribution of the OLS estimators simplifies due to the Central Limit Theorem (CLT). This allows us to approximate the distribution with a normal distribution, which is essential for hypothesis testing and constructing confidence intervals.

  • Finite sample properties:
  • E(β^1\hat{\beta}_1) = β1\beta_1 (unbiasedness)
  • var(β^1\hat{\beta}_1) = σβ^12\sigma^2_{\hat{\beta}_1}
  • Large sample properties:
  • β^1→pβ1\hat{\beta}_1 \xrightarrow{p} \beta_1 (consistency, Law of Large Numbers)
  • β^1−E(β^1)var(β^1)∼N(0,1)\frac{\hat{\beta}_1 - E(\hat{\beta}_1)}{\sqrt{\text{var}(\hat{\beta}_1)}} \sim N(0,1) (normality, CLT).

Take time to manually derive the mean and variance of OLS estimators. Understanding these steps is key for exam success.

🔑 Important: For large samples, OLS estimators are both unbiased and normally distributed, enabling statistical inference 52.

4. Large-sample approximations and appendix

4.1 Approximating sampling distributions

When dealing with samples, especially large ones, we often rely on approximations for the sampling distributions of estimators. These approximations simplify analysis when exact distributions are complex or unknown.

Two key tools for this are the Law of Large Numbers (LLN) and the Central Limit Theorem (CLT) 55.

4.1.1 The Law of Large Numbers

The Law of Large Numbers states that as the sample size (nn) increases, the sample average (Yˉ\bar{Y}) of independent and identically distributed (IID) random variables gets closer to the true population mean (μY\mu_Y). This means the estimator is consistent.

🔑 Important: Consistency means the probability of the estimator being close to the true value approaches one as nn grows large 56.

4.1.2 The Central Limit Theorem

The Central Limit Theorem is crucial for large-sample approximations. It states that for a large enough sample size (nn), the distribution of the sample average (Yˉ\bar{Y}) is approximately normal.

This holds true even if the original data is not normally distributed.

The theorem focuses on the standardized sample average:

Yˉ−E(Yˉ)var(Yˉ)=Yˉ−μYσY/n∼N(0,1)\frac{\bar{Y} - E(\bar{Y})}{\sqrt{var(\bar{Y})}} = \frac{\bar{Y} - \mu_Y}{\sigma_Y / \sqrt{n}} \sim N(0,1)

Here, σY\sigma_Y is the population standard deviation. This standardized form is approximately a standard normal distribution (N(0,1)N(0,1)).

The figure below illustrates this principle, showing the sampling distribution of the sample average becoming more normal as the sample size increases 60.

This figure illustrates the Central Limit Theorem by showing how the sampling distribution of the sample average approaches a normal distribution as the sample size increases.

🔑 Important: The approximation becomes better as nn gets larger. For n≥100n \ge 100, the normal approximation is generally very good for many types of underlying distributions 58.

The figures on page 57 and 59 show how sampling distributions for Bernoulli random variables converge to a normal shape as sample size increases 57 59.

4.1.3 Properties of Yˉ\bar{Y} in large samples

In large samples, the properties of the sample average (Yˉ\bar{Y}) are well-defined:

PropertyDescription
MeanE(Yˉ)=μYE(\bar{Y}) = \mu_Y (unbiased estimator)
Variancevar(Yˉ)=σY2/nvar(\bar{Y}) = \sigma_Y^2 / n
DistributionApproximately N(μY,σY2/n)N(\mu_Y, \sigma_Y^2 / n) via CLT
ConsistencyYˉ→pμY\bar{Y} \xrightarrow{p} \mu_Y via LLN

🔑 Important: The core takeaway is that for large samples, the sample average is a good estimator of the population mean, and its distribution is predictable (normal) 61.

© 2026 Maeve. All rights reserved. This content is protected by copyright.

See also