0% found this document useful (0 votes)
20 views27 pages

Kuliah 13

The document discusses several nonparametric methods for statistical analysis including the sign test, runs test, Mann-Whitney U test, Wilcoxon signed-rank test, Kruskal-Wallis test, and Friedman test. These nonparametric tests make few assumptions about the population distribution and are used to compare paired observations, detect randomness, compare two populations, and compare several populations.

Uploaded by

irwanarnol72
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views27 pages

Kuliah 13

The document discusses several nonparametric methods for statistical analysis including the sign test, runs test, Mann-Whitney U test, Wilcoxon signed-rank test, Kruskal-Wallis test, and Friedman test. These nonparametric tests make few assumptions about the population distribution and are used to compare paired observations, detect randomness, compare two populations, and compare several populations.

Uploaded by

irwanarnol72
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 27

STATISTIKA TKI 2104

TEKNIK INDUSTRI

13 Nonparametric Methods
• Using Statistics
• The Sign Test
• The Runs Test - A Test for Randomness
• The Mann-Whitney U Test
• The Wilcoxon Signed-Rank Test
• The Kruskal-Wallis Test - A Nonparametric
Alternative to One-Way ANOVA
• The Friedman Test for a Randomized Block
Design
STATISTIKA TKI 2104
TEKNIK INDUSTRI

13-1 Using Statistics (Parametric Tests)

•• Parametric
Parametric Methods
Methods
Inferences
 Inferences based
based on
on assumptions
assumptions about
about the
the
nature of
nature of the
the population
population distribution
distribution
•• Usually:
Usually:population
populationisisnormal
normal
Types
 Types of
of tests
tests
•• z-test
z-testor
ort-test
t-test
»»Comparing
Comparingtwotwopopulation
populationmeans
meansororproportions
proportions
»»Testing
Testingvalue
valueof
ofpopulation
populationmean
meanor
orproportion
proportion

•• ANOVA
ANOVA
»»Testing
Testingequality
equalityof
ofseveral
severalpopulation
populationmeans
means
STATISTIKA TKI 2104
TEKNIK INDUSTRI

Nonparametric Tests

•• Nonparametric
Nonparametric Tests
Tests
Distribution-free
 Distribution-free methods
methods making
making no
no
assumptions about
assumptions about the
the population
population distribution
distribution
Types
 Types of
of tests
tests
•• Sign
Signtests
tests
»» Sign
SignTest:
Test:Comparing
Comparingpaired
pairedobservations
observations
»» McNemar
McNemarTest:
Test:Comparing
Comparingqualitative
qualitativevariables
variables
»» Cox
Coxand
andStuart
StuartTest:
Test:Detecting
Detectingtrend
trend

•• Runs
Runstests
tests
»» Runs
RunsTest:
Test:Detecting
Detectingrandomness
randomness
»» Wald-Wolfowitz
Wald-WolfowitzTest:
Test:Comparing
Comparingtwotwodistributions
distributions
STATISTIKA TKI 2104
TEKNIK INDUSTRI

Nonparametric Tests (Continued)

•• Nonparametric
Nonparametric Tests
Tests
Ranks
 Rankstests
tests
•• Mann-Whitney
Mann-WhitneyUUTest: Test:Comparing
Comparingtwotwopopulations
populations
•• Wilcoxon
WilcoxonSigned-Rank
Signed-RankTest:
Test:Paired
Pairedcomparisons
comparisons
•• Comparing
Comparingseveral
severalpopulations:
populations:ANOVA
ANOVAwithwithranks
ranks
»» Kruskal-Wallis
Kruskal-WallisTestTest
»» Friedman
FriedmanTest:
Test:Repeated
Repeatedmeasures
measures
Spearman
 SpearmanRank RankCorrelation
CorrelationCoefficient
Coefficient
Chi-Square
 Chi-SquareTestsTests
•• Goodness
GoodnessofofFitFit
•• Testing
Testingfor
forindependence:
independence:Contingency
ContingencyTable
TableAnalysis
Analysis
•• Equality
EqualityofofProportions
Proportions
STATISTIKA TKI 2104
TEKNIK INDUSTRI

Nonparametric Tests (Continued)

