0% found this document useful (1 vote)
281 views

Nonparametric Test

This document discusses nonparametric statistical tests including the runs test, Mann-Whitney U test, Wilcoxon matched-pairs signed rank test, and more. It provides information on when to use each test, assumptions of the tests, how to calculate test statistics, and how to interpret results. Examples are given for each test to demonstrate calculations and conclusions. The key advantages and disadvantages of nonparametric tests compared to parametric tests are also outlined.

Uploaded by

Rajesh Dwivedi
Copyright
© Attribution Non-Commercial (BY-NC)
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 (1 vote)
281 views

Nonparametric Test

This document discusses nonparametric statistical tests including the runs test, Mann-Whitney U test, Wilcoxon matched-pairs signed rank test, and more. It provides information on when to use each test, assumptions of the tests, how to calculate test statistics, and how to interpret results. Examples are given for each test to demonstrate calculations and conclusions. The key advantages and disadvantages of nonparametric tests compared to parametric tests are also outlined.

Uploaded by

Rajesh Dwivedi
Copyright
© Attribution Non-Commercial (BY-NC)
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/ 54

MEL761: Statistics for Decision Making

Dr S G Deshmukh
Mechanical Department
Indian Institute of Technology
Non-parametric
Tests

Context
Runs test
Mann-Whiney test
Wilcoxon Matched-
Pairs test
Sign test

Learning Objectives
Recognize the advantages and disadvantages of
nonparametric statistics.
Understand how to use the runs test to test for
randomness.
Know when and how to use the Mann-Whitney U
test, the Wilcoxon matched-pairs signed rank test,
the Kruskal-Wallis test, and the Friedman test.
Learn when and how to measure correlation using
Spearmans rank correlation measurement.
Parametric Assumptions
The observations must be independent
The observations must be drawn from
normally distributed populations
These populations must have the same
variances
The means of these normal and
homoscedastic populations must be linear
combinations of effects due to columns
and/or rows*
Nonparametric Assumptions
Observations are independent
Variable under study has underlying
continuity
Measurement
What are the 4 levels of measurement
discussed in Siegels chapter?
1. Nominal or Classificatory Scale
Gender, ethnic background
2. Ordinal or Ranking Scale
Hardness of rocks, beauty, military ranks
3. Interval Scale
Celsius or Fahrenheit
4. Ratio Scale
Kelvin temperature, speed, height, mass or weight
Parametric vs Nonparametric Statistics
Parametric Statistics are statistical techniques based on
assumptions about the population from which the sample
data are collected.
Assumption that data being analyzed are randomly
selected from a normally distributed population.
Requires quantitative measurement that yield interval or
ratio level data.

Nonparametric Statistics are based on fewer assumptions
about the population and the parameters.
Sometimes called distribution-free statistics.
A variety of nonparametric statistics are available for use
with nominal or ordinal data.
Advantages
of Nonparametric Techniques
Sometimes there is no parametric alternative to
the use of nonparametric statistics.
Certain nonparametric test can be used to
analyze nominal data.
Certain nonparametric test can be used to
analyze ordinal data.
The computations on nonparametric statistics
are usually less complicated than those for
parametric statistics, particularly for small
samples.
Probability statements obtained from most
nonparametric tests are exact probabilities.
Disadvantages
of Nonparametric Statistics
Nonparametric tests can be wasteful of data
if parametric tests are available for use with
the data.
Nonparametric tests are usually not as
widely available and well know as
parametric tests.
For large samples, the calculations for many
nonparametric statistics can be tedious.
Runs Test
Test for randomness - is the order or sequence of
observations in a sample random or not
Each sample item possesses one of two possible
characteristics
Run - a succession of observations which possess
the same characteristic
Example with two runs: F, F, F, F, F, F, F, F, M,
M, M, M, M, M, M
Example with fifteen runs: F, M, F, M, F, M, F,
M, F, M, F, M, F, M, F
Runs Test: Sample Size
Consideration
Sample size: n
Number of sample member possessing
the first characteristic: n
1

Number of sample members possessing
the second characteristic: n
2

n = n
1
+ n
2

If both n
1
and n
2
are s 20, the small
sample runs test is appropriate.
Runs Test: Small Sample Example
H
0
: The observations in the sample are randomly generated.
H
a
: The observations in the sample are not randomly generated.

o = .05

n
1
= 18
n
2
= 8

If 7 s R s 17, do not reject H
0

Otherwise, reject H
0
.

1 2 3 4 5 6 7 8 9 10 11 12
D CCCCC D CC D CCCC D C D CCC DDD CCC

