Nonparametric Testing
Nonparametric Testing
A nonparametric test is one that makes no assumptions about the specific shape of the population
from which a sample is drawn. This is unlike most parametric tests, which assumed that a
population was either normally distributed or approximately so. When two or more populations
were being compared, another typical assumption was that their population variances were equal.
Also, most parametric tests require data to be of the interval or ratio scale of measurement, while
many nonparametric techniques have no such requirement. The chi-square tests for goodness of
fit, independence, and comparison of sample proportions are nonparametric methods having a
variety of applications, but there are many more procedures in the realm of nonparametric testing
such as spearman rank tests, Kruskal – Wallis test, Mann – Whitney U-test, Wilcoxon signed rank
test etc. A nonparametric test should be used instead of its parametric whenever
1. Data are of the nominal or ordinal scale of measurement, or
2. Data are of the interval or ratio scale of measurement but one or more other assumptions, such
as the normality of the underlying population distribution, are not met. Both nonparametric and
parametric testing rely on the basic principles of hypothesis testing
Dairies would like to know whether sales of milk are distributed uniformly over a year so that they
can plan for milk production and storage. A uniform distribution means that the frequencies are
the same in all categories. In this situation, the producers are attempting to determine whether the
amounts of milk sold are the same for each month of the year. They ascertain the number of liters
of milk sold by sampling one large supermarket each month during a year. obtaining the following
data. Test whether the data fit a uniform distribution (use 1% level of significance).
Mont Jan Feb Marc Apri May June July Aug Sept Oct Nov Dec
h h l
Liters 161 158 1649 1590 154 139 141 135 149 156 160 165
0 5 0 7 0 0 5 4 2 5
Solution
Step 1: state the hypothesis
H0: Monthly milk sales are uniformly distributed against H1: Are not uniformly distributed
Step 2: Choose statistical test
(𝑂 − 𝐸)2
𝑥2 = ∑
𝐸
Step 3: Choose the level of significance
𝛼 = 0.01
Step 4: there are 12 categories and a uniform distribution so the expected value
∑𝑥 18447
𝑋̅ = 𝑛 = 12 = 1537.25 with v = degrees of freedom = n – 1 = 12 – 1 = 1
2
The critical value = 𝑥𝛼,𝑣 2 = 𝑥0.01,11 = 24.725 (𝑇𝑎𝑏𝑙𝑒 𝑣𝑎𝑙𝑢𝑒)
The following table shows the observed and expected frequencies, and the chi-square calculated
(𝑂−𝐸)2
Month O E 𝐸
Jan 1610 1537.25 3.44
Feb 1585 1537.25 1.48
March 1649 1537.25 8.12
April 1590 1537.25 1.81
May 1540 1537.25 0.00
June 1397 1537.25 12.80
July 1410 1537.25 10.53
Aug 1350 1537.25 22.81
September 1495 1537.25 1.16
October 1564 1537.25 0.47
Nov 1602 1537.25 2.73
Dec 1655 1537.25 9.02
Example
From the data given below about the treatment of 250 patients suffering from a certain disease,
state whether the new treatment is superior to the conventional treatment. Test at 5% level of
significance.
Treatment Favourable Not favourable
New 140 30
Conventional 60 20
Solution
Ho: there is no significance difference in the treatments
Versus
H1: there is a significance difference in the treatments
Expected frequencies
Favourabl Not Tota
e favourabl l
e
Treatmen New 200 50 170
t 𝑥170 𝑥170
250 250
= 136 = 34
Conventiona 200 50 80
𝑥80 𝑥80
l 250 250
= 64 = 16
Total 200 50 250
{𝑂−𝐸}2
O E O–E {𝑂 − 𝐸}2 ∑
𝐸
140 136 4 16 0.1176
60 64 -4 16 0.2500
30 34 -4 16 0.4706
20 16 4 16 1.0000
Total 1.8382
(𝑂−𝐸)2
𝑥2 = ∑ = 1.8382
𝐸
The distribution has two rows and two columns implying the degrees of freedom is
v = df = (Rows – 1)(columns – 1) = (R – 1)(C – 1) = 1 with the level of significance 0.05
𝑖. 𝑒 𝛼 = 0.05
The critical value i.e Chi square tabulated at 5% level of significance with 1 degree of freedom is
2 2
𝑋𝛼,𝑣 = 𝑋0.05,1 = 3.841
We accept the null hypothesis since the calculated value is within the interval or less than the
critical value implying there is no significance difference in the treatments i.e the treatments
have the same effect.