Post on 10-Mar-2019
Teknik Pengolahan Data Uji Hipotesis (Hypothesis Tes/ng)
15-‐Oct-‐15
h8p://is/
arto.staff.ugm.ac.id
1
Universitas Gadjah Mada Jurusan Teknik Sipil dan Lingkungan Prodi Magister Teknik Pengelolaan Bencana Alam
Uji Hipotesis • Model Matema/ka vs Pengukuran • 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
h8p://is/
arto.staff.ugm.ac.id
2
Prosedur Uji Hipotesis • 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
3
Kemungkinan Kesalahan
pilihan keadaan nyata
hipotesis benar hipotesis salah
menerima tak salah kesalahan /pe II
menolak kesalahan type I tak salah
15-‐Oct-‐15
h8p://is/
arto.staff.ugm.ac.id
4
Notasi
15-‐Oct-‐15
h8p://is/
arto.staff.ugm.ac.id
5
H0 = hipotesis (yang diuji)
Ha = hipotesis alterna/f
1−α = /ngkat keyakinan (confidence level)
Uji Hipotesis Nilai Rata-‐rata
15-‐Oct-‐15
h8p://is/
arto.staff.ugm.ac.id
6
H0 : µ =µ1
Ha : µ =µ2
X <µ1− z1−α
σX
n⇒ Z < −z1−α
Distribusi Normal σX2 diketahui
Z =
nσX
X −µ1( )Sta/s/ka uji: berdistribusi normal
Jika μ1 > μ2: H0 ditolak jika
Jika μ1 < μ2: H0 ditolak jika X <µ1+ z1−α
σX
n⇒ Z > z1−α
15-‐Oct-‐15
h8p://is/
arto.staff.ugm.ac.id
7
luas = α
z1−α
prob Z > z1−α( ) = α
Uji Hipotesis Nilai Rata-‐rata
15-‐Oct-‐15
h8p://is/
arto.staff.ugm.ac.id
8
H0 : µ =µ1
Ha : µ =µ2
X <µ1− t1−α ,n−1
sX
n
Distribusi Normal σX2 /dak diketahui
T =
nsX
X −µ1( )Sta/s/ka uji: berdistribusi t
H0 ditolak jika: jika μ1 > μ2
X >µ1+ t1−α ,n−1
sX
njika μ1 < μ2
Uji Hipotesis Nilai Rata-‐rata
15-‐Oct-‐15
h8p://is/
arto.staff.ugm.ac.id
9
H0 : µ =µ0
Ha : µ ≠µ0
Z =n
σX
X −µ0( ) > z1−α 2
Distribusi Normal σX2 diketahui
Z =
nσX
X −µ0( )Sta/s/ka uji: berdistribusi normal
H0 ditolak jika:
Uji Hipotesis Nilai Rata-‐rata
15-‐Oct-‐15
h8p://is/
arto.staff.ugm.ac.id
10
H0 : µ =µ0
Ha : µ ≠µ0
t =n
sX
X −µ0( ) > t1−α 2,n−1
Distribusi Normal σX2 /dak diketahui
T =
nsX
X −µ0( )Sta/s/ka uji: berdistribusi t
H0 ditolak jika:
Uji Hipotesis Nilai Rata-‐rata • Hasil uji hipotesis adalah • menolak H0, atau • /dak menolak H0
• 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.
15-‐Oct-‐15
h8p://is/
arto.staff.ugm.ac.id
11
Uji hipotesis beda nilai rata-‐rata dua buah distribusi normal
15-‐Oct-‐15
h8p://is/
arto.staff.ugm.ac.id
12
H0 : µ1−µ2 = δ
Ha : µ1−µ2 ≠ δ
z =n
σX
X −µ0( ) > z1−α 2
Z =X1−X2 −δ
σ12 n1+σ2
2 n2( )1 2Sta/s/ka uji: berdistribusi normal
H0 ditolak jika:
var X1( ) dan var X2( ) diketahui
Uji hipotesis beda nilai rata-‐rata dua buah distribusi normal
15-‐Oct-‐15
h8p://is/
arto.staff.ugm.ac.id
13
H0 : µ1−µ2 = δ
Ha : µ1−µ2 ≠ δ
t =n
sX
X −µ0( ) > t1−α 2,n1+n2−2
T =X1−X2 −δ
n1+ n2( ) n1−1( ) s12 + n2 −1( ) s2
2#$
%&
n1n2 n1+ n2 −2( )#$ %&
'()
*)
+,)
-)
1 2Sta/s/ka uji:
berdistribusi t dengan (n1+n2–2) degrees of freedom
H0 ditolak jika:
var X1( ) dan var X2( ) tidak diketahui
Uji Hipotesis Nilai Varian
15-‐Oct-‐15
h8p://is/
arto.staff.ugm.ac.id
14
H0 : σ2 = σ02
Ha : σ2 ≠ σ02
χα 2,n−1
2 < χc2 < χ1−α 2,n−1
2
Distribusi Normal
χc
2 =Xi −X( )σ0
2i=1
n
∑Sta/s/ka uji: berdistribusi chi-‐kuadrat
H0 diterima (/dak ditolak) jika:
Uji Hipotesis Nilai Varian
15-‐Oct-‐15
h8p://is/
arto.staff.ugm.ac.id
15
H0 : σ12 = σ2
2
Ha : σ12 ≠ σ2
2
Fc > F1−α ,n1−1,n2−1
2 Distribusi Normal
Fc =
s12
s22Sta/s/ka uji: berdistribusi F dengan
H0 ditolak jika:
n1−1( ) dan n2 −1( ) degrees of freedom
s12 > s2
2
Uji Hipotesis Nilai Varian
15-‐Oct-‐15
h8p://is/
arto.staff.ugm.ac.id
16
H0 : σ12 = σ2
2 = ... = σ k2
Ha : σ12 ≠ σ2
2 ≠ ... ≠ σ k2
Qh> χ1−α ,k−1
2
Distribusi Normal
Qh
Sta/s/ka uji: berdistribusi chi-‐kuadrat dengan (k – 1) degrees of freedom
H0 ditolak jika:
Q = n−1( ) lnni −1( ) si
2
N − ki=1
k
∑#
$%%
&
'((i=1
k
∑ − n−1( ) ln si2
i=1
k
∑
h =1+1
3 k −1( )1
ni −1−
1N − k
)
*+
,
-.
i=1
k
∑
N = nii=1
k
∑
Uji Hipotesis • La/han • Lihat kembali data debit puncak tahunan Sungai XYZ.
• 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
15-‐Oct-‐15
h8p://is/
arto.staff.ugm.ac.id
17
CDF PLOT ON PROBABILITY PAPER Goodness of Fit Test
15-‐Oct-‐15
h8p://is/
arto.staff.ugm.ac.id
18
Testing The Goodness of Fit of Data to Probability Distributions • Graphical (and visual) methods to judge whether or not a par/cular distribu/on adequately describes a set of observa/ons: • 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
h8p://is/
arto.staff.ugm.ac.id
19
Annual Peak Discharge of XYZ River
0.00
0.05
0.10
0.15
0.20
Rela%v
e freq
uency
Discharge (m3/s)
observed data theore/cal distribu/on
15-‐Oct-‐15
h8p://is/
arto.staff.ugm.ac.id
20
15-‐Oct-‐15
h8p://is/
arto.staff.ugm.ac.id
21
markers: observed data line: theoretical distribution
15-‐Oct-‐15
h8p://is/
arto.staff.ugm.ac.id
22
Normal Distribution Paper
Chi-‐square Goodness of Fit Test
• Method of test • 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:
χc
2 =Oi − Ei( )2
Eii=1
k
∑
15-‐Oct-‐15
h8p://is/
arto.staff.ugm.ac.id
23
Chi-‐square Goodness of Fit Test ˃ The test sta/s/c is calculated from the following rela/onship:
χc
2 =Oi − Ei( )2
Eii=1
k
∑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
15-‐Oct-‐15
h8p://is/
arto.staff.ugm.ac.id
24
Chi-‐square Goodness of Fit Test ˃ The test sta/s/c is calculated from the following rela/onship:
χc
2 =Oi − Ei( )2
Eii=1
k
∑
˃ The hypothesis that the data are from the specified distribu/on is rejected if:
χc2 > χ1−α ,k−p−1
2
1−α α
χ1−α ,k−p−12
15-‐Oct-‐15
h8p://is/
arto.staff.ugm.ac.id
25
The Kolmogorov-‐Smirnov Test
• Steps in the Kolmogorov-‐Smirnov test: • 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
h8p://is/
arto.staff.ugm.ac.id
26
The Kolmogorov-‐Smirnov Test
• Notes on the Kolmogorov-‐Smirnov test: • 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
h8p://is/
arto.staff.ugm.ac.id
27
Chi-‐square Goodness of Fit Test and The Kolmogorov-‐Smirnov Test
• Exercise • 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
h8p://is/
arto.staff.ugm.ac.id
28
Chi-‐square Goodness of Fit Test and The Kolmogorov-‐Smirnov Test
• Notes on both tests when tes/ng hydrologic frequency distribu/ons. • 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
h8p://is/
arto.staff.ugm.ac.id
29
Chi-‐square Goodness of Fit Test and The Kolmogorov-‐Smirnov Test
• Exercise • 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
h8p://is/
arto.staff.ugm.ac.id
30
15-‐Oct-‐15
h8p://is/
arto.staff.ugm.ac.id
31