0% found this document useful (0 votes)
13 views

Chap 12

This chapter discusses simple linear regression analysis. It explains how to calculate the correlation coefficient and perform hypothesis tests for correlation. It also describes how to obtain the simple linear regression equation for a set of data and interpret the regression coefficients and R2 value. The chapter covers assumptions of the linear regression model as well as interpreting, predicting, and graphing results.

Uploaded by

Krish Gujarathi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

Chap 12

This chapter discusses simple linear regression analysis. It explains how to calculate the correlation coefficient and perform hypothesis tests for correlation. It also describes how to obtain the simple linear regression equation for a set of data and interpret the regression coefficients and R2 value. The chapter covers assumptions of the linear regression model as well as interpreting, predicting, and graphing results.

Uploaded by

Krish Gujarathi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 62

Statistics for

Business and Economics


6th Edition

Chapter 12

Simple Regression
Chapter Goals

After completing this chapter, you should be


able to:
▪ Explain the correlation coefficient and perform a
hypothesis test for zero population correlation
▪ Explain the simple linear regression model
▪ Obtain and interpret the simple linear regression
equation for a set of data
▪ Describe R2 as a measure of explanatory power of the
regression model
▪ Understand
Statistics
the assumptions behind regression
for Business and
analysis
Economics, 6e © 2007 Pearson
Education, Inc. 2
Chapter Goals
(continued)

After completing this chapter, you should be


able to:
▪ Explain measures of variation and determine whether
the independent variable is significant
▪ Calculate and interpret confidence intervals for the
regression coefficients
▪ Use a regression equation for prediction
▪ Form forecast intervals around an estimated Y value
for a given X
▪ Use
Statistics for graphical
Business analysis
and to recognize potential problems
in regression
Economics, 6e © 2007analysis
Pearson
Education, Inc. 3
Correlation Analysis

▪ Correlation analysis is used to measure


strength of the association (linear relationship)
between two variables
▪ Correlation is only concerned with strength of the
relationship
▪ No causal effect is implied with correlation
▪ Correlation was first presented in Chapter 3

Statistics for Business and


Economics, 6e © 2007 Pearson
Education, Inc. 4
Correlation Analysis
▪ The population correlation coefficient is
denoted ρ (the Greek letter rho)
▪ The sample correlation coefficient is

where

5
Hypothesis Test for Correlation

▪ To test the null hypothesis of no linear


association,

the test statistic follows the Student’s t


distribution with (n – 2 ) degrees of freedom:

6
Decision Rules
Hypothesis Test for Correlation

Lower-tail test: Upper-tail test: Two-tail test:


H0: ρ ≥ 0 H0: ρ ≤ 0 H0: ρ = 0
H1: ρ < 0 H1: ρ > 0 H1: ρ ≠ 0

α α α/2 α/2

-tα tα -tα/2 tα/2


Reject H0 if t < -tn-2, α Reject H0 if t > tn-2, α Reject H0 if t < -tn-2, α/2
or t > tn-2, α/2
Statistics for Business and
© 2007 Pearsonhas n - 2 d.f.
Economics, 6eWhere
Education, Inc. 7
Introduction to
Regression Analysis

▪ Regression analysis is used to:


▪ Predict the value of a dependent variable based on
the value of at least one independent variable
▪ Explain the impact of changes in an independent
variable on the dependent variable
Dependent variable: the variable we wish to explain
(also called the endogenous variable)
Independent variable: the variable used to explain
the dependent variable
(also called the exogenous variable)

8
Linear Regression Model

▪ The relationship between X and Y is


described by a linear function
▪ Changes in Y are assumed to be caused by
changes in X
▪ Linear regression population equation model

▪ Where β0 and β1 are the population model


coefficients and ε is a random error term.

9
Simple Linear Regression
Model
The population regression model:
Population Random
Population Independent Error
Slope
Y intercept Variable term
Coefficient
Dependent
Variable

