You are on page 1of 7

9 Linear Regression

1. Simple Linear Regression Models


2. Inferences about 1
3. Correlation Coefficients
4. Prediction

Section 9.1 Simple Linear Regression Models


Example (Reed Auto)
Reed Auto periodically has a special weeklong sale. As part of the advertising
campaign Reed runs one or more television commercials during the weekend
preceding the sale. Data from a sample of 5 previous sales are shown below.

Week 1 2 3 4 5
Number of TV Ads 1 3 2 1 3
Number of Cars Sold 14 24 18 17 27

By looking at the scatter diagram, we can observe that there exists a strong
linear relationship between the number of TV ads (the independent variable,
explanatory variable or predictor) and the number of cars sold (the dependent
variable or response variable).

We may draw more than one straight line through the scatter diagram.

Which straight line do you think is the best?


STAT0302 ch9 1
Simple linear regression model

Definitions For n pairs of data (x1, y1), (x2, y2), , (xn, yn),

let
1 1
= =1 , = =1

define
=1( )( )
1 =
=1( )2

0 = 1 ()

Then y b0 b1 x is called the estimated linear regression equation.


From (*) we have = 0 + 1 . That is, the point ( x , y ) is on the straight line
determined by the estimated linear regression equation.

Let yi b0 b1 xi for i = 1, 2, , n.

yis are observed values. s are estimated values.

Theorem
n
b0 and b1 meet the least squares criterion. That is, the value of yi y i
2

i 1

will be increased if the value of b0 or b1 is made different from that in


expression (*).

STAT0302 ch9 2
Two formulae for calculation:

1
( )( ) =

=1 =1 =1 =1

2
1
( )2 = 2 ( )

=1 =1 =1

Example (Reed Auto)


[Solution]

(The last row will be used later.)



1 1
( )( ) = = 220 10 100 = 20
5
=1 =1 =1 =1
2
1 1
( )2 = 2 ( ) = 24 102 = 4
5
=1 =1 =1

b1 20 4 5,

b0 y b1 x 100 5 5 (10 5) 10.

Therefore the estimated linear regression equation is y 10 5x.


STAT0302 ch9 3
[Interpretation] For each increase of one in the number of TV ads, we may say
that the number of cars sold is estimated to increase by 5 on average.

We say that the linear regression relationship is significant if 1 is not zero.


Hypothesis tests should be conducted before making such conclusion.

Section 9.2 Inferences about 1

Interval estimation
The 100(1 )% confidence interval for 1 is

where
= =1( )2 , = =1( )2 , = =1( ) ( )

Hypothesis test
1 1,0
The test statistic is
2

2
(2)

Let be the level of significance.


STAT0302 ch9 4
Reject H0
H0 H1
if and only if
1 1,0 1 1,0
t,n2
or 1 1,0 2

1 1,0 (2) 2

1 1,0 1 1,0
t,n2
or 1 1,0 2

1 1,0 (2) 2

|1 1,0 |
t2,n2
1 1,0 1 1,0

2
2
(2)

Example (Reed Auto)


We already know that Sxx 4 and Sxy 20.
1
= =1( )2 = =1 2 (=1 )2 2114 1002 / 5 114.

2 4 114 202 7
,2 = 0.025,3 = 3.182 = 3.437
2 ( 2) 2 (5 2)42 6

The 95% confidence interval for 1 is (5 3.437, 5 3.437),


that is, (1.563, 8.437).

Now suppose we want to test


H0: 1 3 against H1: 1 3

at the 5% level of significance.

1 1,0 53
= 7
= 1.852
2
6
(2) 2

Since 1.852 2.353 t0.05,3, we cannot reject H0. We cannot conclude that 1 is
greater than 3 at the 5% level of significance.
STAT0302 ch9 5
Section 9.3 Correlation Coefficients
Definition For n pairs of data
(x1, y1), (x2, y2), , (xn, yn),

define the correlation coefficient as

It can be proved that 1 r 1.

Coefficient of determination = r2

STAT0302 ch9 6
Example (Reed Auto)

S xy 20
r 0.9366.
S xx S yy 4 114

Section 9.4 Prediction


For a given value x01 of the independent variable, the estimated mean of Y is

0 b0 b1 x01.

Example (Reed Auto)


If Reed Auto plans to run 4 television commercials during a weekend, what will
be the average number of cars sold next week?

[Solution] 0 b0 b1 x01 10 5 4 30.

STAT0302 ch9 7

You might also like