Chapter 10

Download as pdf or txt
Download as pdf or txt
You are on page 1of 39

CHAPTER 9

NONPARAMETRIC
TECHNIQUES
Dr. Siti Rahayu Binti Mohd Hashim
List of Content
2

 Introduction
 Mann-Whitney test

 Wilcoxon Tests

 Kruskal-Wallis test

 Friedman Test

 Chi Square tests


Introduction
3

 Definition 9.1
Distribution-free tests are statistical analysis that do not
rely on any underlying assumptions about the
probability distribution of the studied population.
 Definition 9.2
The branch of inferential statistics devoted to
distribution-free test is call nonparametrics.
 Definition 9.3
Nonparametric statistics (or test) based on the ranks of
observations are called rank statistics (or rank test).
Mann-Whitney Test
4

 The populations being compared are not normal.


 An alternative for 2 samples t test
 Assumption: Independent random samples of sizes
n1 and n2.
 The procedure:
 Combined the samples
 Assign ranks to the sorted values
 Averaged rank to any ties
 Test Statistic, T = the sum of the ranks for the
observations in the first sample
Example 9.1
5

To compare the running speed of the first year


students, boys (B) and girls(G), the following
information is collected.
Rank: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11
Gender: G, B, G, G, G, G, B, B, B, G, B

Is there any difference between the running speed of


boys and girls?
Solution 9.1
6

Rank: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11
Gender: G, B, G, G, G, G, B, B, B, G, B
Analyze the data according to gender:

Boys: n = 5;
obs: 2, 7, 8, 9, 11 ; Rank Sum: 37
Girls: n = 6;
obs: 1, 3, 4, 5, 6, 10; Rank Sum: 29
Solution 9.1: cont.
7

 To test:
Ho: There is no difference in running speed of boys
and girls
H1: There is difference in running speed of boys
and girls

 It is a 2-tailed test at  = 5% level.


SPSS application
8
SPSS Application
9
SPSS Output & Interpretation
10
Wilcoxon Tests
11

 Wilcoxon Rank Sum Test


 Independent samples
 Wilcoxon Signed Rank Test
 Dependent samples
 Specifically for cases with 2 samples
 Other test: Median test
Wilcoxon Rank Sum Test
12

 Conditions:
 The two samples are random and independent
 The two probability distributions from which the
samples are drawn are continuous
 Test statistic (when 𝑛1 , 𝑛2 > 10):
𝑛 𝑛 +𝑛 +1
𝑅− 1 1 2
𝑧= 2
𝑛1 𝑛2 𝑛1 +𝑛2 +1
12

 R = sum of ranks in smaller sample


Wilcoxon Rank Sum Test
13

 R = 37

 From Table Wilcoxon Rank Sum, with 𝑛1 = 5 and


𝑛2 = 6, the critical value is (19, 41).

 So, we do not reject Ho and conclude that there is


no difference in the speed of boys and girls.
SPSS Output & Interpretation
14
Wilcoxon Signed Rank Test
15

 2 dependent samples
 Procedure:
 Sort the absolute values of the differences from
smallest to largest
 Assign ranks to the absolute value
 Find the sum of the ranks of the positive differences

 If the Ho is true, the sum of the ranks of the positive


differences should be about the same as the
negative ones.
 Other test: Sign test
Sign Test
16

 Hypothesis:
Ho: The median of the differences in the pairs is
zero.
 Test Statistic: The number of positive differences

 If the Ho is true then the numbers of positive and


negative differences should be approximately the
same.
 X : the number of positive differences, under Ho,

X ~ Bin(n, ½)
Example 9.2
17

In a study, the average number of seeds in two pods


was recorded at both the top and the bottom of 10
plants. The objective of study was to determined
whether the position on the plant affected the number
of seeds in the pods.
Plant Number
Location
1 2 3 4 5 6 7 8 9 10
Top 4 5.2 5.7 4.2 4.8 3.9 4.1 3 4.6 6.8
Bottom 4.4 3.7 4.7 2.8 4.2 4.3 3.5 3.7 3.1 1.9
Solution: Wilcoxon Signed Rank Test
18

Plant Number
Location
1 2 3 4 5 6 7 8 9 10
Top 4.0 5.2 5.7 4.2 4.8 3.9 4.1 3.0 4.6 6.8
Bottom 4.4 3.7 4.7 2.8 4.2 4.3 3.5 3.7 3.1 1.9
Differences, di -0.4 1.5 1.0 1.4 0.6 -0.4 0.6 -0.7 1.5 4.9
Rank of │di│ 1.5 8.5 6.0 7.0 3.5 1.5 3.5 5.0 8.5 10.0
 The sum of the positive ranks, R+ = 47
 The sum of the negative ranks, R- = 8
 So, T = min(R+, R-) = 8
