17 universitas gadjah mada statistika teknik distiarto.staff.ugm.ac.id/docs/staterapan/stat8 uji...
TRANSCRIPT
StatistikaTeknikUjiHipotesis
18-Aug-17
http://istia
rto.staff.ugm
.ac.id
1
MagisterPengelolaanAirdanAirLimbahUniversitasGadjahMada
UjiHipotesis• ModelMatematikavs Pengukuran• komparasigaristeoretik(prediksimenurutmodel)dandatapengukuran
• jikaprediksimodelsesuaidengandatapengukuran,makamodelditerima
• jikaprediksimodelmenyimpangdaridatapengukuran,makamodelditolak
• Dalamsejumlahkasus,yangterjadiadalah• hasilkomparasiprediksimodeldandatapengukurantidakcukupjelasuntukmenyatakanbahwamodelditerimaatauditolak
• ujihipotesissebagaialatanalisisdalamkomparasitersebut
18-Aug-17
http://istia
rto.staff.ugm
.ac.id
2
ProsedurUjiHipotesis• Rumuskanhipotesis• Rumuskanhipotesisalternatif• Tetapkanstatistikauji• Tetapkandistribusistatistikauji• Tentukannilaikritiksebagaibatasstatistikaujiharusditolak• Kumpulkandatauntukmenyusunstatistikauji• Kontrolposisistatistikaujiterhadapnilaikritis
18-Aug-17
http://istia
rto.staff.ugm
.ac.id
3
KemungkinanKesalahan
pilihankeadaannyata
hipotesisbenar hipotesissalah
menerima taksalah kesalahantipeII
menolak kesalahantipeI taksalah
18-Aug-17
http://istia
rto.staff.ugm
.ac.id
4
Notasi
18-Aug-17
http://istia
rto.staff.ugm
.ac.id
5
H0 =hipotesis(yangdiuji)
Ha =hipotesisalternatif
1−α =tingkatkeyakinan(confidencelevel)
UjiHipotesisNilaiRata-rata
18-Aug-17
http://istia
rto.staff.ugm
.ac.id
6
H0 : µ =µ1
Ha : µ =µ2
X <µ1− z1−α
σX
n⇒ Z < −z1−α
DistribusiNormalσX2 diketahui
Z =
nσX
X −µ1( )Statistikauji: berdistribusinormal
Jikaμ1 >μ2:H0 ditolakjika
Jikaμ1 <μ2:H0 ditolakjika X <µ1+ z1−α
σX
n⇒ Z > z1−α
18-Aug-17
http://istia
rto.staff.ugm
.ac.id
7
luas=α
z1−α
prob Z > z1−α( ) = α
UjiHipotesisNilaiRata-rata
18-Aug-17
http://istia
rto.staff.ugm
.ac.id
8
H0 : µ =µ1
Ha : µ =µ2
X <µ1− t1−α ,n−1
sX
n
DistribusiNormalσX2 tidakdiketahui
T =
nsX
X −µ1( )Statistikauji: berdistribusit
H0 ditolakjika: jikaμ1 >μ2
X >µ1+ t1−α ,n−1
sX
njikaμ1 <μ2
UjiHipotesisNilaiRata-rata
18-Aug-17
http://istia
rto.staff.ugm
.ac.id
9
H0 : µ =µ0
Ha : µ ≠µ0
Z =n
σX
X −µ0( ) > z1−α 2
DistribusiNormalσX2 diketahui
Z =
nσX
X −µ0( )Statistikauji: berdistribusinormal
H0 ditolakjika:
UjiHipotesisNilaiRata-rata
18-Aug-17
http://istia
rto.staff.ugm
.ac.id
10
H0 : µ =µ0
Ha : µ ≠µ0
t =n
sX
X −µ0( ) > t1−α 2,n−1
DistribusiNormalσX2 tidakdiketahui
T =
nsX
X −µ0( )Statistikauji: berdistribusit
H0 ditolakjika:
UjiHipotesisNilaiRata-rata• Hasilujihipotesisadalah• menolakH0,atau• tidakmenolakH0
• Artinya• H0:μ =μ0
• TidakmenolakH0 à “menerima”H0 berartibahwaμ tidakberbedasecarasignifikandenganμ0.
• Tetapitidakdikatakanbahwaμ benar-benarsamadenganμ0karenakitatidakmembuktikanbahwaμ =μ0.
18-Aug-17
http://istia
rto.staff.ugm
.ac.id
11
Ujihipotesisbedanilairata-rataduabuahdistribusinormal
18-Aug-17
http://istia
rto.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 2Statistikauji: berdistribusinormal
H0 ditolakjika:
var X1( ) dan var X2( ) diketahui
Ujihipotesisbedanilairata-rataduabuahdistribusinormal
18-Aug-17
http://istia
rto.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 2Statistikauji:
berdistribusit dengan(n1+n2–2)degreesoffreedom
H0 ditolakjika:
var X1( ) dan var X2( ) tidak diketahui
UjiHipotesisNilaiVarian
18-Aug-17
http://istia
rto.staff.ugm
.ac.id
14
H0 : σ2 = σ02
Ha : σ2 ≠ σ02
χα 2,n−1
2 < χc2 < χ1−α 2,n−1
2
DistribusiNormal
χc
2 =Xi −X( )σ0
2i=1
n
∑Statistikauji: berdistribusichi-kuadrat
H0 diterima(tidakditolak)jika:
UjiHipotesisNilaiVarian
18-Aug-17
http://istia
rto.staff.ugm
.ac.id
15
H0 : σ12 = σ2
2
Ha : σ12 ≠ σ2
2
Fc > F1−α ,n1−1,n2−1
2DistribusiNormal
Fc =
s12
s22Statistikauji: berdistribusiF dengan
H0 ditolakjika:
n1−1( ) dan n2 −1( ) degrees of freedom
s12 > s2
2
UjiHipotesisNilaiVarian
18-Aug-17
http://istia
rto.staff.ugm
.ac.id
16
H0 : σ12 = σ2
2 = ... = σ k2
Ha : σ12 ≠ σ2
2 ≠ ... ≠ σ k2
Qh> χ1−α ,k−1
2
DistribusiNormal
Qh
Statistikauji: berdistribusichi-kuadratdengan(k – 1)degreesoffreedom
H0 ditolakjika:
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
∑
UjiHipotesis• Latihan• LihatkembalidatadebitpuncaktahunanSungaiXYZ.
• Ujihipotesisyangmenyatakanbahwadebitpuncaktahunanrerataadalah650m3/sdanvariansadalah45.000m6/s2.
• Contohujihipotesis.pdf• Exercisesonhypothesisthesis.pdf
18-Aug-17
http://istia
rto.staff.ugm
.ac.id
17
CDFPLOTONPROBABILITYPAPERGoodnessofFitTest
18-Aug-17
http://istia
rto.staff.ugm
.ac.id
18
TestingTheGoodnessofFitofDatatoProbabilityDistributions• Graphical(andvisual)methodstojudgewhetherornotaparticulardistributionadequatelydescribesasetofobservations:• plotandcomparetheobservedrelativefrequencycurvewiththetheoreticalrelativefrequencycurve
• plottheobserveddataonappropriateprobabilitypaperandjudgeastowhetherornottheresultingplotisastraightline
• Statisticaltests:• chi-squaregoodnessoffittest• theKolmogorov-Smirnovtest
18-Aug-17
http://istia
rto.staff.ugm
.ac.id
19
AnnualPeakDischargeofXYZRiver
0.00
0.05
0.10
0.15
0.20
Relativ
efreq
uency
Discharge(m3/s)
observeddatatheoreticaldistribution
18-Aug-17
http://istia
rto.staff.ugm
.ac.id
20
18-Aug-17
http://istia
rto.staff.ugm
.ac.id
21
markers: observed dataline: theoretical distribution
18-Aug-17
http://istia
rto.staff.ugm
.ac.id
22
NormalDistributionPaper
Chi-squareGoodnessofFitTest
• Methodoftest• Comparisonbetweentheactualnumberofobservationsandtheexpectednumberofobservations(expectedaccordingtothedistributionundertest)thatfallintheclassintervals.
• Theexpectednumbersarecalculatedbymultiplyingtheexpectedrelativefrequencybythetotalnumberofobservations.
• Theteststatisticiscalculatedfromthefollowingrelationship:
χc
2 =Oi − Ei( )2
Eii=1
k
∑
18-Aug-17
http://istia
rto.staff.ugm
.ac.id
23
Chi-squareGoodnessofFitTest˃ Theteststatisticiscalculatedfromthefollowingrelationship:
χc
2 =Oi − Ei( )2
Eii=1
k
∑where:k isthenumberofclassintervalsOi isthenumberofobservationsintheithclassintervalEi istheexpectednumberofobservationsintheithclassinterval
accordingtothedistributionbeingtestedχc2 hasadistributionofchi-squarewith(k – p – 1)degreesoffreedom,
wherep isthenumberofparametersestimatedfromthedata
18-Aug-17
http://istia
rto.staff.ugm
.ac.id
24
Chi-squareGoodnessofFitTest˃ Theteststatisticiscalculatedfromthefollowingrelationship:
χc
2 =Oi − Ei( )2
Eii=1
k
∑
˃ Thehypothesisthatthedataarefromthespecifieddistributionis rejected if:
χc2 > χ1−α ,k−p−1
2
1−α α
χ1−α ,k−p−12
18-Aug-17
http://istia
rto.staff.ugm
.ac.id
25
TheKolmogorov-SmirnovTest
• StepsintheKolmogorov-Smirnovtest:• LetPX(x)bethecompletelyspecifiedtheoreticalcumulativedistributionfunctionunderthenullhypothesis.
• LetSn(x)bethesamplecomulativedensityfunctionbasedonnobservations.Foranyobservedx,Sn(x)=k/n wherek isthenumberofobservationslessthanorequaltox.
• Determinethemaximumdeviation,D,definedby:D =max|PX(x)– Sn(x)|
• If,forthechosensignificancelevel,theobservedvalueofD isgreaterthanorequaltothecriticaltabulatedoftheKolmogorov-Smirnovstatistic,thehypothesisisrejected.TableofKolmogorov-Smirnovteststatisticisavailableinmanybooksonstatistics.
18-Aug-17
http://istia
rto.staff.ugm
.ac.id
26
TheKolmogorov-SmirnovTest
• NotesontheKolmogorov-Smirnovtest:• ThetestcanbeconductedbycalculatingthequantitiesPX(x)andSn(x)ateachobservedpointor
• Byplottingthedataontheprobabilitypaperandandselectingthegreatestdeviationontheprobabilityscaleofapointfromthetheoreticalline.• Thedatashouldnotbegroupedforthistest,i.e.ploteachpointofthedataontheprobabilitypaper.
18-Aug-17
http://istia
rto.staff.ugm
.ac.id
27
Chi-squareGoodnessofFitTestandTheKolmogorov-SmirnovTest• Exercise• Dothechi-squaregoodnessoffittestandtheKolmogorov-SmirnovtesttotheannualpeakdischargeofXYZRiveragainstnormaldistribution.
18-Aug-17
http://istia
rto.staff.ugm
.ac.id
28
Chi-squareGoodnessofFitTestandTheKolmogorov-SmirnovTest• Notesonbothtestswhentestinghydrologicfrequencydistributions.• Bothtestsareinsensitiveinthetailsofthedistributions.• Ontheotherhand,thetailsareimportantinhydrologicfrequencydistributions.
• Toincreasesensitivityofchi-squaretest• Theexpectednumberofobservationsinaclassshallnotbelessthan3(or5).
• Definetheclassintervalsothatunderthehypothesisbeingtested,theexpectednumberofobservationsineachclassintervalisthesame.• Theclassintervalswillbeofunequalwidth.• Theintervalwidthswillbeafunctionofthedistributionbeingtested.
18-Aug-17
http://istia
rto.staff.ugm
.ac.id
29
Chi-squareGoodnessofFitTestandTheKolmogorov-SmirnovTest• Exercise• Redothechi-squaregoodnessoffittestandtheKolmogorov-SmirnovtesttotheannualpeakdischargeofXYZRiveragainstnormaldistribution.• Definetheclassintervalssothattheexpectednumberofobservationsineachclassintervalisthesame.
18-Aug-17
http://istia
rto.staff.ugm
.ac.id
30
18-Aug-17
http://istia
rto.staff.ugm
.ac.id
31