1 Least squares procedure Inference for least squares lines Simple Linear Regression.

Slides:



Advertisements
Similar presentations
Simple Linear Regression 1. review of least squares procedure 2
Advertisements

Forecasting Using the Simple Linear Regression Model and Correlation
Inference for Regression
6-1 Introduction To Empirical Models 6-1 Introduction To Empirical Models.
Regression Analysis Once a linear relationship is defined, the independent variable can be used to forecast the dependent variable. Y ^ = bo + bX bo is.
1 Simple Linear Regression and Correlation The Model Estimating the Coefficients EXAMPLE 1: USED CAR SALES Assessing the model –T-tests –R-square.
Simple Linear Regression
Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc Chapter 17 Simple Linear Regression and Correlation.
Chapter 10 Simple Regression.
Chapter 12 Simple Regression
BA 555 Practical Business Analysis
Simple Linear Regression
Chapter 13 Introduction to Linear Regression and Correlation Analysis
Fall 2006 – Fundamentals of Business Statistics 1 Chapter 13 Introduction to Linear Regression and Correlation Analysis.
Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc.Chap 13-1 Statistics for Managers Using Microsoft® Excel 5th Edition Chapter.
Pengujian Parameter Koefisien Korelasi Pertemuan 04 Matakuliah: I0174 – Analisis Regresi Tahun: Ganjil 2007/2008.
Chapter Topics Types of Regression Models
Linear Regression and Correlation Analysis
Lecture 20 Simple linear regression (18.6, 18.9)
Regression Diagnostics - I
1 Simple Linear Regression Chapter Introduction In this chapter we examine the relationship among interval variables via a mathematical equation.
Chapter 13 Introduction to Linear Regression and Correlation Analysis
1 Simple Linear Regression and Correlation Chapter 17.
© 2000 Prentice-Hall, Inc. Chap Forecasting Using the Simple Linear Regression Model and Correlation.
Pertemua 19 Regresi Linier
Lecture 17 Interaction Plots Simple Linear Regression (Chapter ) Homework 4 due Friday. JMP instructions for question are actually for.
Chapter 14 Introduction to Linear Regression and Correlation Analysis
1 Simple Linear Regression Chapter Introduction In Chapters 17 to 19 we examine the relationship between interval variables via a mathematical.
Business Statistics - QBM117 Statistical inference for regression.
Lecture 19 Simple linear regression (Review, 18.5, 18.8)
Correlation and Regression Analysis
Chapter 7 Forecasting with Simple Regression
Introduction to Regression Analysis, Chapter 13,
Simple Linear Regression. Introduction In Chapters 17 to 19, we examine the relationship between interval variables via a mathematical equation. The motivation.
Chapter 6 (cont.) Regression Estimation. Simple Linear Regression: review of least squares procedure 2.
1 Simple Linear Regression 1. review of least squares procedure 2. inference for least squares lines.
Keller: Stats for Mgmt & Econ, 7th Ed
Regression and Correlation Methods Judy Zhong Ph.D.
Introduction to Linear Regression and Correlation Analysis
Inference for regression - Simple linear regression
Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 12-1 Chapter 12 Simple Linear Regression Statistics for Managers Using.
OPIM 303-Lecture #8 Jose M. Cruz Assistant Professor.
Review of Statistical Models and Linear Regression Concepts STAT E-150 Statistical Methods.
Keller: Stats for Mgmt & Econ, 7th Ed
© 2003 Prentice-Hall, Inc.Chap 13-1 Basic Business Statistics (9 th Edition) Chapter 13 Simple Linear Regression.
Applied Quantitative Analysis and Practices LECTURE#23 By Dr. Osman Sadiq Paracha.
Economics 173 Business Statistics Lecture 20 Fall, 2001© Professor J. Petry
Inference for Regression Simple Linear Regression IPS Chapter 10.1 © 2009 W.H. Freeman and Company.
Business Statistics: A Decision-Making Approach, 6e © 2005 Prentice-Hall, Inc. Chap 13-1 Introduction to Regression Analysis Regression analysis is used.
Chapter 11 Correlation and Simple Linear Regression Statistics for Business (Econ) 1.
Economics 173 Business Statistics Lectures Summer, 2001 Professor J. Petry.
Lecture 10: Correlation and Regression Model.
Economics 173 Business Statistics Lecture 10 Fall, 2001 Professor J. Petry
Chapter 8: Simple Linear Regression Yang Zhenlin.
McGraw-Hill/IrwinCopyright © 2009 by The McGraw-Hill Companies, Inc. All Rights Reserved. Simple Linear Regression Analysis Chapter 13.
Statistics for Managers Using Microsoft® Excel 5th Edition
1 Simple Linear Regression and Correlation Least Squares Method The Model Estimating the Coefficients EXAMPLE 1: USED CAR SALES.
Linear Regression Linear Regression. Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. Purpose Understand Linear Regression. Use R functions.
Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc Chapter 17 Simple Linear Regression and Correlation.
1 Simple Linear Regression Review 1. review of scatterplots and correlation 2. review of least squares procedure 3. inference for least squares lines.
Simple Linear Regression and Correlation (Continue..,) Reference: Chapter 17 of Statistics for Management and Economics, 7 th Edition, Gerald Keller. 1.
Introduction. We want to see if there is any relationship between the results on exams and the amount of hours used for studies. Person ABCDEFGHIJ Hours/
1 Simple Linear Regression Chapter Introduction In Chapters 17 to 19 we examine the relationship between interval variables via a mathematical.
Warm-Up The least squares slope b1 is an estimate of the true slope of the line that relates global average temperature to CO2. Since b1 = is very.
Inference for Least Squares Lines
Linear Regression.
Simple Linear Regression Review 1
Keller: Stats for Mgmt & Econ, 7th Ed
CHAPTER 12 More About Regression
Presentation transcript:

