You are on page 1of 3

第 13 組

Week 13
Question 1

The following table consists of Y, 𝑋1 , and 𝑋2 .

Please find a linear regression line 𝑌̂ = 𝑏0 + 𝑏1 𝑋1 + 𝑏2 𝑋2 to fit the data.

Then, use t-test with 95% confidence to check if 𝑏1 and 𝑏2 are suitable for the line.

𝐘 𝑿𝟏 𝑿𝟐
10 5 10
9 4 8
6 3 6
8 3 4
7 0 2

Answer 1

To calculate the parameters of the regression line, there are some needed preceding works shown below.

𝑌̅ = 8, ̅̅̅
𝑋1 = 3, ̅̅̅
𝑋2 = 6

𝒚 𝒙𝟏 𝒙𝟐𝟏 𝒙𝟏 𝒚 𝒙𝟐 𝒙𝟐𝟐 𝒙𝟐 𝒚 𝒙𝟏 𝒙𝟐
4 2 4 4 4 16 8 8
3 1 1 1 2 4 2 2
0 0 0 0 0 0 0 0
2 0 0 0 -2 4 0 0
1 -3 9 3 -4 16 4 12

𝑏0 = 𝑌̅ − 𝑏1 𝑋1 − 𝑏2 𝑋2
∑ 𝑥1 𝑦∙∑ 𝑥22−∑ 𝑋2 𝑦∙∑ 𝑥1 𝑥2
Parameters 𝑏0 , 𝑏1 , and 𝑏2 for the linear regression line are 𝑏1 = ∑ 𝑥21 ∑ 𝑥22 −(∑ 𝑥1 𝑥2)2 .
∑ 𝑥2 𝑦∙∑ 𝑥21−∑ 𝑋1 𝑦∙∑ 𝑥1 𝑥2
𝑏 =
{ 2 ∑ 𝑥21 ∑ 𝑥22−(∑ 𝑥1𝑥2 )2

8×40−14×22 14×14−8×22
𝑏1 = ≅ 0.158, 𝑏2 = ≅ 0.263
14×40−222 14×40−222

𝑏0 = 8 − 0.158 × 3 − 0.263 × 6 = 5.948

∴ The regression line is 𝑌̂ = 5.948 + 0.158𝑋1 + 0.263𝑋2 .

1
Also, 𝑌̂ can be calculated using the line and the data 𝑋1 and 𝑋2 .

𝐘 ̂
𝒀 ̂ )𝟐
(𝐘 − 𝒀
10 9.367 0.400689
9 8.683 0.100489
6 7.999 3.996001
8 7.473 0.277729
7 6.473 0.277729

Assume S is the sample variation.

1 1
𝑆 2 = 𝑀𝑆𝐸 = 𝑛−3 ∑(Y − 𝑌̂)2 = 5−3 × 5.053 = 2.5265

𝐻0,1 : 𝛽1 = 0 𝐻 :𝛽 =0
Assume { , and { 0,2 2 .
𝐻1,1 : 𝛽1 ≠ 0 𝐻1,2 : 𝛽2 ≠ 0
𝑏1−𝛽1 0.158−0
𝑡𝛽1 = = 2.5625×40
≅ 0.136~𝑡(𝑛 − 3)
𝑆2 ∙∑ 𝑥2
2 √
√ 2 2 14×40−222
∑ 𝑥1 ∑ 𝑥2 −(∑ 𝑥1 𝑥2 )2

𝑏2−𝛽2 0.263−0
𝑡𝛽2 = = 2.5625×14
≅ 0.383~𝑡(𝑛 − 3)
𝑆2 ∙∑ 𝑥2
1 √
√ 14×40−222
∑ 𝑥2 2
1 ∑ 𝑥2 −(∑ 𝑥1 𝑥2 )
2

𝑡0.05⁄ (2) ≅ 4.3027


2

𝑡𝛽1 ≅ 0.136 ≪ 4.3027 ≅ 𝑡0.05⁄ (2)


2

𝑡𝛽2 ≅ 0.383 ≪ 4.3027 ≅ 𝑡0.05⁄ (2)


2

From the above comparison, we can’t reject 𝐻0,1 and 𝐻0,2 .

Therefore, parameters 𝑏1 and 𝑏2 are not suitable for the linear regression line.

The results calculated by Excel are shown below.

2
Therefore, we can find that the results calculated manually and by computer are the same.

You might also like