Teknik Pengolahan Data Uji Hipotesis (Hypothesis Tes/ng)
15-‐Oct-‐15 h8p://is/arto.staff.ugm.ac.id
Universitas Gadjah Mada Jurusan Teknik Sipil dan Lingkungan Prodi Magister Teknik Pengelolaan Bencana Alam
1
• komparasi garis teore/k (prediksi menurut model) dan data pengukuran • jika prediksi model sesuai dengan data pengukuran, maka model diterima • jika prediksi model menyimpang dari data pengukuran, maka model ditolak
• Dalam sejumlah kasus, yang terjadi adalah • hasil komparasi prediksi model dan data pengukuran /dak cukup jelas untuk menyatakan bahwa model diterima atau ditolak • uji hipotesis sebagai alat analisis dalam komparasi tersebut
15-‐Oct-‐15
• Model Matema/ka vs Pengukuran
h8p://is/arto.staff.ugm.ac.id
Uji Hipotesis
2
Rumuskan hipotesis Rumuskan hipotesis alterna/f Tetapkan sta/s/ka uji Tetapkan distribusi sta/s/ka uji Tentukan nilai kri/k sebagai batas sta/s/ka uji harus ditolak Kumpulkan data untuk menyusun sta/s/ka uji Kontrol posisi sta/s/ka uji terhadap nilai kri/s
15-‐Oct-‐15
• • • • • • •
h8p://is/arto.staff.ugm.ac.id
Prosedur Uji Hipotesis
3
15-‐Oct-‐15
Kemungkinan Kesalahan keadaan nyata hipotesis benar
hipotesis salah
menerima
tak salah
kesalahan /pe II
menolak
kesalahan type I
tak salah
h8p://is/arto.staff.ugm.ac.id
pilihan
4
H0 = hipotesis (yang diuji)
15-‐Oct-‐15
Notasi
1−α = /ngkat keyakinan (confidence level)
h8p://is/arto.staff.ugm.ac.id
Ha = hipotesis alterna/f
5
µ = µ1
Ha :
µ = µ2
Distribusi Normal σX2 diketahui
Sta/s/ka uji: Z =
n σX
(X − µ ) 1
berdistribusi normal
Jika μ1 > μ2: H0 ditolak jika X < µ1 − z1−α
σX
Jika μ1 < μ2: H0 ditolak jika X < µ1 + z1−α
σX
n
n
⇒ Z < −z1−α
⇒ Z > z1−α
15-‐Oct-‐15
H0 :
h8p://is/arto.staff.ugm.ac.id
Uji Hipotesis Nilai Rata-‐rata
6
z1−α
prob ( Z > z1−α ) = α
h8p://is/arto.staff.ugm.ac.id
luas = α
7
15-‐Oct-‐15
µ = µ1
Ha :
µ = µ2
Sta/s/ka uji:
Distribusi Normal σX2 /dak diketahui T=
n sX
berdistribusi t
(X − µ ) 1
H0 ditolak jika: X < µ1 − t1−α,n−1
X > µ1 + t1−α,n−1
sX n sX n
jika μ1 > μ2
15-‐Oct-‐15
H0 :
h8p://is/arto.staff.ugm.ac.id
Uji Hipotesis Nilai Rata-‐rata
jika μ1 < μ2 8
µ = µ0
Ha :
µ ≠ µ0
Sta/s/ka uji:
H0 ditolak jika:
Distribusi Normal σX2 diketahui Z=
n σX
Z=
berdistribusi normal
(X − µ ) 0
n σX
(X − µ ) 0
> z1−α 2
15-‐Oct-‐15
H0 :
h8p://is/arto.staff.ugm.ac.id
Uji Hipotesis Nilai Rata-‐rata
9
µ = µ0
Ha :
µ ≠ µ0
Sta/s/ka uji:
H0 ditolak jika:
Distribusi Normal σX2 /dak diketahui
T=
n sX
t =
berdistribusi t
(X − µ ) 0
n sX
(X − µ ) 0
> t1−α 2,n−1
15-‐Oct-‐15
H0 :
h8p://is/arto.staff.ugm.ac.id
Uji Hipotesis Nilai Rata-‐rata
10
• Hasil uji hipotesis adalah
15-‐Oct-‐15
Uji Hipotesis Nilai Rata-‐rata
• Ar/nya • H0: μ = μ0 • Tidak menolak H0 à “menerima” H0 berar/ bahwa μ /dak berbeda secara signifikan dengan μ0. • Tetapi /dak dikatakan bahwa μ benar-‐benar sama dengan μ0 karena kita /dak membuk/kan bahwa μ = μ0.
h8p://is/arto.staff.ugm.ac.id
• menolak H0, atau • /dak menolak H0
11
µ1 − µ 2 = δ
Ha :
µ1 − µ 2 ≠ δ
Sta/s/ka uji:
H0 ditolak jika:
var (X1) dan var (X 2 ) diketahui
Z=
X1 − X 2 − δ
(
σ 12 n1 + σ 22 n2
z =
n σX
(X − µ ) 0
)
12
> z1−α 2
berdistribusi normal
h8p://is/arto.staff.ugm.ac.id
H0 :
15-‐Oct-‐15
Uji hipotesis beda nilai rata-‐rata dua buah distribusi normal
12
µ1 − µ 2 = δ
Ha :
µ1 − µ 2 ≠ δ
Sta/s/ka uji:
T=
var (X1) dan var (X 2 ) tidak diketahui
X1 − X 2 − δ ') n + n # n −1 s 2 + n −1 s 2 % +) ( ) ( ) 1 2 ) $( 1 1 2 2 & ( , # % )* )$n1n2 ( n1 + n2 − 2)&
12
berdistribusi t dengan (n1+n2–2) degrees of freedom H0 ditolak jika: t =
n sX
(X − µ ) 0
> t1−α 2,n1+n2 −2
h8p://is/arto.staff.ugm.ac.id
H0 :
15-‐Oct-‐15
Uji hipotesis beda nilai rata-‐rata dua buah distribusi normal
13
Ha :
σ 2 = σ 02 2
σ ≠ σ0
Distribusi Normal
2
n
Sta/s/ka uji:
2 c
χ =∑ i=1
(X − X ) i
σ0
2
berdistribusi chi-‐kuadrat
2 2 2 χ < χ < χ H0 diterima (/dak ditolak) jika: α 2,n−1 c 1−α 2,n−1
15-‐Oct-‐15
H0 :
h8p://is/arto.staff.ugm.ac.id
Uji Hipotesis Nilai Varian
14
Ha :
σ 12 = σ 22 2 1
σ ≠ σ2
Sta/s/ka uji:
2 Distribusi Normal
2
s12 Fc = 2 s2
(n −1) 1
berdistribusi F dengan
dan
(n
s12 > s22 Fc > F1−α,n1−1,n2 −1 H0 ditolak jika:
2
−1) degrees of freedom
h8p://is/arto.staff.ugm.ac.id
H0 :
15-‐Oct-‐15
Uji Hipotesis Nilai Varian
15
Ha :
σ 12 = σ 22 = ... = σ k 2 2 1
2
σ ≠ σ 2 ≠ ... ≠ σ k
Sta/s/ka uji: Q h
2
Distribusi Normal
berdistribusi chi-‐kuadrat dengan (k – 1) degrees of freedom # k ( n −1) s 2 & k i ( − ∑ ( n −1) ln si 2 Q = ∑ ( n −1) ln %∑ i %$ i=1 N − k (' i=1 i=1 k ) 1 1 1 , h = 1+ − + . ∑ 3 ( k −1) i=1 * ni −1 N − k k
15-‐Oct-‐15
H0 :
h8p://is/arto.staff.ugm.ac.id
Uji Hipotesis Nilai Varian
k
N = ∑ ni i=1
H0 ditolak jika:
Q 2 > χ1−α,k−1 h
16
• La/han
15-‐Oct-‐15
Uji Hipotesis • Uji hipotesis yang menyatakan bahwa debit puncak tahunan rerata adalah 650 m3/s dan varians adalah 45.000 m6/s2.
• Contoh uji hipotesis.pdf • Exercises on hypothesis thesis.pdf
h8p://is/arto.staff.ugm.ac.id
• Lihat kembali data debit puncak tahunan Sungai XYZ.
17
15-‐Oct-‐15 h8p://is/arto.staff.ugm.ac.id
Goodness of Fit Test
CDF PLOT ON PROBABILITY PAPER
18
• plot and compare the observed rela/ve frequency curve with the theore/cal rela/ve frequency curve • plot the observed data on appropriate probability paper and judge as to whether or not the resul/ng plot is a straight line
• Sta/s/cal tests: • chi-‐square goodness of fit test • the Kolmogorov-‐Smirnov test
15-‐Oct-‐15
• Graphical (and visual) methods to judge whether or not a par/cular distribu/on adequately describes a set of observa/ons:
h8p://is/arto.staff.ugm.ac.id
Testing The Goodness of Fit of Data to Probability Distributions
19
0.20
observed data
0.15 h8p://is/arto.staff.ugm.ac.id
Rela%ve frequency
theore/cal distribu/on
15-‐Oct-‐15
Annual Peak Discharge of XYZ River
0.10
0.05
0.00
Discharge (m3/s)
20
15-‐Oct-‐15 h8p://is/arto.staff.ugm.ac.id
markers: observed data line: theoretical distribution
21
22
h8p://is/arto.staff.ugm.ac.id
15-‐Oct-‐15
Normal Distribution Paper
• Comparison between the actual number of observa/ons and the expected number of observa/ons (expected according to the distribu/on under test) that fall in the class intervals. • The expected numbers are calculated by mul/plying the expected rela/ve frequency by the total number of observa/ons. • The test sta/s/c is calculated from the following rela/onship: k
(O − E )
i=1
Ei
χ =∑ 2 c
2
i
i
15-‐Oct-‐15
• Method of test
h8p://is/arto.staff.ugm.ac.id
Chi-‐square Goodness of Fit Test
23
˃ The test sta/s/c is calculated from the following rela/onship: k
(O − E )
i=1
Ei
2
i
i
where: k is the number of class intervals Oi is the number of observa/ons in the ith class interval Ei is the expected number of observa/ons in the ith class interval according to the distribu/on being tested χc2 has a distribu/on of chi-‐square with (k – p – 1) degrees of freedom, where p is the number of parameters es/mated from the data
h8p://is/arto.staff.ugm.ac.id
χ =∑ 2 c
15-‐Oct-‐15
Chi-‐square Goodness of Fit Test
24
˃ The test sta/s/c is calculated from the following rela/onship: k
(O − E )
i=1
Ei
2
i
i
˃ The hypothesis that the data are from the specified distribu/on is rejected if: 2 χ2c > χ1−α,k−p−1
1−α
h8p://is/arto.staff.ugm.ac.id
χ =∑ 2 c
15-‐Oct-‐15
Chi-‐square Goodness of Fit Test
α 2 χ1−α,k−p−1
25
• Let PX(x) be the completely specified theore/cal cumula/ve distribu/on func/on under the null hypothesis. • Let Sn(x) be the sample comula/ve density func/on based on n observa/ons. For any observed x, Sn(x) = k/n where k is the number of observa/ons less than or equal to x. • Determine the maximum devia/on, D, defined by: D = max |PX(x) – Sn(x)| • If, for the chosen significance level, the observed value of D is greater than or equal to the cri/cal tabulated of the Kolmogorov-‐ Smirnov sta/s/c, the hypothesis is rejected. Table of Kolmogorov-‐Smirnov test sta/s/c is available in many books on sta/s/cs.
15-‐Oct-‐15
• Steps in the Kolmogorov-‐Smirnov test:
h8p://is/arto.staff.ugm.ac.id
The Kolmogorov-‐Smirnov Test
26
• The test can be conducted by calcula/ng the quan//es PX(x) and Sn(x) at each observed point or • By plotng the data on the probability paper and and selec/ng the greatest devia/on on the probability scale of a point from the theore/cal line. • The data should not be grouped for this test, i.e. plot each point of the data on the probability paper.
15-‐Oct-‐15
• Notes on the Kolmogorov-‐Smirnov test:
h8p://is/arto.staff.ugm.ac.id
The Kolmogorov-‐Smirnov Test
27
• Do the chi-‐square goodness of fit test and the Kolmogorov-‐ Smirnov test to the annual peak discharge of XYZ River against normal distribu/on.
15-‐Oct-‐15
• Exercise
h8p://is/arto.staff.ugm.ac.id
Chi-‐square Goodness of Fit Test and The Kolmogorov-‐Smirnov Test
28
• Both tests are insensi/ve in the tails of the distribu/ons. • On the other hand, the tails are important in hydrologic frequency distribu/ons.
• To increase sensi/vity of chi-‐square test • The expected number of observa/ons in a class shall not be less than 3 (or 5). • Define the class interval so that under the hypothesis being tested, the expected number of observa/ons in each class interval is the same. • The class intervals will be of unequal width. • The interval widths will be a func/on of the distribu/on being tested.
15-‐Oct-‐15
• Notes on both tests when tes/ng hydrologic frequency distribu/ons.
h8p://is/arto.staff.ugm.ac.id
Chi-‐square Goodness of Fit Test and The Kolmogorov-‐Smirnov Test
29
• Redo the chi-‐square goodness of fit test and the Kolmogorov-‐ Smirnov test to the annual peak discharge of XYZ River against normal distribu/on. • Define the class intervals so that the expected number of observa/ons in each class interval is the same.
15-‐Oct-‐15
• Exercise
h8p://is/arto.staff.ugm.ac.id
Chi-‐square Goodness of Fit Test and The Kolmogorov-‐Smirnov Test
30
31
h8p://is/arto.staff.ugm.ac.id
15-‐Oct-‐15