Course 10-Part 2
Course 10-Part 2
Course 10-Part 2
Session 10
Simple Linear
Regression
Part 2
Plan
Part 2
Confidence interval on the parameters of the regression line
Hypothesis tests on the parameters of the regression line
Pointwise prediction, Interval prediction
Coefficient of determination and correlation
2
Confidence Intervals on b1 and b0
3
Confidence Intervals on b1 and b0
4
Confidence Intervals on b1 and b0
b2 and b
2
Estimation of 0 1
1 x 2 S 2
Sb0 S e n
2 2
and Sb21 n e
n 2 ( x x )2
i 1
( xi x )
i
i 1
5
Confidence Intervals on b1 and b0
n n
2
e 2
i ( yi yi )
ˆ 2
S i 1
e i 1
n 2 n 2
6
Confidence Intervals on b1 and b0
Example 2: Yˆ 33.31 3.95 X
41.21= 33.31 + 3.95 x 2
Sales
Advertising cost volumes (Y)
(X) (M$) (M$)
yi y
2
xi yi xi x
2
yˆi
4 49,5 0,49 49,11 0,39 0,1521 7,6176 9,9225
2 41 1,69 41,21 -0,21 0,0441 26,4196 28,6225
2,5 43 0,64 43,185 -0,185 0,0342 10,0172 11,2225
2 39 1,69 41,21 -2,21 4,8841 26,4196 54,0225
3 46 0,09 45,16 0,84 0,7056 1,4161 0,1225
5 53 2,89 53,06 -0,06 0,0036 45,0241 44,2225
1 38 5,29 37,26 0,74 0,5476 82,6281 69,7225
5,5 54 4,84 55,035 -1,035 1,0712 75,4292 58,5225
3,5 48,5 0,04 47,135 1,365 1,8632 0,6162 4,6225
4,5 51,5 1,44 51,085 0,415 0,1722 22,4202 26,5225
Sum 19,1 9,478 298,008 307,525
Mean x 3,3 y 46,35
SSE = sum of squares due to error
7
Confidence Intervals on b1 and b0
SST = SSR +
SSE
8
Calculate S e2 , Sb20 , Sb21
∑ 𝑒2
𝑖 𝑛
𝑆2
𝑒=
𝑖= 1
=∑ ¿ ¿ ¿
𝑛− 2 𝑖= 1
2 2
𝑆 𝑏0 =𝑆 ¿ 𝑒
2
𝑆 𝑏1 =¿
9
Confidence Intervals on b1 and b0
Example:
Confidence interval for 1 (1-a =95%) :
n-2 = 10 -2 = 8 < 30, then
Student’s table
LL, UL b1 t / 2 Sb 1
10
Validation of the Empirical Regression Line
Hypothesis tests on 1
Y 0 1 X
If β1 = 0, values of X don’t
influence Y
11
Validation of the Empirical Regression Line
H 0 : 1 0
1. Hypotheses : H0 et H1.
H1 : 1 0
2. Condition of the test
Population normally distributed
Variance 2 is unknown
If n – 2 ≥ 30, use Z (Normal)
If n – 2 < 30, use t (Student)
3. Statistic.
b1 1 b1 1
Z0 if n 2 30 T0 if n 2 30
S b1 S b1
4. Critical area and state the rejection rule
12
Example: Answer
a = 0,05
Step 1 Step 2
H 0 : 1 0 n – 2 = 8 < 30, population normally distributed
H1 : 1 0 2 unknown
Step 3 Step 4
b1 1 3.95 0 t0.025,8 d .l 2.306
T0 15.86
S b1 0.062 T0 15.86 t0.025,8 d .l 2.306,
then we reject H 0
13
Example:
Yˆ 33.31 3.95 X
Ŷ = 33.31 + 3.95 (3.5) = 47.14
million
14
Application of the Linear Regression Model
Confidence interval
Prediction interval
15
Confidence Interval on a Regression Line
16
Confidence Interval on a Regression Line
Example
Estimate by confidence interval at a = 0.05 the average sales
volume if investing $4 million in advertising.
ˆ 1 ( x0 x ) 2 1 (4 3.3) 2
S (Y / x0 ) S e n 1.1847 0.3858
n 10 19.1
( xi x ) 2
i 1
17
Confidence Interval on an Individual
Prediction
In addition to the n observations in the sample, it is possible to
carry out a new observation x0 of X which would be independent of
the first n. In this case, we now want to predict the value of Y
corresponding to a new observation x0 of X. In this case, the
confidence interval at level (1 - a) will be:
18
Confidence Interval on an Individual
Prediction
20
Difference between regression and
correlation?
21
Correlation Analysis
– Coefficient of Determination
– Coefficient of Correlation
22
Coefficient of Determination
The coefficient of determination, denoted R2 or r2 and
pronounced "R squared" measures proportion of the total
variation of y which is « explained » by the regression.
2
0≤𝑟 𝑌𝑋 ≤1
=
23
Coefficient of Determination
Example 2:
96.92% of the
𝑛
variation of y is
𝑟2
𝑌𝑋 =𝑟
2
=∑ ¿
= ¿¿
explained by the
𝑖= 1
linear regression?
2
Since r YX it is close to 1, it can be said that the regression line
fits very well with the scatter plot.
Sales
Advertising cost volumes (Y)
(X) (M$) (M$)
yi y
2
xi yi xi x
2
yˆi
4 49,5 0,49 49,11 0,39 0,1521 7,6176 9,9225
2 41 1,69 41,21 -0,21 0,0441 26,4196 28,6225
2,5 43 0,64 43,185 -0,185 0,0342 10,0172 11,2225
2 39 1,69 41,21 -2,21 4,8841 26,4196 54,0225
3 46 0,09 45,16 0,84 0,7056 1,4161 0,1225
5 53 2,89 53,06 -0,06 0,0036 45,0241 44,2225
1 38 5,29 37,26 0,74 0,5476 82,6281 69,7225
5,5 54 4,84 55,035 -1,035 1,0712 75,4292 58,5225
3,5 48,5 0,04 47,135 1,365 1,8632 0,6162 4,6225
4,5 51,5 1,44 51,085 0,415 0,1722 22,4202 26,5225
Sum 19,1 9,478 298,008 307,525
Mean x 3,3 y 46,35
24
Coefficient of Correlation
Example 2:
2
rxy (sign of b1 ) r 0,9692 0,9845
xy
Remarks :
1 r 1
XY
If rXY 1 indicates perfect and strong correlation
If 𝑟 𝑋𝑌 0 indicates weak correlation
25
Coefficient of Correlation
Positive linear
relationship
Negative linear
relationship
No linear
relationship
26
Session 10
The End
27