Solution: Sign Test
19

Plant Number
Location
1 2 3 4 5 6 7 8 9 10
Top 4 5.2 5.7 4.2 4.8 3.9 4.1 3 4.6 6.8
Bottom 4.4 3.7 4.7 2.8 4.2 4.3 3.5 3.7 3.1 1.9
N P P P P N P N P P
 Number of “P” a.k.a “+”: X = 7
 Hypothesis:

 Ho: The position on the plant does NOT affect the

number of seeds in the pods.


H1: The position on the plant does affect the
number of seeds in the pods.
SPSS Application
20
SPSS Application
21
SPSS Output: Wilcoxon Signed Rank Test
22
SPSS Output: Wilcoxon Signed Rank Test
23

 Critical values for T in Wilcoxon Signed Rank Test


for N =10 at α = 5% is 10.

 Since T = 8 < 10, we reject Ho and conclude that


there is sufficient evidence to suggest that the
position on the plant affect the number of seeds in
the pods.
SPSS Output: Sign Test
24
SPSS Output: Sign Test
25

 Under Ho, X ~ Bin(10, ½) ≈ N(5, 1.58112 )

7−5
 𝑍𝑐𝑎𝑙 = = 1.2649 < 1.645
1.5811

 Therefore, we do not reject Ho and conclude that


there is insufficient evidence to suggest that the
position on the plant affect the number of seeds in
the pods.
Kruskal-Wallis Test
26

 Conditions:
 The k samples are random and independent
 There are five or more measurements in each samples

 The k probability distributions from which the samples


are drawn are continuous
 Hypothesis:
 Ho: The k probability distributions are identical.
 H1: At least two of the k probability distributions differ
in location.
Kruskal-Wallis Test
27

12 𝑛 𝑅𝑗2
 Test statistic: 𝐻= 𝑗=1 𝑛 −3 𝑛+1
𝑛 𝑛+1 𝑗

where: 𝑛𝑗 = # of obs. in sample-j


𝑅𝑗 = rank sum for sample-j
n = 𝑛1 + 𝑛2 + … + 𝑛𝑘

 Rejection region: H > 𝜒𝛼2


 Ties: averaged the ranks
Example 9.3
28

Comparing teaching methods.


Average Test Score
Teaching Method
Case Method Formula Method Equation Method Unitary analysis Method
14.59 20.27 27.82 33.16
23.44 26.84 24.92 26.93
25.43 14.71 28.68 30.43
18.15 22.34 23.32 36.43
20.82 19.49 32.85 37.04
14.06 24.92 33.9 29.76
14.26 20.2 23.42 33.88
SPSS Application
29
SPSS Application
30
SPSS Output: Kruskal-Wallis Test
31
SPSS Output: Median Test
32
Friedman Test
33

 Conditions:
 The treatments are randomly assigned to experimental
units within the blocks
 The measurements can be ranked within blocks.

 The p probability distributions from which the samples


within each block are drawn are continuous
 Hypothesis:
 Ho: The p probability distributions for the p treatments
are identical.
 H1: At least two of the probability distributions differ in
location
Friedman Test
34

 Test statistic:
𝑛
12
𝐹= 𝑅𝑗2 − 3𝑏(𝑘 + 1)
𝑏𝑘(𝑘 + 1)
𝑗=1
where: b = number of blocks
k = number of treatments
Rj = rank sum of the jth treatment
2
 Rejection region: F >𝜒𝛼 with (k-1) degrees of
freedom
Example 9.4
35

The goal is to compare the eight oven positions, which


might differ due to temperature variations. Three
batches of loaves were baked in turn, each batch
consisting of eight loaves. The collected data is the
percentage drip loss in meat loaves (the amount of
liquid that dripped out of a meat loaf during baking
divided by the original weight of loaf).
Example 9.4
36

Batch
Oven Position
1 2 3
1 7.33 8.11 8.06
2 3.22 3.72 4.28
3 3.28 5.11 4.56
4 6.44 5.78 8.61
5 3.83 6.5 7.72
6 3.28 5.11 5.56
7 5.06 5.11 7.83
8 4.44 4.28 6.33
SPSS Application
37
SPSS Application
38
SPSS Output
39

You might also like