Linear Random
component Error
Statistics for Business and component
Economics, 6e © 2007 Pearson
Education, Inc. 10
Simple Linear Regression
Model
(continued)

Y
Observed Value
of Y for Xi

εi Slope = β1
Predicted Value Random Error
of Y for Xi
for this Xi value

Intercept = β0

Statistics for Business and


Economics, 6e © 2007 Pearson
Xi X
Education, Inc. 11
Simple Linear Regression
Equation
The simple linear regression equation provides an
estimate of the population regression line
Estimated Estimate of Estimate of the
(or predicted) the regression regression slope
y value for
observation i intercept
Value of x for
observation i

The individual random error terms ei have a mean of zero

12
Least Squares Estimators

▪ b0 and b1 are obtained by finding the values


of b0 and b1 that minimize the sum of the
squared differences between y and :

Differential calculus is used to obtain the


coefficient estimators b0 and b1 that minimize SSE
13
Least Squares Estimators
(continued)

▪ The slope coefficient estimator is

▪ And the constant or y-intercept is

▪ The regression line always goes through the mean x, y

14
Finding the Least Squares
Equation

▪ The coefficients b0 and b1 , and other


regression results in this chapter, will be
found using a computer
▪ Hand calculations are tedious
▪ Statistical routines are built into Excel
▪ Other statistical analysis software can be used

Statistics for Business and


Economics, 6e © 2007 Pearson
Education, Inc. 15
Linear Regression Model
Assumptions

▪ The true relationship form is linear (Y is a linear function


of X, plus random error)
▪ The error terms, εi are independent of the x values
▪ The error terms are random variables with mean 0 and
constant variance, σ2
(the constant variance property is called homoscedasticity)

▪ The random error terms, εi, are not correlated with one
another, so that

16
Interpretation of the
Slope and the Intercept

▪ b0 is the estimated average value of y


when the value of x is zero (if x = 0
is in the range of observed x values)

▪ b1 is the estimated change in the


average value of y as a result of a
one-unit change in x

17
Simple Linear Regression
Example

▪ A real estate agent wishes to examine the


relationship between the selling price of a home
and its size (measured in square feet)

▪ A random sample of 10 houses is selected


▪ Dependent variable (Y) = house price in $1000s
▪ Independent variable (X) = square feet

. 18
Sample Data for House Price
Model
House Price in $1000s Square Feet
(Y) (X)
245 1400
312 1600
279 1700
308 1875
199 1100
219 1550
405 2350
324 2450
319 1425
255 and
Statistics for Business 1700
Economics, 6e © 2007 Pearson
Education, Inc. 19
Graphical Presentation

▪ House price model: scatter plot

Statistics for Business and


Economics, 6e © 2007 Pearson
Education, Inc. 20
Regression Using Excel
▪ Tools / Data Analysis / Regression

Statistics for Business and


Economics, 6e © 2007 Pearson
Education, Inc. 21
Excel Output
Regression Statistics

Multiple R 0.76211
The regression equation is:
R Square 0.58082

Adjusted R Square 0.52842

Standard Error 41.33032

Observations 10

ANOVA
df SS MS F Significance F

Regression 1 18934.9348 18934.9348 11.0848 0.01039

Residual 8 13665.5652 1708.1957

Total 9 32600.5000

Statistics for Business and


Coefficients Standard Error t Stat P-value Lower 95% Upper 95%
Economics,
Intercept 6e ©98.24833
2007 Pearson 58.03348 1.69296 0.12892 -35.57720 232.07386
Education,
Square Feet Inc. 0.10977 0.03297 3.32938 0.01039 22
0.03374 0.18580
Graphical Presentation

▪ House price model: scatter plot and


regression line

Slope
= 0.10977

Intercept
= 98.248

Statistics for Business and


Economics, 6e © 2007 Pearson
Education, Inc. 23
Interpretation of the
Intercept, b0