•• Deal
Deal with
with enumerative
enumerative (frequency
(frequency counts)
counts)
data.
data.
•• Do
Do not
not deal
deal with
with specific
specific population
population
parameters, such
parameters, such as
as the
the mean
mean oror standard
standard
deviation.
deviation.
•• Do
Do not
not require
require assumptions
assumptions aboutabout specific
specific
population distributions
population distributions (in
(in particular,
particular, the
the
normality assumption).
normality assumption).
STATISTIKA TKI 2104
TEKNIK INDUSTRI

13-2 Sign Test

•• Comparing
Comparing paired
paired observations
observations
Paired
 Paired observations:
observations: X
X and
and Y
Y
pp==P(X>Y)
 P(X>Y)
•• Two-tailed
Two-tailedtest
test HH0:0:pp==0.50
0.50
HH1:1:p0.50
p0.50
•• Right-tailed
Right-tailedtest
test 0.50
HH0:0:pp0.50
HH1:1:p0.50
p0.50
•• Left-tailed
Left-tailedtest 0.50
test HH:0:pp0.50
0
HH1:1:p0.50
p0.50
•• Test
Teststatistic:
statistic: TT==Number
Numberof of++signs
signs
STATISTIKA TKI 2104
TEKNIK INDUSTRI

Sign Test Decision Rule

•• Small
Small Sample:
Sample: Binomial
Binomial Test
Test
For
 Foraatwo-tailed
two-tailedtest,
test,find
findaacritical
criticalpoint
pointcorresponding
corresponding
asclosely
as closelyasaspossible
possibleto /2(C
to/2 (C11))and
anddefine
defineCC22asasn-C
n-C11..
Rejectnull
Reject nullhypothesis
hypothesisififTTCC11or C22..
orTTC
For
 Foraaright-tailed
right-tailedtest,
test,reject C,where
rejectHH00ififTTC, whereCCisisthe
the
valueof
value ofthe
thebinomial
binomialdistribution
distributionwithwithparameters
parametersnn
andpp==0.50
and 0.50such
suchthat
thatthe
thesum
sumof ofthe
theprobabilities
probabilitiesofofall
all
valuesless
values lessthan
thanor
orequal
equaltotoCCisisasasclose
closeas aspossible
possibleto
to
thechosen
the chosenlevel
levelof
ofsignificance,
significance,. .
For
 Foraaleft-tailed
left-tailedtest,
test,reject C,where
rejectHH00ififTTC, whereCCisis
definedas
defined asabove.
above.
STATISTIKA TKI 2104
TEKNIK INDUSTRI

Example 13-1
CEO Before
Before After
After Sign Cumulative
CEO Sign Binomial
11 33 44 11 ++ Probabilities
22 55 55 00 (n=15, p=0.5)
33 22 33 11 ++ x F(x)
44 22 44 11 ++ n = 15 T = 12 0 0.00003
55 44 44 00 1 0.00049
66 22 33 11 ++ 0.025 C1
2 0.00369
77 11 22 11 ++ 3 0.01758
88 55 44 -1-1 --
C1=3 C2 = 15-3 = 12 4 0.05923
99 44 55 11 ++ H0 rejected, since 5 0.15088
10 6 0.30362
10 55 44 -1-1 --
7 0.50000
11
11
12
33 44 11 ++ TC2 8 0.69638
12 22 55 11 ++ 9 0.84912
13
13 22 55 11 ++
14 10 0.94077
14 22 33 11 ++ 11 0.98242
15
15 11 22 11 ++ 12 0.99631
16
16 33 22 -1-1 -- 13 0.99951
17
17 44 55 11 ++ 14 0.99997
15 1.00000
STATISTIKA TKI 2104
TEKNIK INDUSTRI

Example 13-1

H0: p = 0.5
H1: p 
Test Statistic: T = 12
p-value = 0.0352.
For  = 0.05,
the null hypothesis is rejected since 0.0352 < 0.05.

Thus one can conclude that there is a change in attitude


toward a CEO following the award of an MBA degree.
STATISTIKA TKI 2104
TEKNIK INDUSTRI
13-3 The Runs Test - A Test for
Randomness
AArun
runisisaasequence
sequenceof
oflike
likeelements
elementsthat
thatare
arepreceded
precededand
andfollowed
followed
bydifferent
by differentelements
elementsor
ornonoelement
elementatatall.
all.

