Sei sulla pagina 1di 6

# NOTA PERSAMAAN REGRESSION LINEAR

Body length of thirteen marble goby of various ages were measured. The data are given as
below.

1) Find the equation of regression line that describes the relation between age and body
length?
2) If age increase about 3 days, estimate how much body length in cm of marble goby
increase?

## Age (day), X Body length (cm), Y

3 1.4
4 1.5
5 2.2
6 2.4
8 3.1
9 3.2
10 3.2
11 3.9
12 4.1
14 4.7
15 4.5
16 5.2
17 5

Solution

Soalan 1

1) Find the equation of regression line that describes the relation between age and body
length?

Step

𝑌 = 𝑎 + 𝑏𝑋

## di mana y ialah pemboleh ubah bersandar (dependent variable)

x ialah pemboleh ubah tidak bersandar (independent variable)
a ialah intercept (pintasan)
b ialah coefficient (pekali kecerunan)

Akan tetapi dalam persamaan linear regression, ada komponen yang perlu dicari iaitu
nilai a dan b.

## Aslina Nasir, FPSM

Pertama perlu tentukan b terlebih dahulu. (*ada dua kaedah untuk menentukan b)

Kaedah 1

𝑆𝑥𝑦
𝑏=
𝑆𝑋𝑋

∑𝑋∑𝑌
𝑆𝑋𝑌 = ∑ 𝑋𝑌 −
𝑛

(∑ 𝑋)2
𝑆𝑋𝑋 = ∑ 𝑋 2 −
𝑛

## Age (day), X Body length (cm), Y X2 Y2 XY

3 1.4 9 1.96 4.2
4 1.5 16 2.25 6
5 2.2 25 4.84 11
6 2.4 36 5.76 14.4
8 3.1 64 9.61 24.8
9 3.2 81 10.24 28.8
10 3.2 100 10.24 32
11 3.9 121 15.21 42.9
12 4.1 144 16.81 49.2
14 4.7 196 22.09 65.8
15 4.5 225 20.25 67.5
16 5.2 256 27.04 83.2
17 5 289 25 85
Σ X = 130 Σ Y =44.4 ΣX2 = 1562 Σ Y2 = 171.3 ΣXY = 514.8

∑𝑋∑𝑌
𝑆𝑋𝑌 = ∑ 𝑋𝑌 −
𝑛

130 × 44.4
𝑆𝑋𝑌 = 514.8 −
13
= 514.8 − 444
= 70.8

## Aslina Nasir, FPSM

(∑ 𝑋)2
𝑆𝑋𝑋 = ∑ 𝑋 2 −
𝑛
1302
𝑆𝑋𝑋 = 1562 −
13
= 1562 − 1300
= 262

Oleh itu,
𝑆𝑥𝑦
𝑏=
𝑆𝑋𝑋
70.8
𝑏= ≈ 0.2702
262

Kaedah 2
𝑆𝑦
𝑏=𝑟
𝑆𝑋

𝑟 ialah pekali korelasi (yang dikira dari correlation analysis- boleh rujuk kepada nota slides)

∑(𝑋 − 𝑋̅)2
𝑆𝑋 = √
𝑛−1

∑(𝑌 − 𝑌̅)2
𝑆𝑌 = √
𝑛−1

## Aslina Nasir, FPSM

Age (day), X Body length (cm), Y 𝑋 − 𝑋̅ 𝑌 − 𝑌̅ (𝑋 − 𝑋̅)2 (𝑌 − 𝑌̅ )2 (𝑋 − 𝑋̅)(𝑌 − 𝑌̅)
14.108
3 1.4 -7 -2.015 49 4.062
11.492
4 1.5 -6 -1.915 36 3.669
6.077
5 2.2 -5 -1.215 25 1.477
4.062
6 2.4 -4 -1.015 16 1.031
0.631
8 3.1 -2 -0.315 4 0.099
0.215
9 3.2 -1 -0.215 1 0.046
0.000
10 3.2 0 -0.215 0 0.046
0.485
11 3.9 1 0.485 1 0.235
1.369
12 4.1 2 0.685 4 0.469
5.138
14 4.7 4 1.285 16 1.650
5.423
15 4.5 5 1.085 25 1.176
10.708
16 5.2 6 1.785 36 3.185
11.092
17 5 7 1.585 49 2.511
∑(𝑋 − 𝑋̅)(𝑌 − 𝑌̅) =70.8
Σ X = 130 Σ Y =44.4 ∑(𝑋 − 𝑋̅ )2 =262 ∑(𝑌 − 𝑌̅)2 =19.657
∑𝑋 ∑𝑌
𝑋= = 10 𝑌= ≈ 3.415
𝑛 𝑛

## 𝑆𝑋 sisihan piawai bagi X

∑(𝑋 − 𝑋̅)2 262
𝑆𝑋 = √ =√ ≈ 4.6726
𝑛−1 12

## Aslina Nasir, FPSM

𝑆𝑌 sisihan piawai bagi Y
∑(𝑌 − 𝑌̅)2 19.657
𝑆𝑌 = √ =√ ≈ 1.2799
𝑛−1 12

## ∑(𝑋 − 𝑋̅)(𝑌 − 𝑌̅)

𝑟=
√∑(𝑋 − 𝑋̅ )2 ∑(𝑌 − 𝑌̅)2

70.8
=
√262 × 19.657
70.8
=
√5150.134
70.8
=
71.764
≈ 0.9866

## Masukkan nilai 𝑟, 𝑆𝑦 dan 𝑆𝑋 dalam persamaan di bawah:

𝑆𝑦
𝑏=𝑟
𝑆𝑋

1.2799
𝑏 = 0.9866 × ≈ 0.2702
4.6726

Setelah memilih salah satu kaedah dari kaedah 1 atau kaedah 2 untuk
menentukan nilai a.

𝑎 = 𝑌 − 𝑏𝑋

## 𝑌 ialah min bagi body length (Y)

∑ 𝑌 44.4
𝑌= = ≈ 3.415
𝑛 13
n ialah bilangan marble goby

∑ 𝑋 130
𝑋= = = 10
𝑛 13

## Aslina Nasir, FPSM

Oleh itu,
𝑎 = 𝑌 − 𝑏𝑋
𝑎 = 3.415 − (0.2702 × 10)
𝑎 = 3.415 − 2.702 = 0.713

## Kesimpulannya, persamaan linear regression ialah

𝑌 = 𝑎 + 𝑏𝑋

Masukkan nilai a dan b yang diperoleh tadi ke dalam persamaan linear regression
seperti di bawah:

𝑌 = 0.713 + 0.2702𝑋

Soalan 2

If age increase about 3 days, estimate how much body length in cm of marble goby increase?

Solution

Masukkan nilai X=3 iaitu age= 3 days ke dalam persamaan linear regression di bawah

𝑌 = 0.713 + 0.2702𝑋
𝑌 = 0.713 + (0.2702 × 3)
= 0.713 + 0.8106
= 1.5236

Therefore, if age increase about 3 days, the body length of marble goby increase about
1.5236 cm.