SlideShare a Scribd company logo
1 of 12
Ordinary Least Squares
Estimation
Simon Woodcock
From Last Day
 Recall our population regression function:
 Because the coefficients (β) and the errors (εi) are population quantities, we
don’t observe them.
 Sometimes our primary interest is the coefficients themselves
 βk measures the marginal effect of variable Xki on the dependent variable Yi.
 Sometimes we’re more interested in predicting Yi.
 if we have sample estimates of the coefficients, we can calculate predicted
values:
 In either case, we need a way to estimate the unknown β’s.
 That is, we need a way to compute from a sample of data
 It turns out there are lots of ways to estimate the β’s (compute ).
 By far the most common method is called ordinary least squares (OLS).
i
ki
k
i
i
i
i X
X
X
X
Y 




 





 
3
3
2
2
1
1
0
ki
k
i
i
i X
X
X
Y 


 ˆ
ˆ
ˆ
ˆ
ˆ
2
2
1
1
0 



 
s
'
ˆ

s
'
ˆ

What OLS does
 Recall that we can write:
where ei are the residuals.
 these are the sample counterpart to the population errors εi
 they measure how far our predicted values ( ) are from the true Yi
 think of them as prediction mistakes
 We want to estimate the β’s in a way that makes the residuals as small as
possible.
 we want the predicted values as close to the truth as possible
 OLS minimizes the sum of squared residuals:
i
i
i
ki
k
i
i
i
ki
k
i
i
i
e
Y
e
X
X
X
X
X
X
Y














ˆ
ˆ
ˆ
ˆ
ˆ
2
2
1
1
0
2
2
1
1
0











i
Y
ˆ
 
 
 


n
i
n
i
i
i
i Y
Y
e
1 1
2
2 ˆ
minimizes
OLS
Why OLS?
 OLS is “easy”
 computers do it routinely
 if you had to do OLS by hand, you could
 Minimizing squared residuals is better than just minimizing
residuals:
 we could minimize the sum (or average) of residuals, but the
positive and negative residuals would cancel out – and we might
end up with really bad predicted values (huge positive and negative
“mistakes” that cancel out – draw a picture)
 squaring penalizes “big” mistakes (big ei) more than “little”
mistakes (small ei)
 by minimizing the sum of squared residuals, we get a zero average
residual (mistake) as a bonus
 OLS estimates are unbiased, and are most efficient in the class of
(linear) unbiased estimators (more about this later).
How OLS works
 Suppose we have a linear regression model with one independent
variable:
 The OLS estimates of β0 and β1 are the values that minimize:
 you all know how to solve for the OLS estimates. We just differentiate this
expression with respect to β0 and β1, set the derivatives equal to zero, and
solve.
 The solutions to this minimization problem are (look familiar?):
i
i
i X
Y 

 

 1
0
   

  
 





n
i
i
i
n
i
n
i
i
i
i X
Y
Y
Y
e
1
2
1
0
1 1
2
2 ˆ
ˆ
ˆ 

  
 
X
Y
β
X
X
Y
Y
X
X
n
i
i
n
i
i
i
1
0
1
2
1
1
ˆ
ˆ
and
ˆ 
 









OLS in practice
 Knowing the summation formulas for OLS
estimates is useful for understanding how OLS
estimation works.
 once we add more than one independent variable,
these summation formulas become cumbersome
 In practice, we never do least squares calculations
by hand (that’s what computers are for)
 In fact, doing least squares regression in
EViews is a piece of cake – time for an
example.
An example
 Suppose we are interested in how an NHL hockey player’s salary varies
with the number of points they score.
 it’s natural to think variation in salary is related to variation in points scored
 our dependent variable (Yi) will be SALARY_USD
 our independent variable (Xi) will be POINTS
 After opening the EViews workfile, there are two ways to set up the