Case1:1:S|E|S|E|S|E|S|E|S|E|S|E|S|E|S|E|S|E|S|E
Case S|E|S|E|S|E|S|E|S|E|S|E|S|E|S|E|S|E|S|E ::RR==20
20Apparently
Apparentlynonrandom
nonrandom
Case2:2:SSSSSSSSSS|EEEEEEEEEE
Case SSSSSSSSSS|EEEEEEEEEE ::RR==22 Apparently
Apparentlynonrandom
nonrandom
Case3:3:S|EE|SS|EEE|S|E|SS|E|S|EE|SSS|E
Case S|EE|SS|EEE|S|E|SS|E|S|EE|SSS|E ::RR==12
12Perhaps
Perhapsrandom
random

AAtwo-tailed
two-tailedhypothesis
hypothesistesttestfor
forrandomness:
randomness:
HH0:0:Observations
Observationsare aregenerated
generatedrandomly
randomly
HH1:1:Observations
Observationsare arenot
notgenerated
generatedrandomly
randomly
TestStatistic:
Test Statistic:
R=Numberof
R=Number ofRuns
Runs
Reject levelififRR C1
RejectHH0atatlevel C1or C2,as
orRRC2, asgiven
givenininTable
Table8,8,with
withtotal
totaltail
tail
0
probabilityP(R
probability C)1)++P(R
P(RC C)2)==
P(RC 
1 2
STATISTIKA TKI 2104
TEKNIK INDUSTRI

Runs Test: Examples

Table 8: Number of Runs (r)


(n1,n2) 11 12 13 14 15 16 17 18 19 20
.
.
.
(10,10) 0.586 0.758 0.872 0.949 0.981 0.996 0.999 1.000 1.000 1.000

Case1:
Case 1:nn1 ==10
10 nn2==10 10 R=
R= 20
20 p-value0
p-value0
1 2
Case2:
Case 2:nn1 ==10
10 nn2==10 10 RR==22 p-value 0
p-value0
1 2
Case3:
Case 3:nn1 ==10
10 nn2==10 10 R=
R=12
12
1 2
PRF(11)]
p-valuePR
p-value F(11)]
==(2)(1-0.586)
(2)(1-0.586)==(2)(0.414)
(2)(0.414)==0.828
0.828
HH00not
notrejected
rejected
STATISTIKA TKI 2104
TEKNIK INDUSTRI
Large-Sample Runs Test: Using the
Normal Approximation

Themean
The meanof
of the
thenormal
normaldistribution
distributionof
ofthe
thenumber
numberof
ofruns:
runs:

E ( R )  22nnnn  1 1 2
E ( R)  n  n  1 1 2

n n 1
1
2
2

Thestandard
The standarddeviation:
deviation:

  22nnnn((22nnnn nn nn))


  (n  n ) (n  n  1)
1 2 1 2 1 2
1 2 1 2 1 2
R 2
(n  n ) (n  n  1)
R 2
1 2 1 2
1 2 1 2

Thestandard
The standardnormal
normaltest
teststatistic:
statistic:

z  RREE((RR))
z   R
R
STATISTIKA TKI 2104
TEKNIK INDUSTRI

Large-Sample Runs Test: Example 13-2

Example 13-2: n1 = 27 n2 = 26 R = 15
2n n ( 2)(27)(26)
E ( R)  1 2  1   1  26.49  1  27.49
n n ( 27  26)
1 2
2n n ( 2n n  n  n )
  1 2 1 2 1 2  ( 2)(27)(26)((2)(27)(26)  27  26))
R ( n  n ) 2 ( n  n  1) ( 27  26) 2 ( 27  26  1)
1 2 1 2
1896804
  12.986  3.604
146068
R  E ( R ) 15  27.49
z   3.47 p - value = 2(1 - .9997) = 0.0006
 3.604
R
H0 should be rejected at any common level of significance.
STATISTIKA TKI 2104
TEKNIK INDUSTRI

Using the Runs Test to Compare Two Population


Distributions (Means): the Wald-Wolfowitz Test

Thenull
The nulland
andalternative
alternativehypotheses
hypothesesfor
forthe
theWald-Wolfowitz
Wald-Wolfowitztest:
test:
HH00::The
Thetwo
twopopulations
populationshave
havethe
thesame
samedistribution
distribution
HH11::The
Thetwo
twopopulations
populationshave
havedifferent
differentdistributions
distributions
Thetest
The teststatistic:
statistic:
RR==Number
Numberof ofRuns
Runsininthe
thesequence
sequenceofofsamples,
samples,when
when
thedata
the datafrom
fromboth
bothsamples
sampleshave
havebeen
beensorted
sorted

