Statistika Uji Hipotesis 15Oct15 h1p://is4arto.staff.ugm.ac.id 1 Universitas Gadjah Mada Fakultas Teknik Jurusan Teknik Sipil dan Lingkungan Prodi S2 Teknik Sipil
Statistika Uji Hipotesis
15-‐Oct-‐15
h1p://is4
arto.staff.ugm.ac.id
1
Universitas Gadjah Mada Fakultas Teknik Jurusan Teknik Sipil dan Lingkungan Prodi S2 Teknik Sipil
Uji Hipotesis • Model Matema4ka vs Pengukuran • komparasi garis teore4k (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 4dak cukup jelas untuk menyatakan bahwa model diterima atau ditolak
• uji hipotesis sebagai alat analisis dalam komparasi tersebut
15-‐Oct-‐15
h1p://is4
arto.staff.ugm.ac.id
2
Prosedur Uji Hipotesis • Rumuskan hipotesis • Rumuskan hipotesis alterna4f • Tetapkan sta4s4ka uji • Tetapkan distribusi sta4s4ka uji • Tentukan nilai kri4k sebagai batas sta4s4ka uji harus ditolak • Kumpulkan data untuk menyusun sta4s4ka uji • Kontrol posisi sta4s4ka uji terhadap nilai kri4s
15-‐Oct-‐15
h1p://is4
arto.staff.ugm.ac.id
3
Kesalahan
pilihan situasi nyata
hipotesis benar hipotesis salah
menerima tak salah kesalahan 4pe II
menolak kesalahan type I tak salah
15-‐Oct-‐15
h1p://is4
arto.staff.ugm.ac.id
4
Notasi
15-‐Oct-‐15
h1p://is4
arto.staff.ugm.ac.id
5
H0 = hipotesis (yang diuji)
Ha = hipotesis alterna4f
1−α = 4ngkat keyakinan (confidence level)
Uji Hipotesis Nilai Rata-‐rata
15-‐Oct-‐15
h1p://is4
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( )Sta4s4ka 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
h1p://is4
arto.staff.ugm.ac.id
7
luas = α
z1−α
prob Z > z1−α( ) = α
Uji Hipotesis Nilai Rata-‐rata
15-‐Oct-‐15
h1p://is4
arto.staff.ugm.ac.id
8
H0 : µ =µ1
Ha : µ =µ2
X <µ1− t1−α ,n−1
sX
n
Distribusi Normal σX2 4dak diketahui
T =
nsX
X −µ1( )Sta4s4ka 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
h1p://is4
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( )Sta4s4ka uji: berdistribusi normal
H0 ditolak jika:
Uji Hipotesis Nilai Rata-‐rata
15-‐Oct-‐15
h1p://is4
arto.staff.ugm.ac.id
10
H0 : µ =µ0
Ha : µ ≠µ0
t =n
sX
X −µ0( ) > t1−α 2,n−1
Distribusi Normal σX2 4dak diketahui
T =
nsX
X −µ0( )Sta4s4ka uji: berdistribusi t
H0 ditolak jika:
Uji Hipotesis Nilai Rata-‐rata • Hasil uji hipotesis adalah • menolak H0, atau • 4dak menolak H0
• Ar4nya • H0: μ = μ0
• Tidak menolak H0 à “menerima” H0 berar4 bahwa μ 4dak berbeda secara signifikan dengan μ0.
• Tetapi 4dak dikatakan bahwa μ benar-‐benar sama dengan μ0 karena kita 4dak membuk4kan bahwa μ = μ0.
15-‐Oct-‐15
h1p://is4
arto.staff.ugm.ac.id
11
Uji hipotesis beda nilai rata-‐rata dua buah distribusi normal
15-‐Oct-‐15
h1p://is4
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 2Sta4s4ka 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
h1p://is4
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 2Sta4s4ka 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
h1p://is4
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
∑Sta4s4ka uji: berdistribusi chi-‐kuadrat
H0 diterima (4dak ditolak) jika:
Uji Hipotesis Nilai Varian
15-‐Oct-‐15
h1p://is4
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
s22Sta4s4ka 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
h1p://is4
arto.staff.ugm.ac.id
16
H0 : σ12 = σ2
2 = ... = σ k2
Ha : σ12 ≠ σ2
2 ≠ ... ≠ σ k2
Qh> χ1−α ,k−1
2
Distribusi Normal
Qh
Sta4s4ka 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 • La4han • 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
h1p://is4
arto.staff.ugm.ac.id
17
CDF PLOT ON PROBABILITY PAPER Goodness of Fit Test
15-‐Oct-‐15
h1p://is4
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 par4cular distribu4on adequately describes a set of observa4ons: • plot and compare the observed rela4ve frequency curve with the theore4cal rela4ve frequency curve
• plot the observed data on appropriate probability paper and judge as to whether or not the resul4ng plot is a straight line
• Sta4s4cal tests: • chi-‐square goodness of fit test • the Kolmogorov-‐Smirnov test
15-‐Oct-‐15
h1p://is4
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 theore4cal distribu4on
15-‐Oct-‐15
h1p://is4
arto.staff.ugm.ac.id
20
15-‐Oct-‐15
h1p://is4
arto.staff.ugm.ac.id
21
markers: observed data line: theoretical distribution
15-‐Oct-‐15
h1p://is4
arto.staff.ugm.ac.id
22
Normal Distribution Paper
Chi-‐square Goodness of Fit Test
• Method of test • Comparison between the actual number of observa4ons and the expected number of observa4ons (expected according to the distribu4on under test) that fall in the class intervals.
• The expected numbers are calculated by mul4plying the expected rela4ve frequency by the total number of observa4ons.
• The test sta4s4c is calculated from the following rela4onship:
χc
2 =Oi − Ei( )2
Eii=1
k
∑
15-‐Oct-‐15
h1p://is4
arto.staff.ugm.ac.id
23
Chi-‐square Goodness of Fit Test ˃ The test sta4s4c is calculated from the following rela4onship:
χc
2 =Oi − Ei( )2
Eii=1
k
∑where: k is the number of class intervals Oi is the number of observa4ons in the ith class interval Ei is the expected number of observa4ons in the ith class interval
according to the distribu4on being tested χc2 has a distribu4on of chi-‐square with (k – p – 1) degrees of freedom,
where p is the number of parameters es4mated from the data
15-‐Oct-‐15
h1p://is4
arto.staff.ugm.ac.id
24
Chi-‐square Goodness of Fit Test ˃ The test sta4s4c is calculated from the following rela4onship:
χc
2 =Oi − Ei( )2
Eii=1
k
∑
˃ The hypothesis that the data are from the specified distribu4on is rejected if:
χc2 > χ1−α ,k−p−1
2
1−α α
χ1−α ,k−p−12
15-‐Oct-‐15
h1p://is4
arto.staff.ugm.ac.id
25
The Kolmogorov-‐Smirnov Test
• Steps in the Kolmogorov-‐Smirnov test: • Let PX(x) be the completely specified theore4cal cumula4ve distribu4on func4on under the null hypothesis.
• Let Sn(x) be the sample comula4ve density func4on based on n observa4ons. For any observed x, Sn(x) = k/n where k is the number of observa4ons less than or equal to x.
• Determine the maximum devia4on, 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 cri4cal tabulated of the Kolmogorov-‐Smirnov sta4s4c, the hypothesis is rejected. Table of Kolmogorov-‐Smirnov test sta4s4c is available in many books on sta4s4cs.
15-‐Oct-‐15
h1p://is4
arto.staff.ugm.ac.id
26
The Kolmogorov-‐Smirnov Test
• Notes on the Kolmogorov-‐Smirnov test: • The test can be conducted by calcula4ng the quan44es PX(x) and Sn(x) at each observed point or
• By plosng the data on the probability paper and and selec4ng the greatest devia4on on the probability scale of a point from the theore4cal 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
h1p://is4
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 distribu4on.
15-‐Oct-‐15
h1p://is4
arto.staff.ugm.ac.id
28
Chi-‐square Goodness of Fit Test and The Kolmogorov-‐Smirnov Test
• Notes on both tests when tes4ng hydrologic frequency distribu4ons. • Both tests are insensi4ve in the tails of the distribu4ons. • On the other hand, the tails are important in hydrologic frequency distribu4ons.
• To increase sensi4vity of chi-‐square test • The expected number of observa4ons 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 observa4ons in each class interval is the same. • The class intervals will be of unequal width. • The interval widths will be a func4on of the distribu4on being tested.
15-‐Oct-‐15
h1p://is4
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 distribu4on. • Define the class intervals so that the expected number of observa4ons in each class interval is the same.
15-‐Oct-‐15
h1p://is4
arto.staff.ugm.ac.id
30
15-‐Oct-‐15
h1p://is4
arto.staff.ugm.ac.id
31