Non-Parametric Test
Non-Parametric Test
Testing (usually called ‘hypothesis testing’ ) play a major role in statistical investigation. In
statistical testing, we are concerned with examining the truth or otherwise, of hypothesis
(assumptions, claims, guesses, etc.) about some feature(s) of one or more populations. Almost
all large and small sample tests such as t, F and 2 are based on the assumptions that the
parent population (from which the sample is drawn) has a specific distribution, such as normal
distribution. The distributions are usually defined through some parameters. Nonparametric
tests do not require such assumption. Hence nonparametric tests are also known as
distribution free tests. The term nonparametric refers to the fact that there are no parameters
involved in the traditional sense of the term parameter used generally. Nonparametric test
statistics utilize some simple aspects of sample data such as the signs of measurements, order
relationships or category frequencies. Therefore, stretching or compressing the scale does not
alter them. As a consequence, the null distribution of the nonparametric test statistic can be
determined without regard to the shape of the parent population distribution.
The inferences drawn from tests based on the parametric tests such t, F and 2 may be
seriously affected when the parent population distributions is not normal. These effects could
be more if when sample size is small. Thus when there is doubt about the distribution of the
parent population, a nonparametric method should be used. In many situations particularly in
social and behavioral sciences observations are difficult or impossible to take on numerical
scales. Nonparametric tests are well suited under such situations.
Test statistic: Let r be the number of runs (a Run is a sequence of sign of same kind bounded
by signs of other kind). For finding the number of runs, the observations are listed in their
order of occurrence. Each observation is denoted by a ‘+’ sign if it is more than the previous
observation and by a ‘-‘ sign if it is less than the previous observation. Total number of runs
up (+s) and down (-) is counted. Too few runs indicate that the sequence is not random (has
persistency) and too many runs also indicate that the sequence is not random (is zigzag).
Critical value: Critical value for the test is obtained from the table for a given value of n and
at desired level of significance (). Let this value is rc.
Decision rule: If rc (lower) r rc (upper) accept H0. Otherwise reject H0.
Tied values: If an observation is equal to its preceding observation denote it by zero. While
counting the number of runs ignore it and reduce the value of n accordingly.
Large sample sizes: When sample size is greater than 25 the critical value rc can be obtained
using a normal distribution approximation.
Herte n = 11, the number of runs r = 7. Critical nvalues for = 5% (two sided test) from the
table are rc (lower) = 4 and rc (upper) = 10. Since rc (lower) r rc (upper), i.e., observed
r lies between 4 and 10 the H0 is accepted. The sequence is random.
III-58
Non-parametric Tests
Test statistic: Let r denotes the number of runs. To obtain r, list the n 1+ n2 observations from
two samples in order of magnitude. Denote observations from one sample by x’s and other by
y’s. Count the number of runs.
Critical Value: Difference in location results in few runs and difference in spread also result
in few number of runs. Consequently, critical region for this test is always one-sided. The
critical value to decide whether or not the number of runs are few, is obtained from the table.
The table gives critical value rc for n1 (size of sample 1) and n2 (size of sample 2) at 5% level
of significance.
Decision rule: If r rc reject H0.
Tie: In case x and y observations have same value place the observation x(y) first if run of x(y)
observation is continuing.
Large sample sizes: For sample sizes larger than 20 critical value rc is given below.
rc = - 1.96 at 5% level of significance
2n1n2 (2n1n2 n1
where 1 2n1n2 and 2
n2 ) (n1 n2 ) (n1
n1
n2
Example 2: To determine if a new hybrid seeding produces a bushier flowering plant,
following data was collected. Examine if the data indicate that new hybrid produces larger
shrubs than the current variety?
Shrubs Girth (in inches)
Hybrid x 31.8 32.8 39.2 36.0 30.0 34.5 37.4
Current y 35.5 27.6 21.3 24.8 36.7 30.0
variety
H0: x and y populations are identical
H1: There is some difference in girth of x and y shrubs.
Test statistic r =6 (total number of runs). For n1 = 7 and n2 = 6, critical value rc at 5% level of
significance is 3. Since r > rc, we accept H0 that x and y have identical distribution.
III-59
Non-parametric Tests
Note: This test can be extended to k samples. Number of observations below and above the
combined median M from a 2 × k contingency table.
Example 3: Perform a median test on the problem of example 1 for the testing that the two
samples come from same population.
H0 : x and y populations are identical.
H1 : There is some difference in girth of x and y shrubs. Seventh
Example 4: In a market study, two brands of lemonade were compared. Each of 50 judges
tasted two samples, one of brand A and one of brand B with the following results. 35
preferred brand A, 10 preferred B, and 5 could not tell the difference. Thus n = 45 and S = 10.
Assuming α1 = 5%, critical value Sc = 16 from Table 3. Since S < S c, we reject H0 of no
difference in favour of the alternative H1 that the brand A is preferred.
Test Statistic: T represents the sum of ranks with negative signs. For calculating T, obtain
the differences Di = xi – yi where xi’s are response of treatment A and y i’s of treatment B.
Rank the absolute values of differences. Smallest give rank 1. Ties are assigned average
ranks. Assign to each rank sign of observed difference. Obtain the sum of negative ranks.
III-61
Non-parametric Tests
Critical value: Tc is given in Table 4 for n no. of pairs. Significance level is given by α 1 as
critical region is one sided.
Decision rule: T ≤ Tc reject H0, other wise accept it.
Tie: Discard the pair for which difference = 0 and reduce n accordingly. Equal differences are
assigned average ranks.
Example 5: Blood pressure reading of ten patients before and after medication for reducing
the blood pressure are as follows. Test the null hypothesis of no effect against the alternative
that medication is effective.
Patient 1 2 3 4 5 6 7 8 9 10
Before x 86 84 78 90 92 77 89 90 90 86
treatment
After y 80 80 92 79 92 82 88 89 92 83
treatment
Differences 6 4 -14 11 0 -5 1 1 -2 3
Rank 7 5 9 8 Discard 6 1.5 1.5 3 4
Sign + + - + Discard - + + - +
Rank sum of negative differences = 3+6+9 = 18. therefore value of test statistic T= 18. for n =
9 and α1 =5 % Tc = 8 from table 4. Since T>Tc null hypothesis of no effect of medication is
accepted.
6. KOLMOGOROV-SMIRNOV Test
In situations where there is unequal number of observations in two samples Kolmogorov-
Smirnov test is appropriate. This test is used to test whether there is any significance
difference between two treatments A and B (say). The test hypothesis is
H0 : No difference in the effect of treatments A and B.
H1 : There is some difference in the effect of treatments A and B.
Test Statistic: The test statistic is Dm,n = sup F (x) G (x) , F and G are the sample
m n
empirical distributions of sample observations of two samples respectively with respective
sample sizes m and n. F(xi) is calculated as the average number of sample observations of the
first sample that are less than x i. Similarly G(xi) is calculated. Dm,n is largest value of the
absolute difference between F(x) and G(x).
Critical value: Tabulated value of Dm,n is available for different values of m, n and for
different level of significance. is given in Table 4 for n no. of pairs. Significance level is
given by α1 as critical region is one sided.
Decision rule: If the calculated value of Dm,n is greater than the Tabulated value of Dm,n, H0 is
rejected otherwise it is accepted.
III-62
Non-parametric Tests
Example 6: The following data represent the lifetimes (hours) of batteries for different
brands:
Brand A 40 30 40 45 55 30
Brand B 50 50 45 55 60 40
Are these brands different with respect to average life?
We first calculate the sample empirical distributions of two samples:
x F6 (x) G6 (x) F6 (x) G6
(x)
30 2/6 0 2/6
40 4/6 1/6 3/6
45 5/6 2/6 3/6
50 5/6 4/6 1/6
55 1 5/6 1/6
60 1 1 0
D6,6 = sup F6 (x) G6 = 3/6, from Table the critical value for m = n = 6 at level = .05 is
(x)
4/6. Since the calculated value of Dm,n is not greater than the Tabulated value, H0 is not
rejected and it is concluded that the average length of life for two brands is the same.
PRACTICAL EXERCISES
1. Maximum level of a lake each year for a period of 20 years is given below. It is desired to
test (a) whether the sequence is generated by a random process, or (b) the process contains
a trend. The presence of trend will have significant environmental policy implications.
Year Level Year Level
(Above 190 (Above 190
meters) meters)
1 6.6 11 6.0
2 6.5 12 5.8
3 6.4 13 5.9
4 6.5 14 5.6
5 6.4 15 5.5
6 6.4 16 5.3
7 6.3 17 5.1
8 6.2 18 5.3
9 6.1 19 5.4
10 5.9 20 5.2
III-63
Non-parametric Tests
3. An experiment was performed to determine if self fertilized and cross fertilized plants
have different growth rates. Pairs of plants one self and other cross fertilized were
planted in 15 pots. Their heights were measured after specified period of time.
(a) perform the sign test ot determine whether there is any difference in the growth
rates of self fertilized and cross fertilized plants.
(b) Perform Wilcoxon signed rank test to determine of crossed plants jave a higher
growth rate.
III-64
Non-parametric Tests
α1 = 5 % α1 = 2.5 % α1 = 1 % α1 = 0.5 %
α2 = 10 % α2 = 5 % α2 = 2 % α2 = 1 %
n Lower Upper Lower Upper Lower Upper Lower Upper
3 - - - - - - - -
4 - - - - - - - -
5 1 - 1 - - - - -
6 1 - 1 - 1 - 1 -
7 2 - 2 - 1 - 1 -
8 2 - 2 - 2 - 1 -
9 3 8 3 - 3 - 2 -
10 3 9 3 - 3 - 2 -
11 4 10 4 10 3 - 3 -
12 4 11 4 11 4 - 3 -
13 5 12 5 12 4 12 4 -
14 6 12 5 13 5 13 4 13
15 6 13 6 14 5 14 4 14
16 7 14 6 14 6 15 5 15
17 7 15 7 15 6 16 6 16
18 8 15 7 16 7 16 6 17
19 8 16 8 17 7 17 7 18
20 9 17 8 17 8 18 7 18
21 10 18 9 18 8 19 8 19
22 10 18 10 19 9 20 8 20
23 1 19 10 20 10 20 9 21
24 1 20 11 20 10 21 10 22
25 12 21 11 21 11 22 10 22
Source: Distribution Free Tests by H.R. Neave and P.L. Worthington. London, Unwin
Hyman.
III-65
Non-parametric Tests
n1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
n2
2 2 2 2 2 2 2 2 2 2
3 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3
4 2 2 2 3 3 3 3 3 3 3 3 4 4 4 4 4
5 2 2 3 3 3 3 3 4 4 4 4 4 4 4 5 5 5
6 2 2 3 3 3 3 4 4 4 4 5 5 5 5 5 5 6 6
7 2 2 3 3 3 4 4 5 5 5 5 5 6 6 6 6 6 6
8 2 3 3 3 4 4 5 5 5 6 6 6 6 6 7 7 7 7
9 2 3 3 4 4 5 5 5 6 6 6 7 7 7 7 8 8 8
10 2 3 3 4 5 5 5 6 6 7 7 7 7 8 8 8 8 9
11 2 3 4 4 5 5 6 6 7 7 7 8 8 8 9 9 9 9
12 2 2 3 4 4 5 6 6 7 7 7 8 8 8 9 9 9 10 10
13 2 2 3 4 5 5 6 6 7 7 8 8 9 9 9 10 10 10 10
14 2 2 3 4 5 5 6 7 7 8 8 9 9 9 10 10 10 11 11
15 2 2 3 4 5 6 6 7 7 8 8 9 9 10 10 11 11 11 12
16 2 3 4 4 5 6 6 7 8 8 9 9 10 10 11 11 11 12 12
17 2 3 4 4 5 6 7 7 8 9 9 10 10 11 11 11 12 12 13
18 2 3 4 5 5 6 7 8 8 9 9 10 10 11 11 12 12 13 13
19 2 3 4 5 6 6 7 8 8 9 10 10 11 11 12 12 13 13 13
20 2 3 4 5 6 6 7 8 9 9 10 10 11 12 12 13 13 13 14
Significance level 5%
Source: Statistics in Research by Borten Ostle. Ames. Iowa USA. Iowa State University
Press.
III-66
Non-parametric Tests
Source: Distribution Free Tests by H.R. Neave and P.L. Worthington. London, Unwin
Hyman.
III-67
Non-parametric Tests
Source: Distribution Free Tests by H.R. Neave and P.L. Worthington. London, Unwin
Hyman.
III-68