equation:
1. select SALARY_USD and then POINTS (the order is important), then
right-click one of the selected objects, and OPEN -> AS EQUATION
or
2. QUICK -> ESTIMATE EQUATION and then in the EQUATION
SPECIFICATION dialog box, type:
salary_usd points c
(the first variable in the list is the dependent variable, the remaining
variables are the independent variables including the intercept c)
 You’ll see a drop down box for the estimation METHOD, and notice that
least squares (LS) is the default. Click OK.
 It’s as easy as that. Your results should look like the next slide ...
Estimation Results
What the results mean
 The column labeled “Coefficient” gives the least squares estimates of the
regression coefficients.
 So our estimated model is:
USD_SALARY = 335602 + (41801.42)*POINTS
 That is, players who scored zero points earned $335,602 on average
 For each point scored, players were paid an additional $41,801 on average
 So the “average” 100-point player was paid $4,515,702
 The column labeled “Std. Error” gives the standard error (square root of the
sampling variance) of the regression coefficients
 the OLS estimates are functions of the sample data, and hence are RVs – more
on their sampling distribution later
 The column labeled “t-Statistic” is a test statistic for the null hypothesis that
the corresponding regression coefficient is zero (more about this later)
 The column labeled “Prob.” is the p-value associated with this test
 Ignore the rest for now
 Now let’s see if anything changes when we add a player’s age & years of
NHL experience to our model
Another Example
What’s Changed: The Intercept
 You’ll notice that the estimated coefficient on POINTS and the intercept
have changed.
 This is because they now measure different things.
 In our original model (without AGE and YEARS_EXP among the
independent variables), the intercept (c) measured the average
USD_SALARY when POINTS was zero ($335,602)
 That is, the intercept estimated E(USD_SALARY | POINTS=0)
 This quantity puts no restriction on the value of AGE and YEARS_EXP
 In the new model (including AGE and YEARS_EXP among the
independent variables), the intercept measures the average
USD_SALARY when POINTS, AGE, and YEARS_EXP are all zero
($419,897.8)
 That is, the new intercept estimates
E(USD_SALARY | POINTS = 0, AGE = 0, YEARS_EXP = 0)
What’s Changed: The Slope
 In our original model (excluding AGE and YEARS_EXP), the coefficient
on POINTS was an estimate of the marginal effect of POINTS on
USD_SALARY, i.e.,
 This quantity puts no restriction on the values of AGE and YEARS_EXP
(implicitly, we are allowing them to vary along with POINTS) – it’s a total
derivative
 In the new model (which includes AGE and YEARS_EXP), the coefficient
on POINTS measures the marginal effect of POINTS on USD_SALARY
holding AGE and YEARS_EXP constant, i.e.,
 That is, it’s a partial derivative
 The point: what your estimated regression coefficients measure