▪ b0 is the estimated average value of Y when the


value of X is zero (if X = 0 is in the range of
observed X values)
▪ Here, no houses had 0 square feet, so b0 = 98.24833
just indicates that, for houses within the range of
sizes observed, $98,248.33 is the portion of the
Statisticshouse price not
for Business explained by square feet
and
Economics, 6e © 2007 Pearson
Education, Inc. 24
Interpretation of the
Slope Coefficient, b1

▪ b1 measures the estimated change in the


average value of Y as a result of a one-
unit change in X
▪ Here, b1 = .10977 tells us that the average value of a
house increases by .10977($1000) = $109.77, on
average, for each additional one square foot of size
Statistics for Business and
Economics, 6e © 2007 Pearson
Education, Inc. 25
Measures of Variation

▪ Total variation is made up of two parts:

Total Sum of Regression Sum Error Sum of


Squares of Squares Squares

where:
= Average value of the dependent variable
Statistics for Business
yi = and
Observed values of the dependent variable
Economics, 6e © 2007 Pearson
i = Predicted value of y for the given x i value
Education, Inc. 26
Measures of Variation
(continued)

▪ SST = total sum of squares


▪ Measures the variation of the yi values around their
mean, y
▪ SSR = regression sum of squares
▪ Explained variation attributable to the linear
relationship between x and y
▪ SSE = error sum of squares
▪ Variation attributable to factors other than the linear
relationship between x and y
Statistics for Business and
Economics, 6e © 2007 Pearson
Education, Inc. 27
Measures of Variation
(continued)
Y
yi ∧2

SSE = ∑(yi - yi ) y
_
SST = ∑(yi - y)2

y ∧ _2
_ SSR = ∑(yi - y) _
y y

Statistics for Business and


Economics, 6e © 2007 Pearsonxi X
Education, Inc. 28
Coefficient of Determination, R2
▪ The coefficient of determination is the portion
of the total variation in the dependent variable
that is explained by variation in the
independent variable
▪ The coefficient of determination is also called
R-squared and is denoted as R2

note:

29
Examples of Approximate
r2 Values
Y
r2 = 1

Perfect linear relationship


between X and Y:
X
r2 = 1
Y 100% of the variation in Y is
explained by variation in X

Statistics for Business X


and
Economics,r26e = 1© 2007 Pearson
Education, Inc. 30
Examples of Approximate
r2 Values
Y
0 < r2 < 1

Weaker linear relationships


between X and Y:
X
Some but not all of the
Y
variation in Y is explained
by variation in X

Statistics for Business and


Economics, 6e © 2007 XPearson
Education, Inc. 31
Examples of Approximate
r2 Values

r2 = 0
Y
No linear relationship
between X and Y:

The value of Y does not


X depend on X. (None of the
r2 = 0
variation in Y is explained
by variation in X)
Statistics for Business and
Economics, 6e © 2007 Pearson
Education, Inc. 32
Excel Output
Regression Statistics

Multiple R 0.76211

R Square 0.58082
58.08% of the variation in
Adjusted R Square 0.52842 house prices is explained by
Standard Error 41.33032 variation in square feet
Observations 10

ANOVA
df SS MS F Significance F

Regression 1 18934.9348 18934.9348 11.0848 0.01039

Residual 8 13665.5652 1708.1957

Total 9 32600.5000

Statistics for Business and


Coefficients Standard Error t Stat P-value Lower 95% Upper 95%
Economics,
Intercept 6e ©98.24833
2007 Pearson 58.03348 1.69296 0.12892 -35.57720 232.07386
Education,
Square Feet Inc. 0.10977 0.03297 3.32938 0.01039 33
0.03374 0.18580
Correlation and R2

▪ The coefficient of determination, R2, for a


simple regression is equal to the simple
correlation squared

Statistics for Business and


Economics, 6e © 2007 Pearson
Education, Inc. 34
Estimation of Model
Error Variance

