Anda di halaman 1dari 32

1

STATISTIKA NON
PARAMETRIK
CI1409 Statistika untuk Komputasi 2
Ahmad Saikhu

Teknik Informatika, Fakultas Teknologi Informasi


Institut Teknologi Sepuluh Nopember Surabaya
Nonparametric Methods: Analisis Data Non
metric (Nominal dan ordinal)
Tujuan
Setelah menyelesaikan Bab ini, anda akan mampu:

1. Melakukan uji tanda untuk sampel dependent


menggunakan distribusi binomial atau distribusi normal
2. Melakukan uji hipotesis untuk sampel dependent menggunakan
Wilcoxon signed-rank test.
3. Melakukan uji dan interpretasi terhadap hasil dari Wilcoxon
rank-sum test untuk independent samples.
4. Melakukan uji dan interpretasi Kruskal-Wallis test untuk
sejumlah independent samples.

2
Ahmad Saikhu @ 2006
3

Tujuan (Lanjutan)

5. Menghitung dan menginterpretasi Spearman’s coefficient dari


rank correlation.
6. Melakukan uji hipotesis untuk menentukan ada korelasi
antara rank pada populasi atau tidak.
Pemodelan Univariate
U n iv a r ia te te c h n iq u e s

M e tric d a ta N o n m e tric d a ta

O n e S a m p le T w o o r m o re s a m p le s O n e S a m p le T w o o r m o re s a m p le s

t-te s t In d e p e n d e n t R e la t e d F re q u e n cy In d e p e n d e n t R e la t e d
Z -te s t C h i- s q u a re
K o lm o g o r o v - S m i r n o v
B in o m ia l

T w o - g ro u p s t-te s t P a ir e d t - te s t C h i- s q u a re S ig n te s t
Z -te s t M a n n - W h itn e y W ilc o x o n t e s t
O n e -W a y A N O V A K o lm o g o r o v - S m i r n o v M cN em ar
K r u s k a l- W a ll i s A N O V A C h i- S q u a re

4
Ahmad Saikhu @ 2006
The Sign Test
Didasarkan Tidak perlu asumsi
atas beda
terhadap populasi.
tanda dari 2
sampel yang
saling
berhubungan
Uji distr. Binomial bila
sampel kecil dan
standard normal (z)
Test yang untuk sampel besar.
diperlukan
adalah dependen
(related) samples.
5
Ahmad Saikhu @ 2006
The Sign Test

Tentukan tanda dari 2 Tentukan jumlah


kelompok sampel yang pasangan sampel
saling berhubungan. yang digunakan.

n is the number of usable


Bandingkan selisih pairs (without ties), X is
jumlah tanda positif the number of pluses or
atau negatif terhadap minuses, and the binomial
critical value probability p=.5.

6
Ahmad Saikhu @ 2006
Normal Approximation

If both n and n(1-) are greater than 5,


the z distribution is appropriate.

Jika jumlah positif Jika jumlah positif


atau negatif lebih dari atau negatif kurang
n/2, maka dari n/2, maka
( X .5) .5n ( X .5) .5n
z z
.5 n .5 n

7
Ahmad Saikhu @ 2006
The Gagliano Research
Institute for Business Studies

is comparing the research and


development expense (R&D)
as a percent of income for a
Contoh 1 sample of glass manufacturing
firms for 2000 and 2001. At
the .05 significance level has
the R&D expense declined?
Use the sign test.
8
Ahmad Saikhu @ 2006
Contoh 1
Company 2000 2001 Difference Sign

Savoth Glass 20 16 4 +
Ruisi Glass 14 13 1 +
Rubin Inc. 23 20 3 +
Vaught 24 17 7 +
Lambert Glass 31 22 9 +
Pimental 22 20 2 +
Olson Glass 14 20 -6 -
Flynn Glass 18 11
9 7 +
Ahmad Saikhu @ 2006
Step 4: H0 is rejected. We conclude
Example
that R&D expense 1 of
as a percent
income declined from 2000 to 2001.
Step 3: There is one negative difference.
That is there was an increase in the
percent for one company
Step 2: H0: is rejected if
the number of negative
signs is 0 or 1.
Step 1
H0: p >.5
10
H : p <.5
Ahmad Saikhu @ 2006
Uji Hipotesis untuk Median

Ketika menguji median,


kita menggunakan
pendekatan Normal untuk
Binomial.

Distribusi z
digunakan untuk
uji statistik

