You are on page 1of 65

Business Statistics: A First Course

(3rd Edition)

Chapter 10 Simple Linear Regression

2003 Prentice-Hall, Inc.

Chap 10-1

Chapter Topics

Types of Regression Models Determining the Simple Linear Regression Equation Measures of Variation Assumptions of Regression and Correlation Residual Analysis Measuring Autocorrelation Inferences about the Slope
Chap 10-2

2003 Prentice-Hall, Inc.

Chapter Topics

(continued)

Correlation - Measuring the Strength of the Association Estimation of Mean Values and Prediction of Individual Values Pitfalls in Regression and Ethical Issues

2003 Prentice-Hall, Inc.

Chap 10-3

Purpose of Regression Analysis

Regression Analysis is Used Primarily to Model Causality and Provide Prediction

Predict the values of a dependent (response) variable based on values of at least one independent (explanatory) variable Explain the effect of the independent variables on the dependent variable

2003 Prentice-Hall, Inc.

Chap 10-4

Types of Regression Models


Positive Linear Relationship Relationship NOT Linear

Negative Linear Relationship

No Relationship

2003 Prentice-Hall, Inc.

Chap 10-5

Simple Linear Regression Model

Relationship Between Variables is Described by a Linear Function The Change of One Variable Causes the Other Variable to Change A Dependency of One Variable on the Other

2003 Prentice-Hall, Inc.

Chap 10-6

Simple Linear Regression Model


Population regression line is a straight line that describes the dependence of the average value (conditional mean) of one variable on the other
Population Y intercept Population Slope Coefficient

(continued)

Random Error

Dependent (Response) Variable


2003 Prentice-Hall, Inc.

Yi = 0 + 1 X i + i
Population Regression Y |X Line (conditional mean)

Independent (Explanatory) Variable


Chap 10-7

Simple Linear Regression Model


Y
(Observed Value of Y) = Yi

(continued)

= 0 + 1 X i + i

i = Random Error
0
Observed Value of Y
2003 Prentice-Hall, Inc.

Y | X = 0 + 1 X i
(Conditional Mean)

X
Chap 10-8

Linear Regression Equation


Sample regression line provides an estimate of the population regression line as well as a predicted value of Y
Sample Y Intercept Sample Slope Coefficient Residual

Yi = b0 + b1 X i + ei

b+ = Y = 0 bX 1
2003 Prentice-Hall, Inc.

Simple Regression Equation (Fitted Regression Line, Predicted Value)


Chap 10-9

Linear Regression Equation

(continued)

b0 and b1 are obtained by finding the values of b0 and b that minimizes the sum of the 1
squared residuals

(
n i =1

Yi Yi

) = e
2 n i =1

2 i

b0 provides an estimate of 0 b1 provides and estimate of 1


Chap 10-10

2003 Prentice-Hall, Inc.

Linear Regression Equation


Yi = b0 + b1 X i + ei
Y

(continued)

Yi = 0 + 1 X i + i
b1

ei
0
b0

i
Yi = b0 + b1 X i

1
Y | X = 0 + 1 X i

X
Chap 10-11

Observed Value
2003 Prentice-Hall, Inc.

Interpretation of the Slope and Intercept

0 = Y | X =0
1 =
Y |X X

is the average value of Y when

the value of X is zero. measures the change in the

average value of Y as a result of a one-unit change in X.

2003 Prentice-Hall, Inc.

Chap 10-12

Interpretation of the Slope and Intercept

(continued)

= b0 = Y |X

is the estimated average value

of Y when the value of X is zero.

b1 =

Y |X X

is the estimated change in the

average value of Y as a result of a one-unit change in X.


2003 Prentice-Hall, Inc. Chap 10-13

Simple Linear Regression: Example


You wish to examine the linear dependency of the annual sales of produce stores on their sizes in square footage. Sample data for 7 stores were obtained. Find the equation of the straight line that fits the data best.
2003 Prentice-Hall, Inc.

Store 1 2 3 4 5 6 7

Square Feet 1,726 1,542 2,816 5,555 1,292 2,208 1,313

Annual Sales ($1000) 3,681 3,395 6,653 9,543 3,318 5,563 3,760
Chap 10-14

Scatter Diagram: Example


12000

An n u a l S a le s ($000)

10000 8000 6000 4000 2000 0 0 1000 2000 3000 4000 5000 6000

Excel Output
2003 Prentice-Hall, Inc.

S q u a re F e e t