R = 12
Since 7 s R = 12 s 17, do not reject H
0
Runs Test: Large Sample
R
n n
n n

=
+
+
2
1
1 2
1 2
R
n n n n n n
n n
n n
o
=

+ +
+
2 2
1 2
1
1 2 1 2 1 2
2
1 2
( )
( )
( )
Z
R
R
R
=

o
If either n
1
or n
2
is > 20,
the sampling
distribution of R is
approximately normal.
Runs Test: Large Sample Example
H
0
: The observations in the sample are randomly generated.
H
a
: The observations in the sample are not randomly generated.

o = .05

n
1
= 40
n
2
= 10

If -1.96 s Z s 1.96, do not reject H
0

Otherwise, reject H
0
.
1
1 2 3 4 5 6 7 8 9 0 11
NNN F NNNNNNN F NN FF NNNNNN F NNNN F NNNNN

12 13
FFFF NNNNNNNNNNNN R = 13
Runs Test: Large Sample Example
R
n n
n n

=
+
+
=
+
+
=
2
1
2 40 10
40 10
1
17
1 2
1 2
( )( )
R
n n n n n n
n n
n n
o
=

+ +
=

+ +
=
+
+
2 2
1 2
1
2 40 10 2 40 10 40 10
40 10 1
2 213
1 2 1 2 1 2
2
1 2
2
40 10
( )
( )
( )( )[ ( )( ) ( ) ( )]
( )
.
( )
( )
Z
R
R
R
=

=

=

o
13 17
2 213
181
.
.
-1.96 s Z = -1.81 s 1.96,
do not reject H
0
Mann-Whitney U Test
Nonparametric counterpart of the t test for
independent samples
Does not require normally distributed
populations
May be applied to ordinal data
Assumptions
Independent Samples
At Least Ordinal Data
Mann-Whitney U Test
Nonparametric alternative to two-sample t-
test
Actual measurements not used ranks of
the measurements used
Data can be ranked from highest to lowest
or lowest to highest values
Calculate Mann-Whitney U statistic
U = n
1
n
2
+ n
1
(n
1
+1) R
1
2


Example of Mann-Whitney U test
Two tailed null hypothesis that there is no
difference between the heights of male and
female students
H
o
: Male and female students are the same
height
H
A
: Male and female students are not the
same height

Heights
of males
(cm)
Heights
of
females
(cm)
Ranks of
male
heights
Ranks of
female
heights
193 175 1 7
188 173 2 8
185 168 3 10
183 165 4 11
180 163 5 12
178 6
170 9
n
1
= 7 n
2
= 5 R
1
= 30 R
2
= 48
U = n
1
n
2
+ n
1
(n
1
+1) R
1
2

U=(7)(5) + (7)(8) 30
2

U = 35 + 28 30

U = 33


U = n
1
n
2
U

U = (7)(5) 33

U = 2


U
0.05(2),7,5
= U
0.05(2),5,7
= 30

As 33 > 30, H
o
is rejected

Zar, 1996
Mann-Whitney U Test:
Formulas
( )
1 group in values
of ranks or the sum
2 group in number
1 group in number :
2
1
1
2
1
1
1 1
2 1
=
=
=

+
+ =
W
n
n
W
n n
n n
where
U
( )
U
U
U
U
n n
n n n n
Z
U

o
=

=
+ +
=

1 2
1 2 1 2
2
1
12
Incomes of PBS
and Non-PBS Viewers
PBS Non-PBS
24,500 41,000
39,400 32,500
36,800 33,000
44,300 21,000
57,960 40,500
32,000 32,400
61,000 16,000
34,000 21,500
43,500 39,500
55,000 27,600
39,000 43,500
62,500 51,900
61,400 27,800
53,000
n
1
= 14
n
2
= 13
H
o
: The incomes for PBS viewers
and non-PBS viewers are
identical
H
a
: The incomes for PBS viewers
and non-PBS viewers are not
identical
o =
< >
.
. . ,
05
196 196 If Z or Z reject Ho
Ranks of Income from Combined
Groups of PBS and Non-PBS Viewers
Income Rank Group Income Rank Group
16,000 1 Non-PBS 39,500 15 Non-PBS
21,000 2 Non-PBS 40,500 16 Non-PBS
21,500 3 Non-PBS 41,000 17 Non-PBS
24,500 4 PBS 43,000 18 PBS
27,600 5 Non-PBS 43,500 19.5 PBS
27,800 6 Non-PBS 43,500 19.5 Non-PBS
32,000 7 PBS 51,900 21 Non-PBS
32,400 8 Non-PBS 53,000 22 PBS
32,500 9 Non-PBS 55,000 23 PBS
33,000 10 Non-PBS 57,960 24 PBS
34,000 11 PBS 61,000 25 PBS
36,800 12 PBS 61,400 26 PBS
39,000 13 PBS 62,500 27 PBS
39,400 14 PBS
PBS and Non-PBS Viewers:
Calculation of U
( )
( )( )
( )( )
1
1 2
1 1
1
4 7 11 12 13 14 18 195 22 23 24 25 26 27
1
2
14 13
14 15
2
2455
2455
415
W
n n
n n
W
U
= + + + + + + + + + + + + +
=
= +
+