11
Ahmad Saikhu @ 2006
The Gordon Travel Agency
claims that their median
airfare for all their clients to
all destinations is $450. This
claim is being challenged by a
competing agency, who
believe the median is different
from $450. A random sample
of 300 tickets revealed 170
tickets were below $450. Use
the 0.05 level of significance.

Contoh 2
12
Ahmad Saikhu @ 2006
H 0 : median = $450
H 1 : median  $450
( X  .5)  .50n
H0 ditolak jika z z
.5 n
kurang dari –1.96 (170  .5)  .50(300)
atau lebih dari   2.252
.5 300
1.96.

H0 ditolak, Z adalah 2.252.


disimpulkan median
bukan $450.
13
Ahmad Saikhu @ 2006
Uji Wilcoxon Signed-Rank
Digunakan jika
Skala pengukuran
asumsi normality
minimal ordinal
dilanggar pada uji t
berpasangan
Observasi merupakan
pasangan sampel yang
dependent (related)

Wilcoxon Signed-
14 Rank Test
Ahmad Saikhu @ 2006
Wilcoxon Signed-Rank Test

Hitung selisih dari


Ranking selisih
observasi sampel
absolut secara
berpasangan.
ascending.

Bandingkan rangking
Gunakan tanda untuk terendah dengan T
merangking jumlah value (Gunakan tabel
positif dan jumlah t)
negatif.
Wilcoxon Signed-Rank
15
Test
Ahmad Saikhu @ 2006
Dari Contoh 1
Have R&D expenses declined as a percent of income?
Use .05 significance level.

Step 1: H0: Persentase masih sama.


H1: Persentase turun.

Step 2
H0 ditolak jika nilai jumlah
rangking yang lebih kecil, kurang
dari atau sama dengan 5.
16
Ahmad Saikhu @ 2006
Contoh 3
Company 2000 2001 Difference ABS-Diff Rank R+ R-
Savoth Glass 20 16 4 4 4 4 *
Ruisi Glass 14 13 1 1 1 1 *
Rubin Inc. 23 20 3 3 3 3 *
Vaught 24 17 7 7 7 7 *
Lambert Glass 31 22 9 9 8 8 *
Pimental 22 20 2 2 2 2 *
Olson Glass 14 20 -6 6 5 * 5
Flynn Glass 18 11 7 7 6 6 *
The smaller rank sum is 5, which is equal to the critical
value of T. H0 is rejected. The percent has declined
from one year to the next.
17
Ahmad Saikhu @ 2006
Uji Wilcoxon Jumlah-Ranking

Digunakan untuk Tidak diperlukan


menentukan 2 asumsi dari
sampel yang populasi
berasal dari
populasi yang
sama
Skala
Masing-masing Pengukuran
sampel sedikitnya minimal
perlu 8 observasi ordinal

18
Wilcoxon Rank-Sum Test
Ahmad Saikhu @ 2006
Wilcoxon Rank-Sum Test

Lakukan ranking Tentukan jumlah


semua data secara skor untuk
ascending jika data kedua sampel
berasal dari satu
populasi

Gunakan jumlah
n1 ( n1  n 2  1)
ranking yang W 
lebih kecil (W) z  2
untuk menghitung n1 n 2 ( n1  n 2  1)
statistik uji 12

19
Ahmad Saikhu @ 2006
Hills Community College
purchased two vehicles, a
Ford and a Chevy, for the
administration’s use when
traveling. The repair costs for
the two cars over the last three
years is shown on the next
slide. At the .05 significance
level is there a difference in
the two distributions?

20 Contoh 4
Ahmad Saikhu @ 2006
Ford ($) Rank Chevy($) Rank
25.31 3.0 14.89 1.0
33.68 5.5 20.31 2.0
46.89 7.0 25.97 4.0
51.83 8.0 33.68 5.5
87.65 13.0 68.98 9.0
87.90 14.0 78.23 10.0
90.89 15.0 80.31 11.0
120.67 16.0 81.75 12.0
Contoh 4
157.90 17.0
81.50 71.5
21
Ahmad Saikhu @ 2006
Step 1: H0: Kedua populasi sama
H1: Kedua populasi tidak sama

Step 2: H0 ditolak jika