Example 13-3:

Salesperson A: 35 44 39 50 48 29 60 75 49 66
Salesperson B: 17 23 13 24 33 21 18 16 32
STATISTIKA TKI 2104
TEKNIK INDUSTRI

The Wald-Wolfowitz Test: Example 13-3


Sales
nn11 ==10
10 nn2==99 R=R=44
Sales
Sales
Sales Sales
Sales Person
Person 2
Sales Person (Sorted) (Sorted) Runs
Sales
35
35
Person
AA
(Sorted)
13
13
(Sorted)
BB
Runs
p-value PR
p-valuePR 
HH00may
maybe
berejected
rejected
44
44 AA 16
16 BB
39
39 AA 17
17 BB
48
48 AA 21
21 BB
60
60 AA 24
24 BB 11 Table Number of Runs (r)
75 AA 29 AA 22
75
49
29 (n1,n2) 2 3 4 5
49 AA 32
32 BB .
66
66 AA 33
33 BB 33 .
17
17 BB 35
35 AA .
23 BB 39 AA
23
13
13 BB
39
44
44 AA
(9,10) 0.000 0.000 0.002 0.004 ...
24
24 BB 48
48 AA
33
33 BB 49
49 AA
21
21 BB 50
50 AA
18
18 BB 60
60 AA
16
16 BB 66
66 AA
32
32 BB 75
75 AA 44
STATISTIKA TKI 2104
TEKNIK INDUSTRI

Ranks Tests

•• Ranks
Ranks tests
tests

 Mann-Whitney U
Mann-Whitney U Test:
Test: Comparing
Comparing twotwo populations
populations

 Wilcoxon Signed-Rank
Wilcoxon Signed-Rank Test:
Test: Paired
Paired comparisons
comparisons

 Comparing several
Comparing several populations:
populations: ANOVA
ANOVA withwith ranks
ranks
•• Kruskal-Wallis
Kruskal-Wallis Test
Test
•• Friedman
Friedman Test:
Test: Repeated
Repeated measures
measures
STATISTIKA TKI 2104
TEKNIK INDUSTRI
13-4 The Mann-Whitney U Test
(Comparing Two Populations)
Thenull
The nulland
andalternative
alternativehypotheses:
hypotheses:
HH00::The
Thedistributions
distributionsof oftwo
twopopulations
populationsareareidentical
identical
HH11::The
Thetwotwopopulation
populationdistributions
distributionsare
arenot
notidentical
identical
TheMann-Whitney
The Mann-WhitneyUUstatistic:
statistic:
n1 ( n1  1)
U  n1 n2   R1 R 1   Ranks from sample 1
2
wherenn1isisthe
where thesample
samplesizesizefrom
frompopulation
population11and andnn2isisthe
the
1 2
samplesize
sample sizefrom
frompopulation
population2.2.
n1 n2 n1 n2 (n1  n2  1)
E [U ]  U 
2 12
U  E [U ]
The large - sample test statistic: z 
U
STATISTIKA TKI 2104
TEKNIK INDUSTRI
The Mann-Whitney U Test:
Example 13-4
Rank n1 ( n1  1)
Rank U  n1 n 2   R1
Model
Model Time
Time Rank
Rank Sum
Sum 2
AA 35
35 55 (6)(6 + 1)
= (6)(6) +  52
AA 38
38 88 2
AA 40
40 10
10 5
AA 42
42 12
12
Cumulative Distribution Function of the Mann-
AA 41
41 11
11 Whitney U Statistic
AA 36
36 66 52
52 n2=6
BB 29
29 22 n1=6
BB 27
27 11 u
.
BB 30
30 33 .
.
BB 33
33 44 4 0.0130 P(u5)
BB 39
39 99 5 0.0206
BB 37
37 77 26
26 6 0.0325
.
.
.
STATISTIKA TKI 2104
TEKNIK INDUSTRI
Example 13-5: Large-Sample
Mann-Whitney U Test
Score Rank Score Rank
Score
Score Program Rank
Rank
Sum
Score
Score Program Rank
Rank
Sum n1 ( n1  1)
Score Program Rank
85
85 1
1 20.0
20.0
Sum
20.0
20.0
Score Program Rank
65
65 2
2 10.0
10.0
Sum
10.0
10.0
U  n1n2   R1
87
87 1
1 21.0
21.0
41.0
41.0
57
57 2
2 4.0
4.0
14.0
14.0 2
92 1 27.0 68.0 74 2 16.0 30.0
92
98
1
1
27.0
30.0
68.0
98.0
74
43
2
2
16.0
2.0
30.0
32.0 (15)(15  1)
98
90
90
1
1
1
30.0
26.0
26.0
98.0
124.0
124.0
43
39
39
2
2
2
2.0
1.0
1.0
32.0
33.0
33.0
 (15)(15)   312 .5  32 .5