= +
=
.
.
.
.
PBS and Non-PBS Viewers: Conclusion
( )( )
( )
( )( )( )
U
U
n n
n n n n

o
=

=
=
=
+ +
=
=
1 2
1 2 1 2
2
14 13
2
1
12
14 13 28
12
91
206 .
Z
U
U
U
=

=

=

o
415 91
206
240
.
.
.
o reject
Z
H , 96 . 1 40 . 2
Cal
< =
Wilcoxon Matched-Pairs
Signed Rank Test
A nonparametric alternative to the t test for
related samples
Before and After studies
Studies in which measures are taken on the
same person or object under different
conditions
Studies or twins or other relatives
Wilcoxon Matched-Pairs
Signed Rank Test
Differences of the scores of the two
matched samples
Differences are ranked, ignoring the sign
Ranks are given the sign of the difference
Positive ranks are summed
Negative ranks are summed
T is the smaller sum of ranks
Wilcoxon Matched-Pairs Signed
Rank Test: Sample Size
Consideration
n is the number of matched pairs
If n > 15, T is approximately normally
distributed, and a Z test is used.
If n s 15, a special small sample procedure is
followed.
The paired data are randomly selected.
The underlying distributions are symmetrical.
Wilcoxon Matched-Pairs Signed
Rank Test: Small Sample Example
Family
Pair Pittsburgh Oakland
1 1,950 1,760
2 1,840 1,870
3 2,015 1,810
4 1,580 1,660
5 1,790 1,340
6 1,925 1,765
H
0
: M
d
= 0
H
a
: M
d
= 0

n = 6

o =0.05


If T
observed
s 1, reject H
0.
Wilcoxon Matched-Pairs Signed
Rank Test: Small Sample Example
Family
Pair Pittsburgh Oakland d Rank
1 1,950 1,760 190
2 1,840 1,870 -30
3 2,015 1,810 205
4 1,580 1,660 -80
5 1,790 1,340 450
6 1,925 1,765 160
+4
-1
+5
-2
+6
+3
T = minimum(T
+
, T
-
)
T
+
= 4 + 5 + 6 + 3= 18
T
-
= 1 + 2 = 3
T = 3
T = 3 > T
crit
= 1, do not reject H
0
.
Wilcoxon Matched-Pairs Signed
Rank Test: Large Sample Formulas
( )( )
( )( )
less is whichever s, difference - or + either for ranks total =
pairs of number = :
24
1 2 1
4
1
T
n where
T
Z
n n n
n n
T
T
T
T
o

=
+ +
=
+
=
Airline Cost Data for 17 Cities,
1997 and 1999
City 1979 1999 d Rank City 1979 1999 d Rank
1 20.3 22.8 -2.5 -8 10 20.3 20.9 -0.6 -1
2 19.5 12.7 6.8 17 11 19.2 22.6 -3.4 -11.5
3 18.6 14.1 4.5 13 12 19.5 16.9 2.6 9
4 20.9 16.1 4.8 15 13 18.7 20.6 -1.9 -6.5
5 19.9 25.2 -5.3 -16 14 17.7 18.5 -0.8 -2
6 18.6 20.2 -1.6 -4 15 21.6 23.4 -1.8 -5
7 19.6 14.9 4.7 14 16 22.4 21.3 1.1 3
8 23.2 21.3 1.9 6.5 17 20.8 17.4 3.4 11.5
9 21.8 18.7 3.1 10
H
0
: M
d
= 0
H
a
: M
d
= 0
o =
< >
.
. . ,
05
196 196 If Z or Z reject Ho
Airline Cost: T Calculation
T imum
T imum
T T
T
T
=
= + + + + + + + +
=
= + + + + + + +
=
=
=
+
+

min ( , )
. .
. .
min ( , )
17 13 15 14 65 10 9 3 115
99
8 16 4 1 115 65 2 5
54
99 54
54
Airline Cost: Conclusion
( )( ) ( )( )
( )( ) ( )( )
T
T
T
T
n n
n n n
Z
T