depends on what is (and isn’t) in your model!
42
41801
(POINTS)
Y)
(USD_SALAR
.
d
d

37
.
36603
(POINTS)
Y)
(USD_SALAR




More Related Content

Similar to Ordinary Least Squares Ordinary Least Squares

Two-Variable (Bivariate) RegressionIn the last unit, we covered
Two-Variable (Bivariate) RegressionIn the last unit, we covered Two-Variable (Bivariate) RegressionIn the last unit, we covered
Two-Variable (Bivariate) RegressionIn the last unit, we covered LacieKlineeb
 
simple-linear-regression (1).pptx
simple-linear-regression (1).pptxsimple-linear-regression (1).pptx
simple-linear-regression (1).pptxShrutiGupta3922
 
DBM380 v14Create a DatabaseDBM380 v14Page 2 of 2Create a D.docx
DBM380 v14Create a DatabaseDBM380 v14Page 2 of 2Create a D.docxDBM380 v14Create a DatabaseDBM380 v14Page 2 of 2Create a D.docx
DBM380 v14Create a DatabaseDBM380 v14Page 2 of 2Create a D.docxedwardmarivel
 
30237--KK30237--KK EMBED Equa.docx
30237--KK30237--KK EMBED Equa.docx30237--KK30237--KK EMBED Equa.docx
30237--KK30237--KK EMBED Equa.docxgilbertkpeters11344
 
Linear logisticregression
Linear logisticregressionLinear logisticregression
Linear logisticregressionkongara
 
Regression Analysis presentation by Al Arizmendez and Cathryn Lottier
Regression Analysis presentation by Al Arizmendez and Cathryn LottierRegression Analysis presentation by Al Arizmendez and Cathryn Lottier
Regression Analysis presentation by Al Arizmendez and Cathryn LottierAl Arizmendez
 
A General Manger of Harley-Davidson has to decide on the size of a.docx
A General Manger of Harley-Davidson has to decide on the size of a.docxA General Manger of Harley-Davidson has to decide on the size of a.docx
A General Manger of Harley-Davidson has to decide on the size of a.docxevonnehoggarth79783
 
Data AnalysisInstructions of Excel 2016By Yancy Chow.docx
Data AnalysisInstructions of Excel 2016By Yancy Chow.docxData AnalysisInstructions of Excel 2016By Yancy Chow.docx
Data AnalysisInstructions of Excel 2016By Yancy Chow.docxwhittemorelucilla
 
Quantitative Analysis Homework Help
Quantitative Analysis Homework HelpQuantitative Analysis Homework Help
Quantitative Analysis Homework HelpExcel Homework Help
 
Classification methods and assessment
Classification methods and assessmentClassification methods and assessment
Classification methods and assessmentLeonardo Auslender
 
Graph variables.ppt
Graph variables.pptGraph variables.ppt
Graph variables.pptandrew636973
 
Graph variables.ppt
Graph variables.pptGraph variables.ppt
Graph variables.pptSADAF53170
 
SAMPLING MEAN DEFINITION The term sampling mean .docx
SAMPLING MEAN DEFINITION The term sampling mean .docxSAMPLING MEAN DEFINITION The term sampling mean .docx
SAMPLING MEAN DEFINITION The term sampling mean .docxanhlodge
 

Similar to Ordinary Least Squares Ordinary Least Squares (20)

Two-Variable (Bivariate) RegressionIn the last unit, we covered
Two-Variable (Bivariate) RegressionIn the last unit, we covered Two-Variable (Bivariate) RegressionIn the last unit, we covered
Two-Variable (Bivariate) RegressionIn the last unit, we covered
 
Chapter 14 Part I
Chapter 14 Part IChapter 14 Part I
Chapter 14 Part I
 
Chapter 10
Chapter 10Chapter 10
Chapter 10
 
simple-linear-regression (1).pptx
simple-linear-regression (1).pptxsimple-linear-regression (1).pptx
simple-linear-regression (1).pptx
 
DBM380 v14Create a DatabaseDBM380 v14Page 2 of 2Create a D.docx
DBM380 v14Create a DatabaseDBM380 v14Page 2 of 2Create a D.docxDBM380 v14Create a DatabaseDBM380 v14Page 2 of 2Create a D.docx
DBM380 v14Create a DatabaseDBM380 v14Page 2 of 2Create a D.docx
 
Powerpoint2.reg
Powerpoint2.regPowerpoint2.reg
Powerpoint2.reg
 
Lecture 4
Lecture 4Lecture 4
Lecture 4
 
30237--KK30237--KK EMBED Equa.docx
30237--KK30237--KK EMBED Equa.docx30237--KK30237--KK EMBED Equa.docx
30237--KK30237--KK EMBED Equa.docx
 
Regressionanalysis
RegressionanalysisRegressionanalysis
Regressionanalysis
 
Linear logisticregression
Linear logisticregressionLinear logisticregression
Linear logisticregression
 
Regression Analysis presentation by Al Arizmendez and Cathryn Lottier
Regression Analysis presentation by Al Arizmendez and Cathryn LottierRegression Analysis presentation by Al Arizmendez and Cathryn Lottier
Regression Analysis presentation by Al Arizmendez and Cathryn Lottier
 
A General Manger of Harley-Davidson has to decide on the size of a.docx
A General Manger of Harley-Davidson has to decide on the size of a.docxA General Manger of Harley-Davidson has to decide on the size of a.docx
A General Manger of Harley-Davidson has to decide on the size of a.docx
 
Data AnalysisInstructions of Excel 2016By Yancy Chow.docx
Data AnalysisInstructions of Excel 2016By Yancy Chow.docxData AnalysisInstructions of Excel 2016By Yancy Chow.docx
Data AnalysisInstructions of Excel 2016By Yancy Chow.docx
 
Quantitative Analysis Homework Help
Quantitative Analysis Homework HelpQuantitative Analysis Homework Help
Quantitative Analysis Homework Help
 
Classification methods and assessment
Classification methods and assessmentClassification methods and assessment
Classification methods and assessment
 
Graph variables.ppt
Graph variables.pptGraph variables.ppt
Graph variables.ppt
 
Graph variables.ppt
Graph variables.pptGraph variables.ppt
Graph variables.ppt
 
Graph variables.ppt
Graph variables.pptGraph variables.ppt
Graph variables.ppt
 
Bus 173_6.pptx
Bus 173_6.pptxBus 173_6.pptx
Bus 173_6.pptx
 
SAMPLING MEAN DEFINITION The term sampling mean .docx
SAMPLING MEAN DEFINITION The term sampling mean .docxSAMPLING MEAN DEFINITION The term sampling mean .docx
SAMPLING MEAN DEFINITION The term sampling mean .docx
 

Recently uploaded

Russian Call Girls In Gtb Nagar (Delhi) 9711199012 💋✔💕😘 Naughty Call Girls Se...
Russian Call Girls In Gtb Nagar (Delhi) 9711199012 💋✔💕😘 Naughty Call Girls Se...Russian Call Girls In Gtb Nagar (Delhi) 9711199012 💋✔💕😘 Naughty Call Girls Se...
Russian Call Girls In Gtb Nagar (Delhi) 9711199012 💋✔💕😘 Naughty Call Girls Se...shivangimorya083
 
VIP Kolkata Call Girl Serampore 👉 8250192130 Available With Room
VIP Kolkata Call Girl Serampore 👉 8250192130  Available With RoomVIP Kolkata Call Girl Serampore 👉 8250192130  Available With Room
VIP Kolkata Call Girl Serampore 👉 8250192130 Available With Roomdivyansh0kumar0
 
Instant Issue Debit Cards - High School Spirit
Instant Issue Debit Cards - High School SpiritInstant Issue Debit Cards - High School Spirit
Instant Issue Debit Cards - High School Spiritegoetzinger
 
Dharavi Russian callg Girls, { 09892124323 } || Call Girl In Mumbai ...
Dharavi Russian callg Girls, { 09892124323 } || Call Girl In Mumbai ...Dharavi Russian callg Girls, { 09892124323 } || Call Girl In Mumbai ...
Dharavi Russian callg Girls, { 09892124323 } || Call Girl In Mumbai ...Pooja Nehwal
 
Malad Call Girl in Services 9892124323 | ₹,4500 With Room Free Delivery
Malad Call Girl in Services  9892124323 | ₹,4500 With Room Free DeliveryMalad Call Girl in Services  9892124323 | ₹,4500 With Room Free Delivery
Malad Call Girl in Services 9892124323 | ₹,4500 With Room Free DeliveryPooja Nehwal
 
Solution Manual for Principles of Corporate Finance 14th Edition by Richard B...
Solution Manual for Principles of Corporate Finance 14th Edition by Richard B...Solution Manual for Principles of Corporate Finance 14th Edition by Richard B...
Solution Manual for Principles of Corporate Finance 14th Edition by Richard B...ssifa0344
 
The Economic History of the U.S. Lecture 17.pdf
The Economic History of the U.S. Lecture 17.pdfThe Economic History of the U.S. Lecture 17.pdf
The Economic History of the U.S. Lecture 17.pdfGale Pooley
 
Solution Manual for Financial Accounting, 11th Edition by Robert Libby, Patri...
Solution Manual for Financial Accounting, 11th Edition by Robert Libby, Patri...Solution Manual for Financial Accounting, 11th Edition by Robert Libby, Patri...
Solution Manual for Financial Accounting, 11th Edition by Robert Libby, Patri...ssifa0344
 
Andheri Call Girls In 9825968104 Mumbai Hot Models
Andheri Call Girls In 9825968104 Mumbai Hot ModelsAndheri Call Girls In 9825968104 Mumbai Hot Models
Andheri Call Girls In 9825968104 Mumbai Hot Modelshematsharma006
 
02_Fabio Colombo_Accenture_MeetupDora&Cybersecurity.pptx
02_Fabio Colombo_Accenture_MeetupDora&Cybersecurity.pptx02_Fabio Colombo_Accenture_MeetupDora&Cybersecurity.pptx
02_Fabio Colombo_Accenture_MeetupDora&Cybersecurity.pptxFinTech Belgium
 
The Economic History of the U.S. Lecture 20.pdf
The Economic History of the U.S. Lecture 20.pdfThe Economic History of the U.S. Lecture 20.pdf
The Economic History of the U.S. Lecture 20.pdfGale Pooley
 
Pooja 9892124323 : Call Girl in Juhu Escorts Service Free Home Delivery
Pooja 9892124323 : Call Girl in Juhu Escorts Service Free Home DeliveryPooja 9892124323 : Call Girl in Juhu Escorts Service Free Home Delivery
Pooja 9892124323 : Call Girl in Juhu Escorts Service Free Home DeliveryPooja Nehwal
 
TEST BANK For Corporate Finance, 13th Edition By Stephen Ross, Randolph Weste...
TEST BANK For Corporate Finance, 13th Edition By Stephen Ross, Randolph Weste...TEST BANK For Corporate Finance, 13th Edition By Stephen Ross, Randolph Weste...
TEST BANK For Corporate Finance, 13th Edition By Stephen Ross, Randolph Weste...ssifa0344
 
03_Emmanuel Ndiaye_Degroof Petercam.pptx
03_Emmanuel Ndiaye_Degroof Petercam.pptx03_Emmanuel Ndiaye_Degroof Petercam.pptx
03_Emmanuel Ndiaye_Degroof Petercam.pptxFinTech Belgium
 
The Economic History of the U.S. Lecture 30.pdf
The Economic History of the U.S. Lecture 30.pdfThe Economic History of the U.S. Lecture 30.pdf
The Economic History of the U.S. Lecture 30.pdfGale Pooley
 
Q3 2024 Earnings Conference Call and Webcast Slides
Q3 2024 Earnings Conference Call and Webcast SlidesQ3 2024 Earnings Conference Call and Webcast Slides
Q3 2024 Earnings Conference Call and Webcast SlidesMarketing847413
 
20240429 Calibre April 2024 Investor Presentation.pdf
20240429 Calibre April 2024 Investor Presentation.pdf20240429 Calibre April 2024 Investor Presentation.pdf
20240429 Calibre April 2024 Investor Presentation.pdfAdnet Communications
 
The Economic History of the U.S. Lecture 18.pdf
The Economic History of the U.S. Lecture 18.pdfThe Economic History of the U.S. Lecture 18.pdf
The Economic History of the U.S. Lecture 18.pdfGale Pooley
 
(ANIKA) Budhwar Peth Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANIKA) Budhwar Peth Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANIKA) Budhwar Peth Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANIKA) Budhwar Peth Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 

