Bab 10 - Goodness of Fit Test
Bab 10 - Goodness of Fit Test
UNIVERSITAS ANDALAS
STATISTIKA
dan
PROBABILITAS
Tes statistik :
(oi ei ) 2
2
(dimana df k 1)
ei
where:
k = jumlah klas/kategori
oi = frekuensi ‘observed cell’ untuk category i
ei = frekuensi ‘expected cell’ untuk category i
Daerah Penolakan
H0: Distribusi data hasil pengukuran dalam
seminggu adalh uniform
HA: Distribusi data tidak uniform
( o e ) 2
2 i i
ei
H0 ditolak jika
2 2
α
(dengan df = k – 1)
0 2
H0 Diterima H0 Ditolak
2
‘Chi-Square Test’
H0: Distribusi data adalah uniform selama
7 hari dalam seminggu
HA: Distribusi data adalah tidak uniform
(290 246)2
(250 246)2
(192 246)2
2 ... 23.05
246 246 246
k – 1 = 6 (7 hari dlm seminggu), shg
gunakan df = 6.
2.05 = 12.5916
= .05
Kesimpulan :
2 = 23.05 > 2 = 12.5916 shg
H0 ditolak dan disimpulkan 0 2
bahwa distribusi data adalah tdk H0 Diterima H0 Ditolak
uniform
2.05 = 12.5916
Contoh : Distribution Normal
Contingency Tables
Situations involving multiple population
proportions
Used to classify sample observations according
to two or more characteristics
Also called a crosstabulation table.
Chap 12-17
Contingency Table Example
Chap 12-18
Contingency Table Example
(continued)
Hand Preference
sample size = n = 300:
Gender Left Right
120 Females, 12
were left handed Female 12 108 120
180 Males, 24 were
left handed Male 24 156 180
36 264 300
Chap 12-19
Logic of the Test
H0: Hand preference is independent of gender
HA: Hand preference is not independent of gender
Chap 12-20
Finding Expected Frequencies
120 Females, 12 Overall:
were left handed
180 Males, 24 were P(Left Handed)
left handed = 36/300 = .12
If independent, then
P(Left Handed | Female) = P(Left Handed | Male) = .12
So we would expect 12% of the 120 females and 12% of the 180
males to be left handed…
Chap 12-21
Expected Cell Frequencies
(continued)
Expected cell frequencies:
th th
(i Row total)( j Column total)
eij
Total sample size
Example:
(120 )(36 )
e11 14.4
300
Chap 12-22
Observed v. Expected Frequencies
36 264 300
Chap 12-23
The Chi-Square Test Statistic
r c (oij eij )2
2
with d.f . (r 1)(c 1)
i1 j1 eij
where:
oij = observed frequency in cell (i, j)
eij = expected frequency in cell (i, j)
r = number of rows
c = number of columns
Chap 12-24
Observed v. Expected Frequencies
Hand Preference
Gender Left Right
Observed = 12 Observed = 108
Female 120
Expected = 14.4 Expected = 105.6
Observed = 24 Observed = 156
Male 180
Expected = 21.6 Expected = 158.4
36 264 300
Decision Rule:
If 2 > 3.841, reject H0,
otherwise, do not reject H0
Here, 2 = 0.6848
= 0.05 < 3.841, so we
do not reject H0
2.05 = 3.841 and conclude that
gender and hand
Do not reject H0 Reject H0 preference are
independent
Chap 12-26
Chapter Summary
Chap 12-27