chapter 11 introduction to linear regression and correlation analysis
TRANSCRIPT
Chapter 11Chapter 11
Introduction to Introduction to Linear Regression Linear Regression and Correlation and Correlation
AnalysisAnalysis
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.
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.
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.
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.
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.
Two Variable Two Variable RelationshipsRelationships
(Figure 11-1)(Figure 11-1)
X
Y
(a) Linear(a) Linear
Two Variable Two Variable RelationshipsRelationships
(Figure 11-1)(Figure 11-1)
X
Y
(b) Linear(b) Linear
Two Variable Two Variable RelationshipsRelationships
(Figure 11-1)(Figure 11-1)
X
Y
(c) Curvilinear(c) Curvilinear
Two Variable Two Variable RelationshipsRelationships
(Figure 11-1)(Figure 11-1)
X
Y
(d) Curvilinear(d) Curvilinear
Two Variable Two Variable RelationshipsRelationships
(Figure 11-1)(Figure 11-1)
X
Y
(e) No (e) No RelationshipRelationship
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.
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
CorrelationCorrelation
SAMPLE CORRELATION COEFFICIENTSAMPLE CORRELATION COEFFICIENT
or the algebraic equivalent:
])()(][)()([ 2222 yynxxn
yxxynr
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
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
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
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
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
CorrelationCorrelation
Spurious correlationSpurious correlation occurs when there is a correlation between two otherwise unrelated variables.
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.
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
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.
Simple Linear Regression Simple Linear Regression AnalysisAnalysis
REGRESSION COEFFICIENTSREGRESSION COEFFICIENTSIn the simple regression model, there are two coefficients: the intercept and the slope.
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.
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.
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 ˆ
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
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
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
Simple Linear Regression Simple Linear Regression AnalysisAnalysis
SUM OF SQUARED ERRORSSUM OF SQUARED ERRORS
xybybySSE 102
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
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
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
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.
Simple Linear Regression Simple Linear Regression AnalysisAnalysis
SUM OF RESIDUALSSUM OF RESIDUALS
SUM OF SQUARED RESIDUALSSUM OF SQUARED RESIDUALS
0)ˆ( yy
2)ˆ( yy
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
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
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
Simple Linear Regression Simple Linear Regression AnalysisAnalysis
SUMS OF SQUARESSUMS OF SQUARES
SSRSSETSS
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.
Simple Linear Regression Simple Linear Regression AnalysisAnalysis
COEFFICIENT OF DETERMINATION COEFFICIENT OF DETERMINATION (R(R22))
TSS
SSRR 2
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.
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
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
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
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
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
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
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
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
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
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.
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
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 |
Simple Linear Regression Simple Linear Regression AnalysisAnalysis
PREDICTION INTERVAL FOR PREDICTION INTERVAL FOR
2
2
2/ )(
)(11ˆ
xx
xx
nsty p
pxY |
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.
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