Recently uploaded (20)

Russian Call Girls In Gtb Nagar (Delhi) 9711199012 💋✔💕😘 Naughty Call Girls Se...
Russian Call Girls In Gtb Nagar (Delhi) 9711199012 💋✔💕😘 Naughty Call Girls Se...Russian Call Girls In Gtb Nagar (Delhi) 9711199012 💋✔💕😘 Naughty Call Girls Se...
Russian Call Girls In Gtb Nagar (Delhi) 9711199012 💋✔💕😘 Naughty Call Girls Se...
 
VIP Kolkata Call Girl Serampore 👉 8250192130 Available With Room
VIP Kolkata Call Girl Serampore 👉 8250192130  Available With RoomVIP Kolkata Call Girl Serampore 👉 8250192130  Available With Room
VIP Kolkata Call Girl Serampore 👉 8250192130 Available With Room
 
Instant Issue Debit Cards - High School Spirit
Instant Issue Debit Cards - High School SpiritInstant Issue Debit Cards - High School Spirit
Instant Issue Debit Cards - High School Spirit
 
Dharavi Russian callg Girls, { 09892124323 } || Call Girl In Mumbai ...
Dharavi Russian callg Girls, { 09892124323 } || Call Girl In Mumbai ...Dharavi Russian callg Girls, { 09892124323 } || Call Girl In Mumbai ...
Dharavi Russian callg Girls, { 09892124323 } || Call Girl In Mumbai ...
 