Step 3: Nilai statistik uji
z >1.96 atau z kurang
adalah 0.914.
dari –1.96
n1 ( n1  n 2  1)
W  Step 4: Kita tidak
z 2
n1 n 2 ( n1  n 2  1) menolak Hipotesis Nol.
12 Kita tidak bisa
8(8  9  1) menyimpulkan bahwa
81.5 
 2 biaya untuk perbaikan 2
8(9)(8  9  1) macam kendaraan
12 adalah berbeda.
 0.914 Contoh 4
22
Ahmad Saikhu @ 2006
Kruskal-Wallis Test
Analysis of Variance by Ranks
Digunakan untuk membandingkan 3 kelompok
sampel atau lebih jika bersal dari populasi
yang sama

Skala pengukuran Ini merupakan


minimal ordinal Setiap alternatif dari one-
kelompok way ANOVA
sampel
Data sampel minimal 5 Statistik Uji yang
diranking secara
ascending
observasi digunakan adalah chi-
23
square distribution
Ahmad Saikhu @ 2006
Kruskal-Wallis Test
Analysis of Variance by Ranks

Test
Statistic
12  ( R1 ) 2
( R2 ) 2
( R k ) 2

H   ...   3(n  1)
n(n  1)  n1 n2 nk 

24
Ahmad Saikhu @ 2006
Contoh 5
Keely Ambrose, director of Human
Resources for Miller Industries, wishes to
study the percent increase in salary for
middle managers at the four
manufacturing plants. She gathers a
sample of managers and determines the
percent increase in salary from last year
to this year. At the 5% significance level
can Keely conclude that there is a
difference in the percent increases for the
various plants?

25
Ahmad Saikhu @ 2006
Ranked Increases in Managers’ Salaries

M ilv ille Rank Cam den Rank E a to n Rank V in e la n d Rank


2 .2 2 1 .9 1 3 .7 6 5 .7 9
3 .6 5 2 .7 3 4 .5 7 6 .8 1 0 .5
4 .9 8 3 .1 4 7 .1 1 3 .5 8 .9 16
6 .8 1 0 .5 6 .9 12 9 .3 17 1 1 .6 1 8 .5
7 .1 1 3 .5 8 .3 15 1 1 .6 1 8 .5 1 3 .9 20
39 35 62 74

26
Ahmad Saikhu @ 2006
Step 1: H0: Populasi adalah sama.
H1: Populasi adalah berbeda.
Step 2: H0 ditolak jika  lebih dari 7.185. Derajat
bebas adalah 3 pada 0.05 significance level.
12  (R1 ) (R 2 ) (R3 ) (R 4 ) 
2 2 2 2
H       3(n  1)
n(n  1)  n1 n2 n2 n k 
Hipotesis
12  39 35 62 74 
2 2 2 2
Nol tidak
       3(20  1)
20(20  1)  5 5 5 5  ditolak.
 5.949
Tidak ada kenaikan gaji pada 4
level.
27
Ahmad Saikhu @ 2006
Spearman’s Coefficient of Rank Correlation

Menjelaskan asosiasi Sama dengan


dari 2 set observasi Pearson’s coefficient
tetapi berdasar data
ranking.

6d 2
rs  1 
n( n 2  1) Nilai korelasi
–1.00 s/d 1.00
d adalah selisih ranking
dan n adalah jumlah
observasi
28
Ahmad Saikhu @ 2006
Testing the Significance of rs

Ho: Rank H1: Rank


correlation in correlation in
population is 0 population is
not 0.

n2
t  rs
1  rs2

29
Ahmad Saikhu @ 2006
Preseason Football Rankings
for the Atlantic Coast Conference
by the coaches and sports writers

School Coaches Writers


Maryland 2 3
NC State 3 4
NC 6 6
Virginia 5 5
Clemson 4 2
Wake Forest 7 8
Duke 8 7
Florida State 1 1
Contoh 6
30
Ahmad Saikhu @ 2006
d2
School Coaches Writers d d2
Maryland 2 3 -1 1
NC State 3 4 -1 1
NC 6 6 0 0
Virginia 5 5 0 0
Clemson 4 2 2 4
Wake Forest 7 8 -1 1
Duke 8 7 1 1
Florida State 1 1 0 0
Total 8

31
Ahmad Saikhu @ 2006
2
6d
Example
Coefficient 6 rs  1 
Continued 2
of Rank n(n  1)
Correlation 6(8)
 1 2
 0.905
8(8  1)

There is a strong
correlation between
the ranks of the
coaches and the
sports writers.
32
Ahmad Saikhu @ 2006

Anda mungkin juga menyukai