88
88 1
1 23.0
23.0
147.0
147.0
88
88 2
2 23.0
23.0
56.0
56.0 2
75 1 17.0 164.0 62 2 8.5 64.5
75
72
1
1
17.0
13.5
164.0
177.5
62
69
2
2
8.5
11.0
64.5
75.5 n1n2 (15)(15)
72
60
60
1
1
1
13.5
6.5
6.5
177.5
184.0
184.0
69
70
70
2
2
2
11.0
12.0
12.0
75.5
87.5
87.5
E [U ]  = = 112.5
93
93 1
1 28.0
28.0
212.0
212.0
72
72 2
2 13.5
13.5
101.0
101.0 2 2
88 1 23.0 235.0 59 2 5.0 106.0
88
89
1
1
23.0
25.0
235.0
260.0
59
60
2
2
5.0
6.5
106.0
112.5 n1n2 ( n1  n2  1)
89
96
96
1
1
1
25.0
29.0
29.0
260.0
289.0
289.0
60
80
80
2
2
2
6.5
18.0
18.0
112.5
130.5
130.5
U 
73
73 1
1 15.0
15.0
304.0
304.0
83
83 2
2 19.0
19.0
149.5
149.5 12
62 1 8.5 312.5 50 2 3.0 152.5
62 1 8.5 312.5 50 2 3.0 152.5
(15)(15)(15  15  1)
  24 .109
12
Sincethe
Since thetest
teststatistic
statisticisiszz==-3.32,
-3.32, U  E [U ] 32 .5  112 .5
p-value0.0005,
thep-value 0.0005,and
andHH0isisrejected.
rejected. z    3.32
the 0 U 24 .109
Thatis,
That is,the
theLC
LC(Learning
(LearningCurve)
Curve)
programisismore
program moreeffective.
effective.
STATISTIKA TKI 2104
TEKNIK INDUSTRI
13-5 The Wilcoxon Signed-Ranks Test
(Paired Ranks)
Thenull
The nulland
andalternative
alternativehypotheses:
hypotheses:
HH0:0:The
Themedian
mediandifference
differencebetween
betweenpopulations
populationsare
are11and
and22isiszero
zero
HH1:1:The
Themedian
mediandifference
differencebetween
betweenpopulations
populationsare
are11and
and22isisnot
notzero
zero

Findthe
Find thedifference
differencebetween
betweenthe theranks
ranksfor
foreach
eachpair,
pair,DD==xx1-x-x,2,and
andthen
thenrank
rankthe
the
1 2
absolutevalues
absolute valuesofofthe
thedifferences.
differences.
TheWilcoxon
The WilcoxonTTstatistic
statisticisisthe
thesmaller
smallerofofthe
thesums
sumsofofthe
thepositive
positiveranks
ranksand
andthe
thesum
sum
ofofthe
thenegative ranks: T  min (  ),  (  ) 
negativeranks:

Forsmall
For smallsamples,
samples,aaleft-tailed
left-tailedtest
testisisused,
used,using
usingthe
thevalues
valuesininAppendix
AppendixC,
C,Table
Table10.
10.
n ( n  1) n ( n  1)( 2 n  1)
E[T ]  T 
4 24
T  E[T ]
Thelarge-sample
The large-sampletest
teststatistic:
statistic: z
T
STATISTIKA TKI 2104
TEKNIK INDUSTRI