Malad Call Girl in Services 9892124323 | ₹,4500 With Room Free Delivery
Malad Call Girl in Services  9892124323 | ₹,4500 With Room Free DeliveryMalad Call Girl in Services  9892124323 | ₹,4500 With Room Free Delivery
Malad Call Girl in Services 9892124323 | ₹,4500 With Room Free Delivery
 
Solution Manual for Principles of Corporate Finance 14th Edition by Richard B...
Solution Manual for Principles of Corporate Finance 14th Edition by Richard B...Solution Manual for Principles of Corporate Finance 14th Edition by Richard B...
Solution Manual for Principles of Corporate Finance 14th Edition by Richard B...
 
The Economic History of the U.S. Lecture 17.pdf
The Economic History of the U.S. Lecture 17.pdfThe Economic History of the U.S. Lecture 17.pdf
The Economic History of the U.S. Lecture 17.pdf
 
Solution Manual for Financial Accounting, 11th Edition by Robert Libby, Patri...
Solution Manual for Financial Accounting, 11th Edition by Robert Libby, Patri...Solution Manual for Financial Accounting, 11th Edition by Robert Libby, Patri...
Solution Manual for Financial Accounting, 11th Edition by Robert Libby, Patri...
 
Veritas Interim Report 1 January–31 March 2024
Veritas Interim Report 1 January–31 March 2024Veritas Interim Report 1 January–31 March 2024
Veritas Interim Report 1 January–31 March 2024
 