1 Least squares procedure Inference for least squares lines Simple Linear Regression

2 Introduction We will examine the relationship between quantitative variables x and y via a mathematical equation. The motivation for using the technique: –Forecast the value of a dependent variable (y) from the value of independent variables (x 1, x 2,…x k.). –Analyze the specific relationships between the independent variables and the dependent variable.

3 House size House Cost Most lots sell for $25,000 Building a house costs about $75 per square foot. House cost = (Size) The Model (Example) The model has a deterministic and a probabilistic components

4 House cost = (Size) House size House Cost Most lots sell for $25,000   However, house cost vary even among same size houses! The Model Since cost behave unpredictably, we add a random component.

5 The Model The first order linear model y = dependent variable x = independent variable  0 = y-intercept  1 = slope of the line  = error variable x y 00 Run Rise   = Rise/Run  0 and  1 are unknown population parameters, therefore are estimated from the data.

6 Estimating the Coefficients The estimates are determined by –drawing a sample from the population of interest, –calculating sample statistics. –producing a straight line that cuts into the data.           Question: What should be considered a good line? x y

7 The Least Squares (Regression) Line A good line is one that minimizes the sum of squared differences between the points and the line.

8 The Least Squares (Regression) Line 3 3     (1,2) 2 2 (2,4) (3,1.5) Sum of squared differences =(2 - 1) 2 +(4 - 2) 2 +( ) 2 + (4,3.2) ( ) 2 = 6.89 Sum of squared differences =(2 -2.5) 2 +( ) 2 +( ) 2 +( ) 2 = Let us compare two lines The second line is horizontal The smaller the sum of squared differences the better the fit of the line to the data.

9 The Estimated Coefficients To calculate the estimates of the slope and intercept of the least squares line, use the formulas: The regression equation that estimates the equation of the first order linear model is: Alternate formula for the slope b 1

10 Example: –A car dealer wants to find the relationship between the odometer reading and the selling price of used cars. –A random sample of 100 cars is selected, and the data recorded. –Find the regression line. Independent variable x Dependent variable y The Simple Linear Regression Line

11 The Simple Linear Regression Line Solution –Solving by hand: Calculate a number of statistics where n = 100.

12 The Simple Linear Regression Line

13 This is the slope of the line. For each additional mile on the odometer, the price decreases by an average of $ Interpreting the Linear Regression - Equation The intercept is b 0 = $ No data Do not interpret the intercept as the “Price of cars that have not been driven” 17067

14 Error Variable: Required Conditions The error  is a critical part of the regression model. Four requirements involving the distribution of  must be satisfied. –The probability distribution of  is normal. –The mean of  is zero: E(  ) = 0. –The standard deviation of  is   for all values of x. –The set of errors associated with different values of y are all independent.

15 The Normality of  From the first three assumptions we have: y is normally distributed with mean E(y) =  0 +  1 x, and a constant standard deviation   From the first three assumptions we have: y is normally distributed with mean E(y) =  0 +  1 x, and a constant standard deviation     0 +  1 x 1  0 +  1 x 2  0 +  1 x 3 E(y|x 2 ) E(y|x 3 ) x1x1 x2x2 x3x3  E(y|x 1 )  The standard deviation remains constant, but the mean value changes with x