Example 13-6
Sold Sold
Sold Sold Rank Rank
Rank Rank Rank
Rank T=34
(1) (2)
(2) D=x-x
1-x2 ABS(D) ABS(D) (D>0)
(D>0) (D<0)
(D<0) T=34
(1) D=x 1 2 ABS(D) ABS(D)
n=15
n=15
56
56 40
40 16
16 16
16 9.0
9.0 9.0
9.0 00 P=0.05
P=0.05 30
30
48 70 -22 22 12.0 0.0 12
48
100
70
60
-22
40
22
40
12.0
15.0
0.0
15.0
12 P=0.025
P=0.025 25
25
100 60 40 40 15.0 15.0 00
85
85 70
70 15
15 15
15 8.0
8.0 8.0
8.0 00 P=0.01
P=0.01 20
20
22
22 88 14
14 14
14 7.0
7.0 7.0
7.0 00 P=0.005 16
44
44 40
40 44 44 2.0
2.0 2.0
2.0 00
P=0.005 16
35
35 45
45 -10
-10 10
10 6.0
6.0 0.0
0.0 66
HH00isisnot
notrejected
rejected(Note
(Notethe
the
28
28 77 21
21 21
21 11.0
11.0 11.0
11.0 00
52
52 60
60 -8-8 88 5.0
5.0 0.0
0.0 55
77
77 70
70 77 77 3.5
3.5 3.5
3.5 00
arithmeticerror
arithmetic errorininthe
thetext
textfor
for
89
89 90
90 -1-1 11 1.0
1.0 0.0
0.0 11 store13)13)
10 10 store
10 10 00 ** ** ** **
65
65 85
85 -20
-20 20
20 10.0
10.0 0.0
0.0 10
10
90
90 61
61 29
29 29
29 13.0
13.0 13.0
13.0 00
70
70 40
40 30
30 30
30 14.0
14.0 14.0
14.0 00
33
33 26
26 77 77 3.5
3.5 3.5
3.5 00
Sum:
Sum: 86
86 34
34
STATISTIKA TKI 2104
TEKNIK INDUSTRI

Example 13-7
Hourly Rank Rank Rank
Hourly Rank Rank Rank
Messages
Messages
Md0
Md0
D=x1-x2 ABS(D) ABS(D)
D=x1-x2 ABS(D) ABS(D)
(D>0)
(D>0)
(D<0)
(D<0)
n ( n  1) (25)(25 + 1)
E[ T ]  = = 162.5
151 149 2 2 1.0 1.0 0.0 4 4
151 149 2 2 1.0 1.0 0.0
144 149 -5 5 2.0 0.0 2.0
144 149 -5 5 2.0 0.0 2.0
123
123
149
149
-26
-26
26
26
13.0
13.0
0.0
0.0
13.0
13.0
n ( n  1)( 2 n  1)
178
178
149
149 29
29 29
29
15.0
15.0
15.0
15.0
0.0
0.0 T 
105 149 -44 44 23.0 0.0 23.0
105
112
149
149
-44
-37
44
37
23.0
20.0
0.0
0.0
23.0
20.0
24
112 149 -37 37 20.0 0.0 20.0
140
140
149
149 -9
-9
9
9 4.0
4.0
0.0
0.0
4.0
4.0 25( 25  1)(( 2 )( 25)  1)
167
167
177
149
149
149
18
18
28
18
18
28
10.0
10.0
14.0
10.0
10.0
14.0
0.0
0.0
0.0

177
185
149
149
28
36
28
36
14.0
19.0
14.0
19.0
0.0
0.0 24
185 149 36 36 19.0 19.0 0.0
129
129
149
149
-20
-20
20
20
11.0
11.0
0.0
0.0
11.0
11.0 33150
160 149 11 11 6.0 6.0 0.0
160
110
149
149
11
-39
11
39
6.0
21.0
6.0
0.0
0.0
21.0   37 .165
110
170
149
149
-39
21
39
21
21.0
12.0
0.0
12.0
21.0
0.0 24
170 149 21 21 12.0 12.0 0.0
198 149 49 49 25.0 25.0 0.0 The large - sample test statistic:
198 149 49 49 25.0 25.0 0.0
165 149 16 16 8.0 8.0 0.0
165 149 16 16 8.0 8.0 0.0
109
109
149
149
-40
-40
40
40
22.0
22.0
0.0
0.0
22.0
22.0 T  E[ T ]
118 149 -31 31 16.5 0.0 16.5
118
155
149
149
-31
6
31
6
16.5
3.0
0.0
3.0
16.5
0.0 z 
155
102
102
149
149
149 -47
6
-47
6
47
47
3.0
24.0
24.0
3.0
0.0
0.0
0.0
24.0
24.0
T
164 149 15 15 7.0 7.0 0.0
164
180
149
149
15
31
15
31
7.0
16.5
7.0
16.5
0.0
0.0 163.5  162 .5
180 149 31 31 16.5 16.5 0.0
139
139
149
149
-10
-10
10
10
5.0
5.0
0.0
0.0
5.0
5.0   0.027
166
166
149
149 17
17 17
17
9.0
9.0
9.0
9.0
0.0
0.0 37 .165
82 149 33 33 18.0 18.0 0.0
82 149 33 33 18.0 18.0 0.0 H 0 cannot be rejected
Sum: 163.5 161.5
Sum: 163.5 161.5
STATISTIKA TKI 2104
TEKNIK INDUSTRI