Chap 10-15

Simple Linear Regression Equation: Example


Yi = b0 + b X i 1 = 1636.415 + 1.487 i X
From Excel Printout:
Coefficients Inte rce pt X Va ria ble 1 1636.414726 1.486633657

2003 Prentice-Hall, Inc.

Chap 10-16

Graph of the Simple Linear Regression Equation: Example


An n u a l S a le s ($000)
12000 10000 8000 6000 4000 2000 0 0 1000 2000 3000 4000 5000 6000

Xi 487 +1. 5 .41 6 163 Yi =

S q u a re F e e t

2003 Prentice-Hall, Inc.

Chap 10-17

Interpretation of Results: Example


Yi = 1636.415 + 1.487 X i
The slope of 1.487 means that each increase of one unit in X, we predict the average of Y to increase by an estimated 1.487 units. The equation estimates that for each increase of 1 square foot in the size of the store, the expected annual sales are predicted to increase by $1487.
2003 Prentice-Hall, Inc. Chap 10-18

Simple Linear Regression in PHStat

In Excel, use PHStat | Regression | Simple Linear Regression EXCEL Spreadsheet of Regression Sales on Footage

Microsoft Excel Worksheet

2003 Prentice-Hall, Inc.

Chap 10-19

Measures of Variation: The Sum of Squares

SST

SSR

SSE Unexplained Variability

Total = Sample Variability

Explained + Variability

2003 Prentice-Hall, Inc.

Chap 10-20

Measures of Variation: The Sum of Squares

(continued)

SST = Total Sum of Squares

Measures the variation of the Yi values around their mean, Y Explained variation attributable to the relationship between X and Y Variation attributable to factors other than the relationship between X and Y
Chap 10-21

SSR = Regression Sum of Squares

SSE = Error Sum of Squares

2003 Prentice-Hall, Inc.

Measures of Variation: The Sum of Squares


Y
SST = (Yi - Y)2 _ SSR = (Yi - Y)2

(continued)

SSE =(Yi - Yi )2

_ Y X
Chap 10-22

Xi
2003 Prentice-Hall, Inc.

The ANOVA Table in Excel


ANOVA df Regression Residuals Total k SS SSR MS MSR =SSR/k MSE =SSE/(n-k-1) F MSR/MSE Significance F P-value of the F Test

n-k-1 SSE n-1 SST

2003 Prentice-Hall, Inc.

Chap 10-23

Measures of Variation The Sum of Squares: Example


Excel Output for Produce Stores
Degrees of freedom

A NO V A
df Re g r e s s io n Re s id u al T o tal 1 5 6 SS MS F Signific anc e F 0.000281201 30380456.12 30380456 81.17909 1871199.595 374239.92 32251655.71

Regression (explained) df Error (residual) df Total df


2003 Prentice-Hall, Inc.

SSE SSR

SST
Chap 10-24

The Coefficient of Determination

SSR Regression Sum of Squares r = = SST Total Sum of Squares


2

Measures the proportion of variation in Y that is explained by the independent variable X in the regression model

2003 Prentice-Hall, Inc.

Chap 10-25

Coefficients of Determination (r 2) and Correlation (r)


Y r2 = 1, r = +1 ^ Yi = b0 + b1Xi Y r2 = 1, r = -1 ^ Y =b +b X
i 0

1 i

X Y

r2 = .81, r = +0.9 Y
^ Yi = b0 + b1Xi
2003 Prentice-Hall, Inc.

r2 = 0, r = 0
^ Yi = b0 + b1Xi

X
Chap 10-26

Standard Error of Estimate

SYX

SSE = = n2

(
n i =1

Y Yi

n2

The standard deviation of the variation of observations around the regression equation

2003 Prentice-Hall, Inc.

Chap 10-27

Measures of Variation: Produce Store Example


Excel Output for Produce Stores
Regression Statistics Multiple R R Square Adjusted R Square Standard Error Observations 0.9705572 0.94198129 0.93037754 611.751517 7

r2 = .94

Syx
94% of the variation in annual sales can be explained by the variability in the size of the store as measured by square footage

2003 Prentice-Hall, Inc.

Chap 10-28

Linear Regression Assumptions

Normality

Y values are normally distributed for each X Probability distribution of error is normal

2. Homoscedasticity (Constant Variance) 3. Independence of Errors

2003 Prentice-Hall, Inc.

Chap 10-29

Variation of Errors Around the Regression Line


f( )
Y values are normally distributed around the regression line. For each X value, the spread or variance around the regression line is the same.

Y
X2

X1 X
2003 Prentice-Hall, Inc.

Sample Regression Line


Chap 10-30

Residual Analysis

Purposes

Examine linearity Evaluate violations of assumptions Plot residuals vs. X and time

Graphical Analysis of Residuals

2003 Prentice-Hall, Inc.

Chap 10-31

Residual Analysis for Linearity


Y Y

X e X

X X

Not Linear
2003 Prentice-Hall, Inc.

Linear
Chap 10-32

Residual Analysis for Homoscedasticity


Y Y

SR

SR

Heteroscedasticity
2003 Prentice-Hall, Inc.

Homoscedasticity
Chap 10-33

Residual Analysis:Excel Output for Produce Stores Example


Excel Output
Observation 1 2 3 4 5 6 7 Predicted Y 4202.344417 3928.803824 5822.775103 9894.664688 3557.14541 4918.90184 3588.364717 Residuals -521.3444173 -533.8038245 830.2248971 -351.6646882 -239.1454103 644.0981603 171.6352829

Residual Plot

1000

2000

3000

4000

5000

6000

Square Feet
2003 Prentice-Hall, Inc.

Chap 10-34

Residual Analysis for Independence

The Durbin-Watson Statistic

Used when data is collected over time to detect autocorrelation (residuals in one time period are related to residuals in another period) Measures violation of independence assumption

D=

(ei ei 1) 2
i =2

Should be close to 2.

e
i =1

2 i

If not, examine the model for autocorrelation.


Chap 10-35

2003 Prentice-Hall, Inc.

Durbin-Watson Statistic in PHStat

PHStat | Regression | Simple Linear Regression

Check the box for Durbin-Watson Statistic

2003 Prentice-Hall, Inc.

Chap 10-36

Obtaining the Critical Values of Durbin-Watson Statistic


Table 13.4 Finding critical values of Durbin-Watson Statistic

=
k=1 n 15 16
2003 Prentice-Hall, Inc.

50 .
k=2 dL .95 .98 dU 1.54 1.54
Chap 10-37

dL 1.08 1.10

dU 1.36 1.37

Using the Durbin-Watson Statistic


H1
H0 :
No autocorrelation (error terms are independent) : There is autocorrelation (error terms are not independent)
Inconclusive Accept H0 (no autocorrelatin) Reject H0 (negative autocorrelation)

Reject H0 (positive autocorrelation)

0
2003 Prentice-Hall, Inc.

dL

dU

4-dU

4-dL

4
Chap 10-38

Residual Analysis for Independence


Graphical Approach
Not Independent e Time

Independent

Time

Cyclical Pattern

No Particular Pattern

Residual Is Plotted Against Time to Detect Any Autocorrelation


2003 Prentice-Hall, Inc. Chap 10-39

Inference about the Slope: t Test

t Test for a Population Slope

Is there a linear dependency of Y on X ? H0: 1 = 0 (No Linear Dependency)

Null and Alternative Hypotheses


H1: 1 0 (Linear Dependency)

Test Statistic b1 1 t= where S b1 = Sb1

S YX

d. f . = n 2

(X
i =1

X)

2003 Prentice-Hall, Inc.

Chap 10-40

Example: Produce Store


Data for 7 Stores: Store 1 2 3 4 5 6 7
2003 Prentice-Hall, Inc.

Square Feet 1,726 1,542 2,816 5,555 1,292 2,208 1,313

Annual Sales ($000) 3,681 3,395 6,653 9,543 3,318 5,563 3,760

Estimated Regression Equation:

Y = 1636.415 + 1.487 X i
The slope of this model is 1.487. Does Square Footage Affect Annual Sales?
Chap 10-41

Inferences about the Slope: t Test Example


H0: 1 = 0

Test Statistic:
From Excel Printout

H1: 1 0

b1 Sb1

= .05 Interc ept 1636.4147 df = 7 - 2 = 5 F ootage 1.4866 Critical Value(s):


Reject .025 Reject .025

C oeffic ientsS tandard E rrort S tat P -value 451.4953 3.6244 0.01515 0.1650 9.0099 0.00028

Decision: Reject H0 Conclusion: There is evidence that square footage affects annual sales.
Chap 10-42

-2.5706 0 2.5706
2003 Prentice-Hall, Inc.

Inferences about the Slope: Confidence Interval Example


Confidence Interval Estimate of the Slope:

b1 tn 2 Sb1
Excel Printout for Produce Stores
L ow er 95% In te rce p t 475.810926 X V a ria b le 11.06249037 Upper 95% 2797.01853 1.91077694

At 95% level of confidence the confidence interval for the slope is (1.062, 1.911). Does not include 0. Conclusion: There is a significant linear dependency of annual sales on the size of the store.
2003 Prentice-Hall, Inc. Chap 10-43

Inferences about the Slope: F Test

F Test for a Population Slope

Is there a linear dependency of Y on X ? H0: 1 = 0 (No Linear Dependency)

Null and Alternative Hypotheses


H1: 1 0 (Linear Dependency)

Test Statistic

SR S 1 F = SE S ( n 2 )
Chap 10-44

2003 Prentice-Hall, Inc.

Numerator d.f.=1, denominator d.f.=n-2

Relationship between a t Test and an F Test

Null and Alternative Hypotheses


H0: 1 = 0
2

(No Linear Dependency)

H1: 1 0 (Linear Dependency)


n2

(t )

= F1,n 2

2003 Prentice-Hall, Inc.

Chap 10-45

Inferences about the Slope: F Test Example


H0: 1 = 0 From Excel Printout ANOVA H1: 1 0 df SS MS F S i g n i fi c a n c e = .05 R e g r e ssi o n 1 3 0 3 8 0 4 5 6 . 1 2 3 8 0 4 5 6 . 1 2 . 1 7 9 30 81 0.000281 numerator R e si d u a l 5 1 8 7 1 1 9 9 . 5 9 3 7 4 2 3 9 . 9 1 9 5 df = 1 T o ta l 6 32251655.71 denominator df = 7 - 2 = 5 Decision: Reject H0 Reject

Test Statistic:

Conclusion:

= .05

2003 Prentice-Hall, Inc.

6.61

F1,n 2

There is evidence that square footage affects annual sales.


Chap 10-46

Purpose of Correlation Analysis

Correlation Analysis is Used to Measure Strength of Association (Linear Relationship) Between 2 Numerical Variables

Only Strength of the Relationship is Concerned No Causal Effect is Implied

2003 Prentice-Hall, Inc.

Chap 10-47

Purpose of Correlation Analysis

(continued)

Population Correlation Coefficient (Rho) is Used to Measure the Strength between the Variables Sample Correlation Coefficient r is an Estimate of and is Used to Measure the Strength of the Linear Relationship in the Sample Observations

2003 Prentice-Hall, Inc.

Chap 10-48

Sample of Observations from Various r Values


Y Y Y

r = -1
Y

r = -.6
Y

r=0

2003 Prentice-Hall, Inc.

r = .6

r=1

X
Chap 10-49

Features of and r

Unit Free Range between -1 and 1 The Closer to -1, the Stronger the Negative Linear Relationship The Closer to 1, the Stronger the Positive Linear Relationship The Closer to 0, the Weaker the Linear Relationship
Chap 10-50

2003 Prentice-Hall, Inc.

t Test for Correlation

Hypotheses

H0: = 0 (No Correlation) H1: 0 (Correlation)


t= r where

Test Statistic

1 r n 2
2

r=
2003 Prentice-Hall, Inc.

r2

( X
i =1

X) ( Yi Y )
2

( X
i =1

X)

i 1 =

Y ( Y )
i

2
Chap 10-51

Example: Produce Stores


From Excel Printout

Is there any evidence of linear relationship between Annual Sales of a store and its Square Footage at .05 level of significance?

R eg ressio n S tatistics M ultiple R R S quare S tandard E rror O bs ervations 0.9705572 0.94198129 611.751517 7

A djus ted R S quare 0.93037754

H0: = 0 (No association)


H1: 0 (Association) = .05 df = 7 - 2 = 5

2003 Prentice-Hall, Inc.

Chap 10-52

Example: Produce Stores Solution


t= r 1 r2 n2 .9706 = 9.0099 = 1 .9420 Conclusion: 5
Decision: Reject H0

Critical Value(s):
Reject .025 Reject .025

There is evidence of a linear relationship at 5% level of significance

-2.5706 0 2.5706
2003 Prentice-Hall, Inc.

The value of the t statistic is exactly the same as the t statistic value for test on the slope coefficient
Chap 10-53

Estimation of Mean Values


Confidence Interval Estimate for

Y | X = X i :

The Mean of Y given a particular Xi


Standard error of the estimate Size of interval vary according to distance away from mean, X

Yi tn 2 SYX
t value from table with df=n-2
2003 Prentice-Hall, Inc.

(Xi X ) 1 + n n 2 (Xi X )
2 i =1
Chap 10-54

Prediction of Individual Values


Prediction Interval for Individual Response Yi at a Particular Xi
Addition of 1 increases width of interval from that for the mean of Y

Yi tn 2 SYX
2003 Prentice-Hall, Inc.

1 1 + n

(Xi X ) + n 2 (Xi X )
2 i =1
Chap 10-55

Interval Estimates for Different Values of X


Y
Prediction Interval for a individual Yi Confidence Interval for the mean of Y

+ b 1X i Yi = b0

2003 Prentice-Hall, Inc.

A given X

X
Chap 10-56

Example: Produce Stores


Data for 7 Stores: Store 1 2 3 4 5 6 7
2003 Prentice-Hall, Inc.

Square Feet 1,726 1,542 2,816 5,555 1,292 2,208 1,313

Annual Sales ($000) 3,681 3,395 6,653 9,543 3,318 5,563 3,760

Consider a store with 2000 square feet. Regression Equation Obtained:

Y = 1636.415 + 1.487 X i
Chap 10-57

Estimation of Mean Values: Example


Confidence Interval Estimate for

Y | X = X i

Find the 95% confidence interval for the average annual sales for stores of 2,000 square feet

Predicted Sales Y = 1636.415 + 1.487 X i = 4610.45 ( $000 ) X = 2350.29 SYX = 611.75 tn 2 = t5 = 2.5706

Yi tn 2 SYX
2003 Prentice-Hall, Inc.

1 ( X i X )2 +n n ( X i X )2
i =1

4610.45 612.66 =
Chap 10-58

Prediction Interval for Y : Example


Prediction Interval for Individual = X YX
i

Find the 95% prediction interval for annual sales of one particular store of 2,000 square feet

Predicted Sales) Y = 1636.415 + 1.487 X i = 4610.45 ( $000 ) X = 2350.29 SYX = 611.75


2 (Xi X ) + n 2 (Xi X ) i =1

tn 2 = t5 = 2.5706

Yi tn 2 SYX

1 1 + n

4610.45 1687.68 =

2003 Prentice-Hall, Inc.

Chap 10-59

Estimation of Mean Values and Prediction of Individual Values in PHStat

In Excel, use PHStat | Regression | Simple Linear Regression

Check the Confidence and Prediction Interval for X= box

EXCEL Spreadsheet of Regression Sales on Footage


Microsoft Excel Worksheet

2003 Prentice-Hall, Inc.

Chap 10-60

Pitfalls of Regression Analysis

Lacking an Awareness of the Assumptions Underlining Least-squares Regression Not Knowing How to Evaluate the Assumptions Not Knowing What the Alternatives to Leastsquares Regression are if a Particular Assumption is Violated Using a Regression Model Without Knowledge of the Subject Matter
Chap 10-61

2003 Prentice-Hall, Inc.

Strategy for Avoiding the Pitfalls of Regression

Start with a scatter plot of X on Y to observe possible relationship Perform residual analysis to check the assumptions Use a histogram, stem-and-leaf display, boxand-whisker plot, or normal probability plot of the residuals to uncover possible nonnormality
Chap 10-62

2003 Prentice-Hall, Inc.

Strategy for Avoiding the Pitfalls of Regression

(continued)

If there is violation of any assumption, use alternative methods (e.g., least absolute deviation regression or least median of squares regression) to least-squares regression or alternative least-squares models (e.g., curvilinear or multiple regression) If there is no evidence of assumption violation, then test for the significance of the regression coefficients and construct confidence intervals and prediction intervals
Chap 10-63

2003 Prentice-Hall, Inc.

Chapter Summary

Introduced Types of Regression Models Discussed Determining the Simple Linear Regression Equation Described Measures of Variation Addressed Assumptions of Regression and Correlation Discussed Residual Analysis Addressed Measuring Autocorrelation
Chap 10-64

2003 Prentice-Hall, Inc.

Chapter Summary

(continued)

Described Inference about the Slope Discussed Correlation - Measuring the Strength of the Association Addressed Estimation of Mean Values and Prediction of Individual Values Discussed Pitfalls in Regression and Ethical Issues

2003 Prentice-Hall, Inc.

Chap 10-65

You might also like