Introduction to Econometrics
Chapter 1 : The algebra of least squares with one explanatory variable
By Lund University
This chapter introduces the least squares method which is used to fit a straight line through a scatter plot. This chapter focuses on the algebra of least squares. There is no probability theory or statistics in this chapter. The chapter begins with sample moments, goes through and derives the OLS formula. Important concepts introduced in this chapter: Trendline, residuals, fitted values and R-squared. In addition to Excel, we will also introduce EViews in this chapter and look at how to find trendlines using Excel and EViews.
Sample moments:
The first thing we will look at in this course is sample moments. We begin with concepts such as population, sample and random sample. First, we look at moments from a single varibale: sample mean, sample variance and sample standard deviation. We then look at sample moments from two variables: sample covariance and sample correlation. This section is heavily dependent of sums and you practice working working sums mathematically as well as in Excel.
Sample moments
Introduction to Eviews:
A brief introduction to EViews using both the menu system and commands. Introduces series and groups, sample moments, graphs and important commands.
Introduction to Eviews
Introduction to commands in Eviews
Ordinary least squares
This section introduces the OLS formula, the formula we use to find a straight trend line through a scatter plot. In this section, the formula is presented without any derivation. We will also look at how to find trend lines in EViews and Excel. Once we have our scatter plot and trendline, we can define residuals and fitted values. Using the residuals, we can introduce the least squares principle, the principle behind the OLS formula. Finally, we look at the special case when the intercept of our trend line is zero ("no intercept").
The OLS formula
Introduction to equations in Eviews
Residuals and fitted values
The least squares principle
Trendline with no intercept
Deriving the OLS formula
This section presents the least squares principle mathematically as a minimization problem in two variables (intercept and slope). We will solve this problem analytically which will result in the OLS formula. Based on the first order condition from the optimization problem, we can derive several important OLS results.
Deriving the OLS formula
Global minimum of RSS
Some OLS results
Measure of fit
Residuals and fit in Eviews
Measures of fit
In some cases, our trendline will fit our data well and in some cases it will not. In order to derive a measure of fit, we begin by identify an important result: the total variation in the data will be equal to the variation that we can explain (with the trend line) and variation that we cannot explain. From this, we define the measure of fit, R-squared, as the proportion of the total variation that we can explain.