13-6 The Kruskal-Wallis Test - A Nonparametric


Alternative to One-Way ANOVA

TheKruskal-Wallis
The Kruskal-Wallishypothesis
hypothesistest:
test:
HH00::All
Allkkpopulations
populationshave
havethe
thesame
samedistribution
distribution
HH11::Not
Notall
allkkpopulations
populationshave
havethe
thesame
samedistribution
distribution

TheKruskal-Wallis
The Kruskal-Wallistest
teststatistic:
statistic:
12  k Rj 
2

n(n  1)  
H   3(n  1)
j 1 n j 

If each n > 5, then H is approximately distributed as a 22.


If each nj j> 5, then H is approximately distributed as a  .
STATISTIKA TKI 2104
TEKNIK INDUSTRI

Example 13-8: The Kruskal-Wallis Test


SoftwareTime
Software Time Rank
RankGroup
GroupRankSum
RankSum
11 45 14
45 14 11 90
90 2
11 38 10
38 10 22 56
56 12  k R j
11 56 16
56 16 33 25
25 H   j1   3( n  1)
11 60 17
60 17 n ( n  1)  nj 
11 47 15 15
 902 562 252 
47
11 65 18
65 18 12
22 30
30 88  
18(18  1)  6

6

6 
  3(18  1)
22 40 11
40 11
22 28
28 77  12   11861
22 44 13
44 13
    57
22 25
25 55  342   6 
22 42 12
42 12
 12 .3625
33 22
22 44
33 19
19 33
33 15
15 11 2(2,0.005)=10.5966, so H0 is rejected.
33 31
31 99
33 27
27 66
33 17
17 22
STATISTIKA TKI 2104
TEKNIK INDUSTRI
Further Analysis (Pairwise Comparisons
of Average Ranks)
If the null hypothesis in the Kruskal-Wallis test is rejected, then we may
wish, in addition, compare each pair of populations to determine which are
different and which are the same.

The pairwise comparison test statistic:


D  Ri  R j
where R i is the mean of the ranks of the observations from
population i.

The critical point for the paired comparisons:


 n(n  1)  1 1 
C KW  (   , k 1 ) 
2
   
 12  ni n j 
Reject if D > C KW
STATISTIKA TKI 2104
TEKNIK INDUSTRI

Pairwise Comparisons: Example 13-8


Critical Point:
n(n  1)  1 1 
C KW  (  2 ,k 1 )     
 12  ni n j 
18(18  1)  1 1
 ( 9.21034)   
12  6 6
 87.49823  9.35
90
R1   15 D1,2  15  9.33  5.67
6
56
R2   9.33 D1,3  15  4.17  10.83 ***
6
25
R3   4.17 D2,3  9.33  4.17  516
.
6
STATISTIKA TKI 2104
TEKNIK INDUSTRI
13-7 The Friedman Test for a
Randomized Block Design
The Friedman test is a nonparametric version of the randomized block design
ANOVA. Sometimes this design is referred to as a two-way ANOVA with one item
per cell because it is possible to view the blocks as one factor and the treatment levels
as the other factor. The test is based on ranks.

TheFriedman
The Friedmanhypothesis
hypothesistest:
test:
HH0:0:The
Thedistributions
distributionsof ofthe
thekktreatment
treatmentpopulations
populationsare
areidentical
identical
HH1:1:Not
Notall
allkkdistribution
distributionare
areidentical
identical

TheFriedman
The Friedmantest
teststatistic:
statistic:
12
 
k

 R  3n( k  1)
2 2

nk (k  1)
j
j 1

Thedegrees
The degreesof
offreedom
freedomfor
forthe
thechi-square
chi-squaredistribution
distributionisis(k
(k––1).
1).

You might also like