Andheri Call Girls In 9825968104 Mumbai Hot Models
Andheri Call Girls In 9825968104 Mumbai Hot ModelsAndheri Call Girls In 9825968104 Mumbai Hot Models
Andheri Call Girls In 9825968104 Mumbai Hot Models
 
02_Fabio Colombo_Accenture_MeetupDora&Cybersecurity.pptx
02_Fabio Colombo_Accenture_MeetupDora&Cybersecurity.pptx02_Fabio Colombo_Accenture_MeetupDora&Cybersecurity.pptx
02_Fabio Colombo_Accenture_MeetupDora&Cybersecurity.pptx
 
The Economic History of the U.S. Lecture 20.pdf
The Economic History of the U.S. Lecture 20.pdfThe Economic History of the U.S. Lecture 20.pdf
The Economic History of the U.S. Lecture 20.pdf
 
Pooja 9892124323 : Call Girl in Juhu Escorts Service Free Home Delivery
Pooja 9892124323 : Call Girl in Juhu Escorts Service Free Home DeliveryPooja 9892124323 : Call Girl in Juhu Escorts Service Free Home Delivery
Pooja 9892124323 : Call Girl in Juhu Escorts Service Free Home Delivery
 
TEST BANK For Corporate Finance, 13th Edition By Stephen Ross, Randolph Weste...
TEST BANK For Corporate Finance, 13th Edition By Stephen Ross, Randolph Weste...TEST BANK For Corporate Finance, 13th Edition By Stephen Ross, Randolph Weste...
TEST BANK For Corporate Finance, 13th Edition By Stephen Ross, Randolph Weste...
 