o
=
+
= =
=
+ +
= =
=

=

=
1
4
17 18
4
765
1 2 1
24
17 18 35
24
211
54 765
211
107
.
.
.
.
.
o reject
Z
H not do , 96 . 1 07 . 1
96 . 1
Cal
s =
s
Kruskal-Wallis Test
A nonparametric alternative to one-way analysis
of variance
May used to analyze ordinal data
No assumed population shape
Assumes that the C groups are independent
Assumes random selection of individual items
Kruskal-Wallis K Statistic
( )
( )
1 - = df with ,
group a in items of number =
group a in ranks of total
items of number total =
groups of number = :
1 3
1
12
2
j
j
1
2
T
C

K
n
n
C where
n
n n
K
C
j
j
j
n
T
~
=
+
|
|
.
|

\
|
+
=

=
Number of Patients per Day
per Physician in Three Organizational Categories
Two
Partners
Three or
More
Partners HMO
13 24 26
15 16 22
20 19 31
18 22 27
23 25 28
14 33
17
H
o
: The three populations are identical
H
a
: At least one of the three populations is different
o
_
=
= = =
=
>
0 05
1 3 1 2
5991
5991
05 2
2
.
.
. ,
. ,
df C
K If reject H . o
Patients per Day Data:
Kruskal-Wallis Preliminary Calculations
n = n
1
+ n
2
+ n
3
= 5 + 7 + 6 = 18
Two
Partners
Three or
More
Partners HMO
Patients Rank Patients Rank Patients Rank
13 1 24 12 26 14
15 3 16 4 22 9.5
20 8 19 7 31 17
18 6 22 9.5 27 15
23 11 25 13 28 16
14 2 33 18
17 5
T
1
= 29 T
2
= 52.5 T
3
= 89.5
n
1
= 5 n
2
= 7 n
3
= 6
Patients per Day Data: Kruskal-Wallis
Calculations and Conclusion
( )
( )
( )
( )
( )
( ) ( )
K
n n
n
j
j
j
C
T
n
=
+
|
\

|
.
|
|
+
=
+
+ +
|
\

|
.
|
|
+
=
+
+
=
=