▪ An estimator for the variance of the population model


error is

▪ Division by n – 2 instead of n – 1 is because the simple regression


model uses two estimated parameters, b0 and b1, instead of one

is called the standard error of the estimate

35
Excel Output
Regression Statistics

Multiple R 0.76211

R Square 0.58082

Adjusted R Square 0.52842

Standard Error 41.33032

Observations 10

ANOVA
df SS MS F Significance F

Regression 1 18934.9348 18934.9348 11.0848 0.01039

Residual 8 13665.5652 1708.1957

Total 9 32600.5000

Statistics for Business and


Coefficients Standard Error t Stat P-value Lower 95% Upper 95%
Economics,
Intercept 6e ©98.24833
2007 Pearson 58.03348 1.69296 0.12892 -35.57720 232.07386
Education,
Square Feet Inc. 0.10977 0.03297 3.32938 0.01039 36
0.03374 0.18580
Comparing Standard Errors
se is a measure of the variation of observed y
values from the regression line
Y Y

X X

The magnitude of se should always be judged relative to the size


of the y values in the sample data
Statistics
i.e.,for
se =Business
$41.33K isand
moderately small relative to house prices in
Economics,
the $200 6e- © 2007range
$300K Pearson
Education, Inc. 37
Inferences About the
Regression Model

▪ The variance of the regression slope coefficient


(b1) is estimated by

where:
= Estimate of the standard error of the least squares slope

= Standard error of the estimate

38
Excel Output
Regression Statistics

Multiple R 0.76211

R Square 0.58082

Adjusted R Square 0.52842

Standard Error 41.33032

Observations 10

ANOVA
df SS MS F Significance F

Regression 1 18934.9348 18934.9348 11.0848 0.01039

Residual 8 13665.5652 1708.1957

Total 9 32600.5000

Statistics for Business and


Coefficients Standard Error t Stat P-value Lower 95% Upper 95%
Economics,
Intercept 6e ©98.24833
2007 Pearson 58.03348 1.69296 0.12892 -35.57720 232.07386
Education,
Square Feet Inc. 0.10977 0.03297 3.32938 0.01039 39
0.03374 0.18580
Comparing Standard Errors of
the Slope
is a measure of the variation in the slope of regression
lines from different possible samples

Y Y

X X

Statistics for Business and


Economics, 6e © 2007 Pearson
Education, Inc. 40
Inference about the Slope:
t Test
▪ t test for a population slope
▪ Is there a linear relationship between X and Y?
▪ Null and alternative hypotheses
H0: β1 = 0 (no linear relationship)
H1: β1 ≠ 0 (linear relationship does exist)
▪ Test statistic
where:
b1 = regression slope
coefficient
β1 = hypothesized slope
sb1 = standard
error of the slope
. 41
Inference about the Slope:
t Test
(continued)

House Price Estimated Regression Equation:


Square Feet
in $1000s
(x)
(y)
245 1400
312 1600
279 1700
308 1875 The slope of this model is 0.1098
199 1100
219 1550
Does square footage of the house
405 2350 affect its sales price?
324 2450
319 1425
255 1700
Statistics for Business and
Economics, 6e © 2007 Pearson
Education, Inc. 42
Inferences about the Slope:
t Test Example

H0: β1 = 0 From Excel output: b1

H1: β1 ≠ 0 Coefficients Standard Error t Stat P-value


Intercept 98.24833 58.03348 1.69296 0.12892
Square Feet 0.10977 0.03297 3.32938 0.01039

Statistics for Business and


Economics, 6e © 2007 Pearson
Education, Inc. 43
Inferences about the Slope:
t Test Example
(continued)
Test Statistic: t = 3.329
H0: β1 = 0 From Excel output: b1 t

H1: β1 ≠ 0 Coefficients Standard Error t Stat P-value


Intercept 98.24833 58.03348 1.69296 0.12892
d.f. = 10-2 = 8 Square Feet 0.10977 0.03297 3.32938 0.01039
t8,.025 = 2.3060
Decision:
α/2=.025 α/2=.025 Reject H0
Conclusion:
Reject H0 Do not reject H0 Reject H0
There is sufficient evidence
-tn-2,α/2 0 tn-2,α/2 that square footage affects
-2.3060 2.3060 3.329 house price
44
Inferences about the Slope:
t Test Example
(continued)
P-value = 0.01039
P-value
H0: β1 = 0 From Excel output:
H1: β1 ≠ 0 Coefficients Standard Error t Stat P-value
Intercept 98.24833 58.03348 1.69296 0.12892
Square Feet 0.10977 0.03297 3.32938 0.01039

This is a two-tail test, so Decision: P-value < α so


the p-value is Reject H0
P(t > 3.329)+P(t < -3.329) Conclusion:
= 0.01039 There is sufficient evidence
Statistics
(for 8 d.f.)for Business and that square footage affects
Economics, 6e © 2007 Pearson house price
Education, Inc. 45
Confidence Interval Estimate
for the Slope
Confidence Interval Estimate of the Slope:

d.f. = n - 2

Excel Printout for House Prices:


Coefficients Standard Error t Stat P-value Lower 95% Upper 95%
Intercept 98.24833 58.03348 1.69296 0.12892 -35.57720 232.07386
Square Feet 0.10977 0.03297 3.32938 0.01039 0.03374 0.18580

At 95% level of confidence, the confidence interval for


Statistics for Business
the slope and
is (0.0337, 0.1858)
Economics, 6e © 2007 Pearson
Education, Inc. 46
Confidence Interval Estimate
for the Slope
(continued)

Coefficients Standard Error t Stat P-value Lower 95% Upper 95%


Intercept 98.24833 58.03348 1.69296 0.12892 -35.57720 232.07386
Square Feet 0.10977 0.03297 3.32938 0.01039 0.03374 0.18580

Since the units of the house price variable is


$1000s, we are 95% confident that the average
impact on sales price is between $33.70 and
$185.80 per square foot of house size

This 95% confidence interval does not include 0.


Conclusion: There is a significant relationship between
Statisticshouse
for Business and feet at the .05 level of significance
price and square
Economics, 6e © 2007 Pearson
Education, Inc. 47
F-Test for Significance

▪ F Test statistic:

where

where F follows an F distribution with k numerator and (n – k - 1)


denominator degrees of freedom
Statistics for Business and
(k = the number of independent variables in the regression model)
Economics, 6e © 2007 Pearson
Education, Inc. 48
Excel Output
Regression Statistics

Multiple R 0.76211

R Square 0.58082

Adjusted R Square 0.52842


With 1 and 8 degrees P-value for
Standard Error 41.33032
of freedom the F-Test
Observations 10

ANOVA
df SS MS F Significance F

Regression 1 18934.9348 18934.9348 11.0848 0.01039

Residual 8 13665.5652 1708.1957

Total 9 32600.5000

Statistics for Business


Coefficients
and
Standard Error t Stat P-value Lower 95% Upper 95%
Economics,
Intercept 6e ©98.24833
2007 Pearson 58.03348 1.69296 0.12892 -35.57720 232.07386

Education,
Square Feet Inc. 0.10977 0.03297 3.32938 0.01039 49
0.03374 0.18580
F-Test for Significance
(continued)

H0: β1 = 0 Test Statistic:


H1: β1 ≠ 0
α = .05
df1= 1 df2 = 8 Decision:
Critical Reject H0 at α = 0.05
Value:
Fα = 5.32
Conclusion:
α = .05
There is sufficient evidence that
0 Do not for Business
Statistics F house size affects selling price
Reject H and
0
reject H
Economics, 0
6e= 5.32
F.05 © 2007 Pearson
Education, Inc. 50
Prediction

▪ The regression equation can be used to


predict a value for y, given a particular x

▪ For a specified value, xn+1 , the predicted


value is

Statistics for Business and


Economics, 6e © 2007 Pearson
Education, Inc. 51
Predictions Using
Regression Analysis
Predict the price for a house
with 2000 square feet:

The predicted price for a house with 2000


Statistics
square forfeet
Business and
is 317.85($1,000s) = $317,850
Economics, 6e © 2007 Pearson
Education, Inc. 52
Relevant Data Range
▪ When using a regression model for prediction,
only predict within the relevant range of data

Relevant data range

Risky to try to
extrapolate far
Statistics for Business and beyond the range
Economics, 6e © 2007 Pearson of observed X’s
Education, Inc. 53
Estimating Mean Values and
Predicting Individual Values
Goal: Form intervals around y to express
uncertainty about the value of y for a given xi
Confidence
Interval for
the expected
Y ∧
y
value of y,
given xi


y = b0+b1xi

Prediction Interval
Statistics
for an singlefor Business and
Economics, 6e ©
observed y, given xi 2007 Pearson
Education, Inc.
xi 54 X
Confidence Interval for
the Average Y, Given X
Confidence interval estimate for the
expected value of y given a particular xi

Notice that the formula involves the term

Statistics forsoBusiness
the size of interval varies according to the distance
and
Economics,x6e n+1 is from the mean, x
© 2007 Pearson
Education, Inc. 55
Prediction Interval for
an Individual Y, Given X
Confidence interval estimate for an actual
observed value of y given a particular xi

This extra term adds to the interval width to reflect


Statistics for
Business and uncertainty for an individual case
the added
Economics, 6e © 2007 Pearson
Education, Inc. 56
Estimation of Mean Values:
Example
Confidence Interval Estimate for E(Yn+1|Xn+1)

Find the 95% confidence interval for the mean price


of 2,000 square-foot houses

Predicted Price yi = 317.85 ($1,000s)

The confidence interval endpoints are 280.66 and 354.90,


Statistics for Business and
or from $280,660 to $354,900
Economics, 6e © 2007 Pearson
Education, Inc. 57
Estimation of Individual Values:
Example

Confidence Interval Estimate for yn+1

Find the 95% confidence interval for an individual


house with 2,000 square feet

Predicted Price yi = 317.85 ($1,000s)

The confidence interval endpoints are 215.50 and


Statistics for Business and
420.07, or from $215,500 to $420,070
Economics, 6e © 2007 Pearson
Education, Inc. 58
Finding Confidence and
Prediction Intervals in Excel

▪ In Excel, use
PHStat | regression | simple linear regression …

▪ Check the
“confidence and prediction interval for x=”
box and enter the x-value and confidence level
desired

Statistics for Business and


Economics, 6e © 2007 Pearson
Education, Inc. 59
Finding Confidence and
Prediction Intervals in Excel
(continued)

Input values


y

Confidence Interval Estimate


for E(Yn+1|Xn+1)
Statistics for Business and Confidence Interval Estimate

Economics, 6e © 2007 Pearsonfor individual yn+1
Education, Inc. 60
Graphical Analysis

▪ The linear regression model is based on


minimizing the sum of squared errors
▪ If outliers exist, their potentially large squared
errors may have a strong influence on the fitted
regression line
▪ Be sure to examine your data graphically for
outliers and extreme points
▪ Decide, based on your model and logic, whether
the for
Statistics extreme points
Business and should remain or be removed
Economics, 6e © 2007 Pearson
Education, Inc. 61
Chapter Summary
▪ Introduced the linear regression model
▪ Reviewed correlation and the assumptions of
linear regression
▪ Discussed estimating the simple linear
regression coefficients
▪ Described measures of variation
▪ Described inference about the slope
▪ Addressed estimation of mean values and
prediction
Statistics of individual
for Business and values
Economics, 6e © 2007 Pearson
Education, Inc. 62

You might also like