03_Emmanuel Ndiaye_Degroof Petercam.pptx
03_Emmanuel Ndiaye_Degroof Petercam.pptx03_Emmanuel Ndiaye_Degroof Petercam.pptx
03_Emmanuel Ndiaye_Degroof Petercam.pptx
 
The Economic History of the U.S. Lecture 30.pdf
The Economic History of the U.S. Lecture 30.pdfThe Economic History of the U.S. Lecture 30.pdf
The Economic History of the U.S. Lecture 30.pdf
 
Q3 2024 Earnings Conference Call and Webcast Slides
Q3 2024 Earnings Conference Call and Webcast SlidesQ3 2024 Earnings Conference Call and Webcast Slides
Q3 2024 Earnings Conference Call and Webcast Slides
 
20240429 Calibre April 2024 Investor Presentation.pdf
20240429 Calibre April 2024 Investor Presentation.pdf20240429 Calibre April 2024 Investor Presentation.pdf
20240429 Calibre April 2024 Investor Presentation.pdf
 
The Economic History of the U.S. Lecture 18.pdf
The Economic History of the U.S. Lecture 18.pdfThe Economic History of the U.S. Lecture 18.pdf
The Economic History of the U.S. Lecture 18.pdf
 
(ANIKA) Budhwar Peth Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANIKA) Budhwar Peth Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANIKA) Budhwar Peth Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANIKA) Budhwar Peth Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 