12
1
3 1
12
18 18 1 5 7 6
3 18 1
12
18 18 1
1897 3 18 1
9 56
2
1
2 2 2
29 525 895 . .
,
.
. ,
.
. . ,
05 2
2
5991
956 5991
_ =
= > K reject H . o
Friedman Test
A nonparametric alternative to the randomized
block design
Assumptions
The blocks are independent.
There is no interaction between blocks and
treatments.
Observations within each block can be ranked.
Hypotheses
H
o
: The treatment populations are equal
H
a
: At least one treatment population
yields larger values than at least one
other treatment population
Friedman Test
1 - C = df with ,
level treatment particular =
level treatment particular a for ranks total =
(rows) blocks of number =
(columns) levels treatment of number : where
) 1 ( 3
) 1 (
12
2 2
j
1
2
2
_ _
_
~
=
+
+
=

=
r
C
j
j
r
j
R
b
C
C b
C bC
R
Friedman Test: Tensile Strength
of Plastic Housings
Supplier 1 Supplier 2 Supplier 3 Supplier 4
Monday 62 63 57 61
Tuesday 63 61 59 65
Wednesday 61 62 56 63
Thursday 62 60 57 64
Friday 64 63 58 66
H
o
: The supplier populations are equal
H
a
: At least one supplier population yields larger
values than at least one other supplier population
Friedman Test: Tensile Strength
of Plastic Housings
o
_
_
=
= = =
=
>
0 05
1 4 1 3
7 81473
7 81473
05 3
2
2
.
.
. ,
. ,
df C
r
If reject H . o
Friedman Test: Tensile Strength
of Plastic Housings
Supplier 1 Supplier 2 Supplier 3 Supplier 4
Monday 3 4 1 2
Tuesday 3 2 1 4
Wednesday 2 3 1 4
Thursday 3 2 1 4
Friday 3 2 1 4
14 13 5 18
196 169 25 324
j
R
2
j
R
714 ) 324 25 169 196 (
4
1
2
= + + + =

= j
j R
Friedman Test: Tensile Strength
of Plastic Housings
r
j
j
C
bC C
b C
R
2
2
1
12
1
3 1
12
4 4 1
714 3 4 1
10 68
_
=
+
+
=
+
+
=
=

( )
( )
(5)( )( )
( ) (5)( )
.
r
2
781473
_
=10.68 reject H . o > . ,
Spearmans Rank Correlation
Analyze the degree of association of two
variables
Applicable to ordinal level data (ranks)
( )
s
r
d
n
n
where
=

1
6
1
2
2
: n = number of pairs being correlated
d = the difference in the ranks of each pair
Spearmans Rank Correlation for Cattle
and Lamb Prices
Year
Cattle Prices
($/100 lb)
Lamb Prices
($/100 lb)
Rank
Cattle
Rank:
Lamb d d2
1988 66.60 69.10 6 7 -1 1
1989 69.50 66.10 9 6 3 9
1990 74.60 55.50 13 2 11 121
1991 72.70 52.20 12 1 11 121
1992 71.30 59.50 10 3 7 49
1993 72.60 64.40 11 4 7 49
1994 66.70 65.60 7 5 2 4
1995 61.80 78.20 3 10 -7 49
1996 58.70 82.80 1 12 -11 121
1997 63.10 90.30 4 13 -9 81
1998 59.60 72.30 2 8 -6 36
1999 63.40 74.50 5 9 -4 16
2000 68.60 79.40 8 11 -3 9
666
Spearmans Rank Correlation for Cattle
and Lamb Prices
830 .
) 1 ( 13
666 6
1
) 1 (
6
1
13
2
2
2
=

=

n
d
r
n
s
The Sign Test
is a versatile and exceptionally easy-to-apply
nonparametric test. It focuses on the median rather than
the mean as a measure of central tendency.
The only assumption is that the variables come from a
continuous distribution.
Can be applied even to the nominal data.
It is useful in two situations:
1. When test a hypothesis concerning the median of a
population (an alternative to one-sample t-test) and
2. To test equality of the medians in the case of two
dependent samples (as an alternative to matched-pairs
t test).
(Recall that the value of median is the same as for the
mean when a distribution is symmetric)
Both tests are carried out using the same procedure.
The Sign Test
It is called the sign test because we convert original
observations into plus and minus signs. That is, we count
the number of observations greater than the hypothetical
median.
(when dealing with 2 related samples we count the number
of times one treatment has a higher value than the other.)
Ties are not counted (theoretically, with continuous
distributions, there should be no ties, but with limited
measuring instruments ties do occur).
If the null hypothesis is true we would expect
approximately equal number of + and - signs. If either
positive or negative signs predominate, there is evidence
that the null hypothesis is false. As a test statistic we can
use number of positive signs.
Example 1 (One sample)
In an anesthetic used for major surgery, the mean
number of hours it takes for the anesthesia to
wear off is 7.
A new agent has been suggested that supposedly
provides relief much sooner.
In a series of 12 surgeries using the new
anesthetic, the following times for recovery were
observed:

Recovery time:
4 4 5 5 5 6 6 6 6 7 9 11

If it is known that the population is heavily
skewed, which test would you recommend to
assess whether the new agent significantly
reduces recovery time?


Example 1 (One sample)

Recovery time: 4 4 5 5 5 6 6 6 6 7 9 11

Sign: - - - - - - - - - 0 + +
We can see that nine outcomes
are less than the median and two
are larger (we exclude the one
that is equal to the median).
Accordingly, test statistic equals
2 (and we expected 5 pluses
under H0).

Example 1
Sign Test for Median

Sign test of median = 7.000 versus < 7.000

N Below Equal Above P Median
Recovery 12 9 1 2 0.0327 6.000
Test
statistic
Example 2 (Two related samples)
Ten blood samples were sent to two labs for cholesterol
determinations. The results from the two labs are as
follows:
Patient 1 2 3 4 5 6 7 8 9 10
Lab A 296 268 244 272 240 244 282 254 244 262
Lab B 296 271 246 275 241 246 285 255 262 250

Test whether there is a significant difference in cholesterol
determination between two labs.
Example 2 (Two related samples)

Patient 1 2 3 4 5 6 7 8 9 10
Lab A 296 268 244 272 240 244 282 254 244 262
Lab B 296 271 246 275 241 246 285 255 262 250
Sign of 0 - - - - - - - - +
Difference

H
o
: M
1
= M
2
(The median serum cholesterol determination
of both labs is equal)
H
o
: M
1
= M
2

We can see that 8 observations are minuses. Under null
hypothesis we would have expected equal number of + and
minus signs (4.5).

Example 3
The data in the following table depict sulfate
concentrations in rainwater that were measured at two
different locations.

Location A
2.4 11.6 11.9 12 12 12.1 12.2 12.2 12.4 14 14.7 14.8
Location B
10.1 10.4 10.5 10.6 10.8 10.9 11 11.1 11.4 11.5 13.9 25.1

Test the hypothesis that there is no significant difference
between two locations.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy