58
Chapter 11 Chapter 11 Introduction to Introduction to Linear Regression Linear Regression and Correlation and Correlation Analysis Analysis

Chapter 11 Introduction to Linear Regression and Correlation Analysis

Embed Size (px)

Citation preview

Page 1: Chapter 11 Introduction to Linear Regression and Correlation Analysis

Chapter 11Chapter 11

Introduction to Introduction to Linear Regression Linear Regression and Correlation and Correlation

AnalysisAnalysis

Page 2: Chapter 11 Introduction to Linear Regression and Correlation Analysis

Chapter 11 - Chapter 11 - Chapter Chapter OutcomesOutcomes

After studying the material in this chapter, you should be able to:Calculate and interpret the simple correlation between two variables.Determine whether the correlation is significant.Calculate and interpret the simple linear regression coefficients for a set of data.Understand the basic assumptions behind regression analysis.Determine whether a regression model is significant.

Page 3: Chapter 11 Introduction to Linear Regression and Correlation Analysis

Chapter 11 - Chapter 11 - Chapter Chapter OutcomesOutcomes

(continued)(continued)

After studying the material in this chapter, you should be able to:Calculate and interpret confidence intervals for the regression coefficients.Recognize regression analysis applications for purposes of prediction and description.Recognize some potential problems if regression analysis is used incorrectly.Recognize several nonlinear relationships between two variables.

Page 4: Chapter 11 Introduction to Linear Regression and Correlation Analysis

Scatter DiagramsScatter Diagrams

A scatter plotscatter plot is a graph that may be used to represent the relationship between two variables. Also referred to as a scatter diagramscatter diagram.

Page 5: Chapter 11 Introduction to Linear Regression and Correlation Analysis

Dependent and Dependent and Independent VariablesIndependent Variables

A dependent variabledependent variable is the variable to be predicted or explained in a regression model. This variable is assumed to be functionally related to the independent variable.

Page 6: Chapter 11 Introduction to Linear Regression and Correlation Analysis

Dependent and Dependent and Independent VariablesIndependent Variables

An independent variableindependent variable is the variable related to the dependent variable in a regression equation. The independent variable is used in a regression model to estimate the value of the dependent variable.

Page 7: Chapter 11 Introduction to Linear Regression and Correlation Analysis

Two Variable Two Variable RelationshipsRelationships

(Figure 11-1)(Figure 11-1)

X

Y

(a) Linear(a) Linear

Page 8: Chapter 11 Introduction to Linear Regression and Correlation Analysis

Two Variable Two Variable RelationshipsRelationships

(Figure 11-1)(Figure 11-1)

X

Y

(b) Linear(b) Linear

Page 9: Chapter 11 Introduction to Linear Regression and Correlation Analysis

Two Variable Two Variable RelationshipsRelationships

(Figure 11-1)(Figure 11-1)

X

Y

(c) Curvilinear(c) Curvilinear

Page 10: Chapter 11 Introduction to Linear Regression and Correlation Analysis

Two Variable Two Variable RelationshipsRelationships

(Figure 11-1)(Figure 11-1)

X

Y

(d) Curvilinear(d) Curvilinear

Page 11: Chapter 11 Introduction to Linear Regression and Correlation Analysis

Two Variable Two Variable RelationshipsRelationships

(Figure 11-1)(Figure 11-1)

X

Y

(e) No (e) No RelationshipRelationship

Page 12: Chapter 11 Introduction to Linear Regression and Correlation Analysis

CorrelationCorrelation

The correlation coefficientcorrelation coefficient is a quantitative measure of the strength of the linear relationship between two variables. The correlation ranges from + 1.0 to - 1.0. A correlation of 1.0 indicates a perfect linear relationship, whereas a correlation of 0 indicates no linear relationship.

Page 13: Chapter 11 Introduction to Linear Regression and Correlation Analysis

CorrelationCorrelation

SAMPLE CORRELATION COEFFICIENTSAMPLE CORRELATION COEFFICIENT