Ordinary Least Squares Ordinary Least Squares

  • 2. From Last Day  Recall our population regression function:  Because the coefficients (β) and the errors (εi) are population quantities, we don’t observe them.  Sometimes our primary interest is the coefficients themselves  βk measures the marginal effect of variable Xki on the dependent variable Yi.  Sometimes we’re more interested in predicting Yi.  if we have sample estimates of the coefficients, we can calculate predicted values:  In either case, we need a way to estimate the unknown β’s.  That is, we need a way to compute from a sample of data  It turns out there are lots of ways to estimate the β’s (compute ).  By far the most common method is called ordinary least squares (OLS). i ki k i i i i X X X X Y               3 3 2 2 1 1 0 ki k i i i X X X Y     ˆ ˆ ˆ ˆ ˆ 2 2 1 1 0       s ' ˆ  s ' ˆ 
  • 3. What OLS does  Recall that we can write: where ei are the residuals.  these are the sample counterpart to the population errors εi  they measure how far our predicted values ( ) are from the true Yi  think of them as prediction mistakes  We want to estimate the β’s in a way that makes the residuals as small as possible.  we want the predicted values as close to the truth as possible  OLS minimizes the sum of squared residuals: i i i ki k i i i ki k i i i e Y e X X X X X X Y               ˆ ˆ ˆ ˆ ˆ 2 2 1 1 0 2 2 1 1 0            i Y ˆ         n i n i i i i Y Y e 1 1 2 2 ˆ minimizes OLS
  • 4. Why OLS?  OLS is “easy”  computers do it routinely  if you had to do OLS by hand, you could  Minimizing squared residuals is better than just minimizing residuals:  we could minimize the sum (or average) of residuals, but the positive and negative residuals would cancel out – and we might end up with really bad predicted values (huge positive and negative “mistakes” that cancel out – draw a picture)  squaring penalizes “big” mistakes (big ei) more than “little” mistakes (small ei)  by minimizing the sum of squared residuals, we get a zero average residual (mistake) as a bonus  OLS estimates are unbiased, and are most efficient in the class of (linear) unbiased estimators (more about this later).
  • 5. How OLS works  Suppose we have a linear regression model with one independent variable:  The OLS estimates of β0 and β1 are the values that minimize:  you all know how to solve for the OLS estimates. We just differentiate this expression with respect to β0 and β1, set the derivatives equal to zero, and solve.  The solutions to this minimization problem are (look familiar?): i i i X Y       1 0                n i i i n i n i i i i X Y Y Y e 1 2 1 0 1 1 2 2 ˆ ˆ ˆ        X Y β X X Y Y X X n i i n i i i 1 0 1 2 1 1 ˆ ˆ and ˆ            
  • 6. OLS in practice  Knowing the summation formulas for OLS estimates is useful for understanding how OLS estimation works.  once we add more than one independent variable, these summation formulas become cumbersome  In practice, we never do least squares calculations by hand (that’s what computers are for)  In fact, doing least squares regression in EViews is a piece of cake – time for an example.
  • 7. An example  Suppose we are interested in how an NHL hockey player’s salary varies with the number of points they score.  it’s natural to think variation in salary is related to variation in points scored  our dependent variable (Yi) will be SALARY_USD  our independent variable (Xi) will be POINTS  After opening the EViews workfile, there are two ways to set up the equation: 1. select SALARY_USD and then POINTS (the order is important), then right-click one of the selected objects, and OPEN -> AS EQUATION or 2. QUICK -> ESTIMATE EQUATION and then in the EQUATION SPECIFICATION dialog box, type: salary_usd points c (the first variable in the list is the dependent variable, the remaining variables are the independent variables including the intercept c)  You’ll see a drop down box for the estimation METHOD, and notice that least squares (LS) is the default. Click OK.  It’s as easy as that. Your results should look like the next slide ...
  • 9. What the results mean  The column labeled “Coefficient” gives the least squares estimates of the regression coefficients.  So our estimated model is: USD_SALARY = 335602 + (41801.42)*POINTS  That is, players who scored zero points earned $335,602 on average  For each point scored, players were paid an additional $41,801 on average  So the “average” 100-point player was paid $4,515,702  The column labeled “Std. Error” gives the standard error (square root of the sampling variance) of the regression coefficients  the OLS estimates are functions of the sample data, and hence are RVs – more on their sampling distribution later  The column labeled “t-Statistic” is a test statistic for the null hypothesis that the corresponding regression coefficient is zero (more about this later)  The column labeled “Prob.” is the p-value associated with this test  Ignore the rest for now  Now let’s see if anything changes when we add a player’s age & years of NHL experience to our model
  • 11. What’s Changed: The Intercept  You’ll notice that the estimated coefficient on POINTS and the intercept have changed.  This is because they now measure different things.  In our original model (without AGE and YEARS_EXP among the independent variables), the intercept (c) measured the average USD_SALARY when POINTS was zero ($335,602)  That is, the intercept estimated E(USD_SALARY | POINTS=0)  This quantity puts no restriction on the value of AGE and YEARS_EXP  In the new model (including AGE and YEARS_EXP among the independent variables), the intercept measures the average USD_SALARY when POINTS, AGE, and YEARS_EXP are all zero ($419,897.8)  That is, the new intercept estimates E(USD_SALARY | POINTS = 0, AGE = 0, YEARS_EXP = 0)
  • 12. What’s Changed: The Slope  In our original model (excluding AGE and YEARS_EXP), the coefficient on POINTS was an estimate of the marginal effect of POINTS on USD_SALARY, i.e.,  This quantity puts no restriction on the values of AGE and YEARS_EXP (implicitly, we are allowing them to vary along with POINTS) – it’s a total derivative  In the new model (which includes AGE and YEARS_EXP), the coefficient on POINTS measures the marginal effect of POINTS on USD_SALARY holding AGE and YEARS_EXP constant, i.e.,  That is, it’s a partial derivative  The point: what your estimated regression coefficients measure depends on what is (and isn’t) in your model! 42 41801 (POINTS) Y) (USD_SALAR . d d  37 . 36603 (POINTS) Y) (USD_SALAR   