Anda di halaman 1dari 27

JURUSAN TEKNIK SIPIL

UNIVERSITAS ANDALAS

STATISTIKA
dan
PROBABILITAS

----- Bab 10 -----


Bab 10
‘Goodness-of-Fit Test’
Tujuan Materi Kuliah :

Sesudah menyelesaikan bab ini mahasiswa


harus dapat melakukan :
 Menggunakan ‘Chi-square goodness-of-fit test’
untuk menentukan apakah data sesuai dengan
distribusi tertentu
‘Chi-Square Goodness-of-Fit Test’
 Apakah data sampel sesuai dengan distribusi
yang dihipotesakan?
 Contoh :

 Apakah pola data hasil simulasi sama


dengan data hasil pengukuran?

 Apakah hasil pengukuran mengikuti pola


distribusi normal?
‘Chi-Square Goodness-of-Fit Test’
(lanjutan)
 Apakah data hasil pengukuran mengikuti distribusi
uniform?
 Data sampel untuk 7 hari dalam seminggu :

Jumlah data hasil pengukuran


Monday 290
Tuesday 250
Wednesday 238
Thursday 257
Friday 265
Saturday 230
Sunday 192
 = 1722
Logika ‘Goodness-of-Fit Test’

 Jika data hasil pengukuran berdistribusi


uniform, data total 1722 diharapkan sama jika
dibagi 7 hari :
1722
 246 diharapkan jumlah pengukuran per hari jika uniform
7

 Chi-Square Goodness-of-Fit Test : merupakan


tes untuk melihat jika pola sampel sama
dengan pola hasil yang diharapkan
Frekuensi ‘Observed’ vs ‘Expected’
Observed Expected
oi ei
Monday 290 246
Tuesday 250 246
Wednesday 238 246
Thursday 257 246
Friday 265 246
Saturday 230 246
Sunday 192 246
TOTAL 1722 1722
‘Chi-Square Test’
H0: Distribusi data hasil pengukuran dalam
seminggu mempunyai pola uniform
HA: Distribusi data tidak uniform

 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

 Apakah hasil pengukuran suatu proses


produksi mengikuti distribusi normal dengan
μ = 50 dan σ = 15?
 Proses :
 Ambil data sampel
 Buat grup sampel menjadi klas
(Frekuensi klas yang diharapkan minimum 5)
 Bandingkan frekuensi aktual dengan frekuensi
yang diharapkan
Contoh : Distribution Normal
(lanjutan)
 Data sampel dan nilai grup dalam klas :

150 Sampel Klas Frekuensi


Pengukuran •< 30 •10
80 •30 but < 40 •21
65 •40 but < 50 •33
36
•50 but < 60 •41
66
50 •60 but < 70 •26
38 •70 but < 80 •10
57
•80 but < 90 •7
77
59 •> 90 •2
…etc… • TOTAL 150
Contoh : Distribution Normal
(lanjutan)
 Berapa frekuensi yang diharapkan untuk klas ini untuk
distribusi normal dengan μ = 50 dan σ = 15?
Frekuensi Frekuensi
•Klas Pengamatan Diharapkan
•less than 30 •10
•30 but < 40 •21
•40 but < 50 •33 •?
•50 but < 60 •41
•60 but < 70 •26
•70 but < 80 •10
•80 but < 90 •7
•90 or over •2
• TOTAL 150
Frekuensi yang Diharapkan

•Frekuensi Frekuensi yang


•Nilai •P(X < nilai) •Diharapkan diharapkan dalam
jumlah sampel n=150,
•less than 30 •0.09121 •13.68
dari distribusi normal
•30 but < 40 •0.16128 •24.19 dg μ=50, σ=15
•40 but < 50 •0.24751 •37.13
•50 but < 60 •0.24751 •37.13 Contoh :
•60 but < 70 •0.16128 •24.19  30  50 
P(x  30)  P z  
 15 
•70 but < 80 •0.06846 •10.27
 P(z  1.3333)
•80 but < 90 •0.01892 •2.84
•90 or over •0.00383 •0.57  .0912

• TOTAL •1.00000 150.00 (.0912)(150)  13.68


Tes Statistik

•Frequency •Expected Tes statistik :


•Klas •(observed, oi) Frequency, ei
•< 30 •10 •13.68 ( o  e ) 2

•30 but < 40 •21 •24.19


2   i i
ei
•40 but < 50 •33 •37.13
•50 but < 60 •41 •37.13
•60 but < 70 •26 •24.19
•70 but < 80 •10 •10.27
 H0 ditolak jika
•80 but < 90 •7 •2.84  
2 2
α
•>=90 •2 •0.57
• TOTAL 150 150.00
(dg df = k – 1)
Daerah Penolakan
H0: Nilai distribusi adalah normal dengan
μ = 50 dan σ = 15
HA: Distribusi tidak seperti yang disebutkan

(oi  ei )2 (10  13.68)2 (2  0.57)2


 
2
  ...   12.097
ei 13.68 0.57
8 klas shg digunakan
df=7 2
 .05 = 14.0671
Kesimpulan: =.05
2 = 12.097 < 2 = 14.0671 so
H0 diterima 0 2
H0 niterima H0 ditolak
2.05 = 14.0671
Contingency Tables

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

Left-Handed vs. Gender


 Dominant Hand: Left vs. Right
 Gender: Male vs. Female

H0: Hand preference is independent of gender


HA: Hand preference is not independent of gender

Chap 12-18
Contingency Table Example
(continued)

Sample results organized in a contingency table:

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

 If H0 is true, then the proportion of left-handed females


should be the same as the proportion of left-handed
males
 The two proportions above should be the same as the
proportion of left-handed people overall

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…

i.e., we would expect (120)(.12) = 14.4 females to be left handed


(180)(.12) = 21.6 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

Observed frequencies vs. 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

Chap 12-23
The Chi-Square Test Statistic

The Chi-square contingency test statistic is:

r c (oij  eij )2
  
2
with d.f .  (r  1)(c  1)
i1 j1 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

(12  14.4)2 (108  105.6)2 (24  21.6)2 (156  158.4)2


 
2
    0.6848
14.4 105.6 21.6 158.4
Chap 12-25
Contingency Analysis

 2  0.6848 with d.f.  (r - 1)(c - 1)  (1)(1)  1

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

 Used the chi-square goodness-of-fit test to


determine whether data fits a specified distribution
 Example of a discrete distribution (uniform)
 Example of a continuous distribution (normal)
 Used contingency tables to perform a chi-square
test of independence
 Compared observed cell frequencies to expected cell
frequencies

Chap 12-27

Anda mungkin juga menyukai