where:r = Sample correlation coefficientn = Sample sizex = Value of the independent variabley = Value of the dependent variable

])(][)([

))((22 yyxx

yyxxr

Page 14: Chapter 11 Introduction to Linear Regression and Correlation Analysis

CorrelationCorrelation

SAMPLE CORRELATION COEFFICIENTSAMPLE CORRELATION COEFFICIENT

or the algebraic equivalent:

])()(][)()([ 2222 yynxxn

yxxynr

Page 15: Chapter 11 Introduction to Linear Regression and Correlation Analysis

CorrelationCorrelation(Example 11-1)(Example 11-1)

Sales Years

y x yx y2 x2

487 3 1,461 237,169 9445 5 2,225 198,025 25272 2 544 73,984 4641 8 5,128 410,881 64187 2 374 34,969 4440 6 2,640 193,600 36346 7 2,422 119,716 49238 1 238 56,644 1312 4 1,248 97,344 16269 2 538 72,361 4655 9 5,895 429,025 81563 6 3,378 316,969 36

(Table 11-1)(Table 11-1)

855,4 55 687,240,2 091,26 855,4

Page 16: Chapter 11 Introduction to Linear Regression and Correlation Analysis

CorrelationCorrelation(Example 11-1)(Example 11-1)

])()(][)()([ 2222 yynxxn

yxxynr

8325.0

])855,4()687,240,2(12][)55()329(12[

)855,4(55)091,26(1222

r

Page 17: Chapter 11 Introduction to Linear Regression and Correlation Analysis

CorrelationCorrelation(Example 11-1)(Example 11-1)

Sales Years with MidwestSales 1Years with Midwest 0.832534056 1

Excel Correlation OutputExcel Correlation Output

(Figure 11-5)(Figure 11-5)

Correlation between Years and Sales

Page 18: Chapter 11 Introduction to Linear Regression and Correlation Analysis

CorrelationCorrelation

TEST STATISTIC FOR CORRELATIONTEST STATISTIC FOR CORRELATION

where:t = Number of standard deviations r

is from 0r = Simple correlation coefficientn = Sample size

21 2

nr

rt

2ndf

Page 19: Chapter 11 Introduction to Linear Regression and Correlation Analysis

228.2025. t0

Correlation Significance Correlation Significance TestTest

(Example 11-1)(Example 11-1)

Rejection Region /2 = 0.025

Since t=4.752 > 2.048, reject H0, there is a significant linear relationship

228.2025. t

Rejection Region /2 = 0.025

05.0

0.0:

)(0.0:0

AH

ncorrelationoH

752 . 4

106931 . 0 1

8325 . 0

21

2

nr

rt

Page 20: Chapter 11 Introduction to Linear Regression and Correlation Analysis

CorrelationCorrelation

Spurious correlationSpurious correlation occurs when there is a correlation between two otherwise unrelated variables.

Page 21: Chapter 11 Introduction to Linear Regression and Correlation Analysis

Simple Linear Regression Simple Linear Regression AnalysisAnalysis

Simple linear regression Simple linear regression analysisanalysis analyzes the linear relationship that exists between a dependent variable and a single independent variable.

Page 22: Chapter 11 Introduction to Linear Regression and Correlation Analysis

Simple Linear Regression Simple Linear Regression AnalysisAnalysis

SIMPLE LINEAR REGRESSION MODEL SIMPLE LINEAR REGRESSION MODEL (POPULATION MODEL)(POPULATION MODEL)

where:y = Value of the dependent variablex = Value of the independent variable = Population’s y-intercept = Slope of the population regression

line = Error term, or residual

xy 10

01

Page 23: Chapter 11 Introduction to Linear Regression and Correlation Analysis

Simple Linear Regression Simple Linear Regression AnalysisAnalysis

The simple linear regression model has four assumptions:

Individual values if the error terms, i, are statistically independent of one another.

The distribution of all possible values of is normal.

The distributions of possible i values have equal variances for all value of x.

The means of the dependent variable, for all specified values of the independent variable, y, can be connected by a straight line called the population regression model.

Page 24: Chapter 11 Introduction to Linear Regression and Correlation Analysis

Simple Linear Regression Simple Linear Regression AnalysisAnalysis

REGRESSION COEFFICIENTSREGRESSION COEFFICIENTSIn the simple regression model, there are two coefficients: the intercept and the slope.

Page 25: Chapter 11 Introduction to Linear Regression and Correlation Analysis

Simple Linear Regression Simple Linear Regression AnalysisAnalysis

The interpretation of the regression slope coefficientregression slope coefficient is that is gives the average change in the dependent variable for a unit increase in the independent variable. The slope coefficient may be positive or negative, depending on the relationship between the two variables.

Page 26: Chapter 11 Introduction to Linear Regression and Correlation Analysis

Simple Linear Regression Simple Linear Regression AnalysisAnalysis

The least squares criterionleast squares criterion is used for determining a regression line that minimizes the sum of squared residuals.

Page 27: Chapter 11 Introduction to Linear Regression and Correlation Analysis

Simple Linear Regression Simple Linear Regression AnalysisAnalysis

A residualresidual is the difference between the actual value of the dependent variable and the value predicted by the regression model.

yy ˆ

Page 28: Chapter 11 Introduction to Linear Regression and Correlation Analysis

Simple Linear Regression Simple Linear Regression AnalysisAnalysis

X

Y

4

300200

100

400

xy 60150ˆ

Years with Company

Sale

s in

Th

ou

san

ds

390390

312312

Residual = 312 - 390 = -78

Page 29: Chapter 11 Introduction to Linear Regression and Correlation Analysis

Simple Linear Regression Simple Linear Regression AnalysisAnalysis

ESTIMATED REGRESSION MODELESTIMATED REGRESSION MODEL

(SAMPLE MODEL)(SAMPLE MODEL)

where: = Estimated, or predicted, y valueb0 = Unbiased estimate of the regression

interceptb1 = Unbiased estimate of the regression

slope x = Value of the independent variable

xbbyi 10ˆ

y

Page 30: Chapter 11 Introduction to Linear Regression and Correlation Analysis

Simple Linear Regression Simple Linear Regression AnalysisAnalysis

LEAST SQUARES EQUATIONSLEAST SQUARES EQUATIONS

algebraic equivalent:

and

n

xx

n

yxxy

b 22

1 )(

21 )(

))((

xx

yyxxb

xbyb 10

Page 31: Chapter 11 Introduction to Linear Regression and Correlation Analysis

Simple Linear Regression Simple Linear Regression AnalysisAnalysis

SUM OF SQUARED ERRORSSUM OF SQUARED ERRORS

xybybySSE 102

Page 32: Chapter 11 Introduction to Linear Regression and Correlation Analysis

Simple Linear Regression AnalysisSimple Linear Regression Analysis

(Midwest Example)(Midwest Example)

Sales Years

y x xy y2 x2

487 3 1,461 237,169 9445 5 2,225 198,025 25272 2 544 73,984 4641 8 5,128 410,881 64187 2 374 34,969 4440 6 2,640 193,600 36346 7 2,422 119,716 49238 1 238 56,644 1312 4 1,248 97,344 16269 2 538 72,361 4655 9 5,895 429,025 81563 6 3,378 316,969 36

(Table 11-3)(Table 11-3)

855,4 55 687,240,2 091,26 855,4

Page 33: Chapter 11 Introduction to Linear Regression and Correlation Analysis

Simple Linear Regression Simple Linear Regression AnalysisAnalysis (Table 11-3)(Table 11-3)

9101.49

12)55(

329

12)855,4(55

091,26

)( 222

1

n

xx

n

yxxy

b

8288.175)5833.4(9101.495833.40410 xbyb

The least squares regression line is:

)(9101.498288.175ˆ xy

Page 34: Chapter 11 Introduction to Linear Regression and Correlation Analysis

Simple Linear Regression Simple Linear Regression AnalysisAnalysis(Figure 11-11)(Figure 11-11)

SUMMARY OUTPUT

Regression StatisticsMultiple R 0.832534056R Square 0.693112955Adjusted R Square 0.662424251Standard Error 92.10553441Observations 12

ANOVAdf SS MS F Significance F

Regression 1 191600.622 191600.622 22.58527906 0.000777416Residual 10 84834.29469 8483.429469Total 11 276434.9167

Coefficients Standard Error t Stat P-value Lower 95% Upper 95% Lower 95.0% Upper 95.0%Intercept 175.8288191 54.98988674 3.197475563 0.00953244 53.30369475 298.3539434 53.30369475 298.3539434Years with Midwest 49.91007584 10.50208428 4.752397191 0.000777416 26.50996978 73.3101819 26.50996978 73.3101819

Excel Midwest Distribution Results

Page 35: Chapter 11 Introduction to Linear Regression and Correlation Analysis

Least Squares Regression Least Squares Regression PropertiesProperties

The sum of the residuals from the least squares regression line is 0.

The sum of the squared residuals is a minimum.

The simple regression line always passes through the mean of the y variable and the mean of the x variable.

The least squares coefficients are unbiased estimates of 0 and 1.

Page 36: Chapter 11 Introduction to Linear Regression and Correlation Analysis

Simple Linear Regression Simple Linear Regression AnalysisAnalysis

SUM OF RESIDUALSSUM OF RESIDUALS

SUM OF SQUARED RESIDUALSSUM OF SQUARED RESIDUALS

0)ˆ( yy

2)ˆ( yy

Page 37: Chapter 11 Introduction to Linear Regression and Correlation Analysis

Simple Linear Regression Simple Linear Regression AnalysisAnalysis

TOTAL SUM OF SQUARESTOTAL SUM OF SQUARES

where: TSS = Total sum of squares

n = Sample sizey = Values of the dependent variable = Average value of the dependent

variable

2)( yyTSS

y

Page 38: Chapter 11 Introduction to Linear Regression and Correlation Analysis

Simple Linear Regression Simple Linear Regression AnalysisAnalysis

SUM OF SQUARES ERROR SUM OF SQUARES ERROR (RESIDUALS)(RESIDUALS)

where: SSE = Sum of squares error

n = Sample sizey = Values of the dependent variable = Estimated value for the average of

y for the given x value

2)ˆ( yySSE

y

Page 39: Chapter 11 Introduction to Linear Regression and Correlation Analysis

Simple Linear Regression Simple Linear Regression AnalysisAnalysis

SUM OF SQUARES REGRESSIONSUM OF SQUARES REGRESSION

where: SSR = Sum of squares regression

= Average value of the dependent variable

y = Values of the dependent variable = Estimated value for the average of

y for the given x value

2)ˆ( yySSR

y

y

Page 40: Chapter 11 Introduction to Linear Regression and Correlation Analysis

Simple Linear Regression Simple Linear Regression AnalysisAnalysis

SUMS OF SQUARESSUMS OF SQUARES

SSRSSETSS

Page 41: Chapter 11 Introduction to Linear Regression and Correlation Analysis

Simple Linear Regression Simple Linear Regression AnalysisAnalysis

The coefficient of determinationcoefficient of determination is the portion of the total variation in the dependent variable that is explained by its relationship with the independent variable. The coefficient of determination is also called R-squared and is denoted as R2.

Page 42: Chapter 11 Introduction to Linear Regression and Correlation Analysis

Simple Linear Regression Simple Linear Regression AnalysisAnalysis

COEFFICIENT OF DETERMINATION COEFFICIENT OF DETERMINATION (R(R22))

TSS

SSRR 2

Page 43: Chapter 11 Introduction to Linear Regression and Correlation Analysis

Simple Linear Regression Simple Linear Regression AnalysisAnalysis

(Midwest Example)(Midwest Example)

COEFFICIENT OF DETERMINATION COEFFICIENT OF DETERMINATION (R(R22))

6931.090.434,276

62.600,1912 TSS

SSRR

69.31%69.31% of the variation in the sales data for this sample can be explained by the linear relationship

between sales and years of experience.

Page 44: Chapter 11 Introduction to Linear Regression and Correlation Analysis

Simple Linear Regression Simple Linear Regression AnalysisAnalysis

COEFFICIENT OF DETERMINATION COEFFICIENT OF DETERMINATION SINGLE INDEPENDENT VARIABLE SINGLE INDEPENDENT VARIABLE

CASECASE

where:R2 = Coefficient of determination r = Simple correlation

coefficient

22 rR

Page 45: Chapter 11 Introduction to Linear Regression and Correlation Analysis

Simple Linear Regression Simple Linear Regression AnalysisAnalysis

STANDARD DEVIATION OF THE STANDARD DEVIATION OF THE REGRESSION SLOPE COEFFICIENT REGRESSION SLOPE COEFFICIENT

(POPULATION)(POPULATION)

where: = Standard deviation of the

regression slope (Called the standard error of the slope)

= Population standard error of the estimate

2)(1

xxb

1b

Page 46: Chapter 11 Introduction to Linear Regression and Correlation Analysis

Simple Linear Regression Simple Linear Regression AnalysisAnalysis

ESTIMATOR FOR THE STANDARD ESTIMATOR FOR THE STANDARD ERROR OF THE ESTIMATEERROR OF THE ESTIMATE

where: SSE = Sum of squares error

n = Sample size k = number of independent variables in the model

1

kn

SSEs

Page 47: Chapter 11 Introduction to Linear Regression and Correlation Analysis

Simple Linear Regression Simple Linear Regression AnalysisAnalysis

ESTIMATOR FOR THE STANDARD ESTIMATOR FOR THE STANDARD DEVIATION OF THE REGRESSION SLOPEDEVIATION OF THE REGRESSION SLOPE

where:

= Estimate of the standard error of the least squares slope

= Sample standard error of the estimate

n

xx

s

xx

ssb 2

22 )()(

1

1bs

2nSSEs

Page 48: Chapter 11 Introduction to Linear Regression and Correlation Analysis

Simple Linear Regression Simple Linear Regression AnalysisAnalysis

TEST STATISTIC FOR TEST OF TEST STATISTIC FOR TEST OF SIGNIFICANCE OF THE REGRESSION SIGNIFICANCE OF THE REGRESSION

SLOPESLOPE

where: b1 = Sample regression slope

coefficient 1 = Hypothesized slope

sb1 = Estimator of the standard error of the slope

21

11

ndfs

bt

b

Page 49: Chapter 11 Introduction to Linear Regression and Correlation Analysis

228.2025. t0

Significance Test of Significance Test of Regression SlopeRegression Slope

(Example 11-5)(Example 11-5)

Rejection Region /2 = 0.025

Since t=4.753 > 2.048, reject H0: conclude that the true slope is not zero

228.2025. t

Rejection Region /2 = 0.025

05.0

0.0:

0.0:

1

10

AH

H753 . 4

50 . 10

0 91 . 49

1

1 1

bs

bt

Page 50: Chapter 11 Introduction to Linear Regression and Correlation Analysis

Simple Linear Regression Simple Linear Regression AnalysisAnalysis

MEAN SQUARE REGRESSIONMEAN SQUARE REGRESSION

where:SSR = Sum of squares regressionk = Number of independent variables in

the model

k

SSRMSR

Page 51: Chapter 11 Introduction to Linear Regression and Correlation Analysis

Simple Linear Regression Simple Linear Regression AnalysisAnalysis

MEAN SQUARE ERRORMEAN SQUARE ERROR

where:SSE = Sum of squares error n = Sample sizek = Number of independent variables in

the model

1

kn

SSEMSE

Page 52: Chapter 11 Introduction to Linear Regression and Correlation Analysis

Significance TestSignificance Test(Example 11-6)(Example 11-6)

05.0

0.0:

0.0:

1

10

AH

H

96.4F

Rejection Region = 0.05

59.2243.483,8

6.600,191

MSE

MSR

RatioF

Since F= 22.59 > 4.96, reject H0: conclude that the regression model explains a significant amount of the

variation in the dependent variable

Page 53: Chapter 11 Introduction to Linear Regression and Correlation Analysis

Simple Regression StepsSimple Regression Steps

Develop a scatter plot of y and x. You are looking for a linear relationship between the two variables.

Calculate the least squares regression line for the sample data.

Calculate the correlation coefficient and the simple coefficient of determination, R2.

Conduct one of the significance tests.

Page 54: Chapter 11 Introduction to Linear Regression and Correlation Analysis

Simple Linear Regression Simple Linear Regression AnalysisAnalysis

CONFIDENCE INTERVAL ESTIMATE FOR CONFIDENCE INTERVAL ESTIMATE FOR THE REGRESSION SLOPETHE REGRESSION SLOPE

or equivalently:

where:sb1 = Standard error of the regression

slope coefficients = Standard error of the estimate

12/1 bstb

22/1)( xx

stb

2ndf

Page 55: Chapter 11 Introduction to Linear Regression and Correlation Analysis

Simple Linear Regression Simple Linear Regression AnalysisAnalysis

CONFIDENCE INTERVAL FOR CONFIDENCE INTERVAL FOR

where: = Point estimate of the dependent

variable t = Critical value with n - 2 d.f.s = Standard error of the estimate

n = Sample sizexp = Specific value of the independent

variable = Mean of independent variable

observations

x

y

2

2

2/ )(

)(1ˆ

xx

xx

nsty p

pxy |

Page 56: Chapter 11 Introduction to Linear Regression and Correlation Analysis

Simple Linear Regression Simple Linear Regression AnalysisAnalysis

PREDICTION INTERVAL FOR PREDICTION INTERVAL FOR

2

2

2/ )(

)(11ˆ

xx

xx

nsty p

pxY |

Page 57: Chapter 11 Introduction to Linear Regression and Correlation Analysis

Residual AnalysisResidual Analysis

Before using a regression model for description or prediction, you should do a check to see if the assumptions concerning the normal distribution and constant variance of the error terms have been satisfied. One way to do this is through the use of residual residual plotsplots.

Page 58: Chapter 11 Introduction to Linear Regression and Correlation Analysis

Key TermsKey Terms Coefficient of

Determination Correlation Coefficient Dependent Variable Independent Variable Least Squares Criterion Regression Coefficients

Regression Slope Coefficient

Residual Scatter Plot Simple Linear

Regression Analysis

Spurious Correlation