16 Assessing the Model The least squares method will produces a regression line whether or not there is a linear relationship between x and y. Consequently, it is important to assess how well the linear model fits the data. Several methods are used to assess the model. All are based on the sum of squares for errors, SSE.

17 –This is the sum of differences between the points and the regression line. –It can serve as a measure of how well the line fits the data. SSE is defined by Sum of Squares for Errors –A shortcut formula

18 –The mean error is equal to zero. –If   is small the errors tend to be close to zero (close to the mean error). Then, the model fits the data well. –Therefore, we can, use   as a measure of the suitability of using a linear model. –An estimator of   is given by s  Standard Error of Estimate

19 Example: –Calculate the standard error of estimate for the previous example and describe what it tells you about the model fit. Solution It is hard to assess the model based on s  even when compared with the mean value of y. Standard Error of Estimate, Example

“p-values” and Significance Levels Each independent variable has “p-value” or significance level. The p-value tells how likely it is that the coefficient for that independent variable emerged by chance and does not describe a real relationship. A p-value of.05 means that there is a 5% chance that the relationship emerged randomly and a 95% chance that the relationship is real. It is generally accepted practice to consider variables with a p-value of less than.1 as significant, though the only basis for this cutoff is convention 20

21 If we are satisfied with how well the model fits the data, we can use it to predict the values of y. To make a prediction we use –Point prediction, and –Interval prediction Using the Regression Equation Before using the regression model, we need to assess how well it fits the data.

22 Point Prediction Example –Predict the selling price of a three-year-old Taurus with 40,000 miles on the odometer. –It is predicted that a 40,000 miles car would sell for $14,575. – How close is this prediction to the real price? A point prediction

23 Interval Estimates Two intervals can be used to discover how closely the predicted value will match the true value of y. –Prediction interval – predicts y for a given value of x, –Confidence interval – estimates the average y for a given x. –The confidence interval –The prediction interval

24 Interval Estimates, Example Example - continued –Provide an interval estimate for the bidding price on a Ford Taurus with 40,000 miles on the odometer. –Two types of predictions are required: A prediction for a specific car An estimate for the average price per car

25 Interval Estimates, Example Solution –A prediction interval provides the price estimate for a single car: t.025,98 Approximately

26 Solution – continued –A confidence interval provides the estimate of the mean price per car for a Ford Taurus with 40,000 miles reading on the odometer. The confidence interval (95%) = Interval Estimates, Example

27 Residual Analysis Examining the residuals (or standardized residuals), help detect violations of the required conditions. Example – continued: –Nonnormality. Use Excel to obtain the standardized residual histogram. Examine the histogram and look for a bell shaped. diagram with a mean close to zero.

28 It seems the residual are normally distributed with mean zero Residual Analysis

29 Heteroscedasticity When the requirement of a constant variance is violated we have a condition of heteroscedasticity. Diagnose heteroscedasticity by plotting the residual against the predicted y The spread increases with y ^ y ^ Residual ^ y

30 Homoscedasticity When the requirement of a constant variance is not violated we have a condition of homoscedasticity. Example - continued

31 Non Independence of Error Variables – A time series is constituted if data were collected over time. –Examining the residuals over time, no pattern should be observed if the errors are independent. –When a pattern is detected, the errors are said to be autocorrelated. –Autocorrelation can be detected by graphing the residuals against time.

32 Patterns in the appearance of the residuals over time indicates that autocorrelation exists Time Residual Time Note the runs of positive residuals, replaced by runs of negative residuals Note the oscillating behavior of the residuals around zero. 00 Non Independence of Error Variables

33 Outliers An outlier is an observation that is unusually small or large. Several possibilities need to be investigated when an outlier is observed: –There was an error in recording the value. –The point does not belong in the sample. –The observation is valid. Identify outliers from the scatter diagram. It is customary to suspect an observation is an outlier if its | standard residual | > 2

The outlier causes a shift in the regression line … but, some outliers may be very influential An outlier An influential observation

35 Procedure for Regression Diagnostics Develop a model that has a theoretical basis. Gather data for the two variables in the model. Draw the scatter diagram to determine whether a linear model appears to be appropriate. Determine the regression equation. Check the required conditions for the errors. Check the existence of outliers and influential observations Assess the model fit. If the model fits the data, use the regression equation.