You are on page 1of 45

APPLIED STATISTICS

ECN 416
Non-Parametric Test of Hypothesis
INTRODUCTION
• Most of the Test of hypothesis procedures discussed
earlier are based on the assumption that the
random samples are selected from a normal
population. Traditionally, these testing procedures
are known as Parametric Methods as they depend
on the parameters, viz., mean or proportion or
standard deviation etc.
• These parametric tests have used the parametric
statistic of sample that comes from the population
being tested.
INTRODUCTION Contd.
• The need for techniques that apply more broadly
has led to the development of Non-Parametric
Methods.
• Non-Parametric Methods do not require that the
underlying population be normal – or indeed
that they have any single mathematical form and
some even apply to non-numerical data.
• Non-parametric Methods are also referred to as
distribution-free methods.
ADVANTAGES OF NON-PARAMETRIC
METHODS
• Non-parametric Methods are generally simple
to understand, quicker and easier to apply
when the sample size id small.
• They do not require lengthy and laborious
calculations and hence they are less time
consuming.
• They do not require the assumptions that a
population is distributed in the shape of a
normal or another specified shape.
ADVANTAGES OF NON-PARAMETRIC
METHODS Contd.
• They can be applies to all types of data –
qualitative (nominal scaling) data in rank form
(ordinal scaling) as well as data that been
measured more precisely (internal or ratio scaling)
• They have inherently greater range of applicability
because of milder assumptions.
• Non-parametric tests make fewer and less
stringent assumptions (that are more easily met)
than the parametric test.
DISADVANTAGES OF NON-PARAMETRIC METHODS

Nonparametric methods have a number of important


disadvantages which in practice often outweigh their
advantages.
• Nonparametric test sometimes pay for freedom from
assumptions by a marked lack of sensitivity.
• Important effects can be entirely missed by a
nonparametric technique because of its lack of
power or because it produces confidence intervals
that are too wide. Some of the techniques are very
blunt instruments.
DISADVANTAGES OF NON-PARAMETRIC
METHODS Contd.
• The competing parametric procedure may be quite
robust to departures from the assumption.
• Nonparametric techniques often disregards the actual
scale of measurement and substitute either rank or a
more gross comparison of relative magnitude. This is
often the basis for the loss of power or sensitivity in
nonparametric methods.
• Nonparametric tests are often wasteful of information
and thus less efficient tan the standard techniques
which they replace
TYPES OF NONPARAMETRIC TESTS
• Sign Test for paired data and One Sample Sign Test: In this
test, positive or negative signs are substituted for
quantitative values.
• Mann-Whitney U Test: This Rank Sum Test is used to
determine whether two independent samples have been
drawn from the same population. It is used when there
are only two populations
• Kruskal-Wallis Test: This is another rank sum test that
generalizes the analysis of variance to enable us to
dispense with the assumption that the population is
normally distributed.
TYPES OF NONPARAMETRIC TESTS Contd.
• One Sample Run Test. It is method to determine the
randomness with which the sample items have been selected.
• Rank Correlation Test. It is a method for finding correlation
coefficient when the data available is not in numerical form
but the information is sufficient to rank the data first, second,
and so on.
• Kolmogorov-Smirnov Test. It is another method of determining
the goodness of fit between and observed sample and
theoretical probability distribution.
Pease note that other methods exist aside from those listed
above.
USES OF NON-PARAMETRIC METHODS

• When quick or preliminary data analysis is needed.

• When the assumptions of a competing parametric procedure


are not satisfied and the consequences of this are either
unknown or known to be serious.

• When data are only roughly scaled; for example when only
comparative rather than absolute magnitudes are available.
As with clinical data, perhaps patients can only be classified
as better, unchanged or worse. ( largest, second largest,
……….., smallest)
RANK SUM TESTS
• Rank sum test are a whole family of tests. We
shall concentrate only on the following two
members of this family:

• Mann-Whitney U Test

• Kruskal-Wallis Test or H-Test.


RANK SUM TESTS Contd.
• Mann-Whitney U Test is used when there are
only two populations whereas Kruskal-Wallis H
Test is employed when more than two
populations are involved.
• The use of these tests will enable us to
determine whether independent samples have
been drawn from the same population or
different populations have the same
distribution.
Mann-Whitney U Test

• This test enables us to test the null hypothesis

• H0 : µ1 = µ2 against H0 : µ1 ǂ µ2
without assuming whether the population
samples have roughly the shape of a normal
distribution.
Mann-Whitney U Test Procedure.
• Step 1 Set the null and the alternative
hypothesis: H0: µ1 = µ2 against H0 : µ1 ǂ µ2

• Step 2 Combine all sample values in an array


from the smallest to the largest, and assign
ranks to all these values. If two or more sample
values are identical, the sample values are each
assigned a rank equal to the mean of the ranks
that would otherwise be assigned.
Mann-Whitney U Test Procedure.
• Step 3 Find the sum of the rank for each of
the samples (denoted by R1 and R2). Let n1 and
n2 represent their respective sample sizes.

A significant difference between the rank sums


R1 and R2, implies a significant difference
between the samples.
Mann-Whitney U Test Procedure.
Step 4
Calculation of U to test the difference between
the rank sums
U-Statistics: U = n1 n2 + [n1 (n1 + 1) / 2] - R1
[Corresponding to sample 1)
Or U = n1 n2 + [n2 (n2 + 1) / 2] - R2
[Corresponding to sample 2)

Mann-Whitney U Test Procedure.
The sampling distribution of U is asymmetrical
and has a mean and variance given by:

Mean: µ U = n 1 n2 / 2

Variance: σU2 = [n1 n2 (n1 + n2 +1)] / 12


Mann-Whitney U Test Procedure.
• If n1 and n2 are both at least equal to 8, it
turns out that the distribution of U is nearly
normal and one could use the Z statistic,
where
Z = [U - µU ] / σU
• Is normally distributed with mean 0 and
variance 1
Mann-Whitney U Test Procedure.

Step 5 Level of significance: Take α = 0.05

Step 6 Critical Region: Accept H0 if |Z| < Zα.


EXAMPLE

• The caffeine content of two brands of coffee


drinks, measured in milligrams, was found to
be as follows:
EXAMPLE Contd.

Bran
dA 2.1 4.0 6.3 5.4 4.8 3.7 6.1 3.3    

Bran
dB 4.1 0.6 3.1 2.5 4.0 6.2 1.6 2.2 1.9 5.4
EXAMPLE Contd.
• Test the hypothesis, at 0.05 the level of
significance, that the average caffeine
contents of the two brands are equal against
the alternative that they are unequal.
SOLUTION

• H0: µ1 = µ2, the average caffeine contents of


the two brands are equal.
• H1: µ1 ǂ µ2, the average caffeine contents of
the two brands are not equal.
• α = 0.05
SOLUTION Contd.
• The observations are arranged in ascending
order and ranks from 1 to 18 are assigned

Ori 0.6 1.6 1.9 2.1 2.2 2.5 3.1 3.3 3.7 4.0 4.0 4.1 4.8 5.4 5.4 6.1 6.2 6.3
gin
al
Da
ta:
Ra 1 2 3 4 5 6 7 8 9 10. 10. 12 13 14. 14. 16 17 18
nk 5 5 5 5
SOLUTION Contd.
• The ranks of the observation belonging to the
smaller samples are in bold form.

• R1 = 4+8+9+10.5+13+14.5+16+18 = 93

• R2 = 1+2+3+5+6+7+10.5+12+14.5+17 = 78

• n1 = 8, n2 = 10
SOLUTION Contd.
• U-Statistic:
U = n1 n2 +[ n1 (n1 +1)] / 2 - R1
= 8 x 10 +[(8x9) / 2] – 93 = 23

• Mean of U = µu = n1 n2 / 2 = 10x8 / 2 = 40

• Variance of U = σu2
= [(n1 n2) (n1 + n2 + 1)] / 12
= [10 x 8 (10+8+1)] / 12 = 380 / 3 = 126.67

• σu = √126.67 = 11.25
SOLUTION Contd.
• Here n2 = 10, so we can use the statistic
Z = [U - µu] / σu = [23 – 40] / 11.25
= -17 / 11.25 = -1.51
Therefore:|Z| = 1.51
• The table value of Zα = 1.96
• Since 1.51 < 1.96, we cannot reject the null
hypothesis. We therefore conclude that there is no
significant difference in the average caffeine contents
of the two brands of cigarettes
Kruskal-Wallis Test or H-Test

• The Kruskal-Wallis Test is a generalization of Mann-


Whitney U-test to the case of K > 2 sample. This test is
also known as Kruskal-Wallis Test H-test.
• It is used to test he null hypothesis H0 that k independent
samples are drawn from an identical population.
• This test is an alternative nonparametric test to the F-
test for testing the equality of means in the one factor
analysis of variance when the experimenter wishes to
avoid the assumption that the samples were selected
from the normal population.
Kruskal-Wallis Test or H-Test Contd.
• Let ni (i = 1, 2, 3, 4, ……, k) be ith number of
observations in the ith sample.
• Combine all k samples and arrange them to obtain
n = n1 + n2 + n3 + ……. + nk observations in ascending
order, substituting the appropriate rank from 1, 2,
….., n for each observation.
• The sum of the ranks corresponding to the ni
observations in the ith sample is denoted by the
random variable Ri.
Kruskal-Wallis Test or H-Test Contd
• Now let us consider the statistic
H = 12 / n(n+1) [∑1k Ri2 / ni] - 3(n+1)
• H is approximated by a chi-square distribution
with k-1 degrees of freedom when H0 is true and
if sample consists of at least 5 observations.
• If H falls in the critical region H > χα2 with v = k-1
degrees of freedom, we reject H0 at the α level
of significance: otherwise, we do not reject H0.
EXAMPLE
• A teacher wishes to test three different leading
methods I, II, and III. To do this, the teacher chooses
at random three groups of five students each and
teaches each group by a different method.
• The same examination is then given to all the
students and the marks obtained are given below.
Determine at α = 0.05 significance level whether
there is a difference between the teaching
methods.
EXAMPLE Contd.

Method I 78 62 71 58 73

Method II 76 85 77 90 87

Method III 74 79 60 75 80
SOLUTION

H0 = there is difference between the teaching


methods
H1 = there is no difference between the
teaching methods
Since there are three methods and each group
consists of 5 students, we have
n1 = n 2 = n 3 = 5,
and
n = n 1 + n 2 + n 3 = 15
SOLUTION Contd.

Ma 58 60 71 62 73 74 75 76 77 78 79 80 85 87 90
rks

Ran 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
ks
SOLUTION Contd.
Method I 10 3 4 1 5 R1 = 23

Method II 8 13 9 15 14 R2 =59

Method III 6 11 2 7 12 R3 = 38
SOLUTION Contd.
• H = 12 / n(n+1)[ ∑1k Ri2 / ni] - 3(n+1)
= 12 / 15x16[ R12 / [ R12 / n 1 + R22 / n 2 +
R32/ n 3 ] – 3 x 16
= 12 / 15x16[ R12 / [ 23 / 5 + 59/ 5 + 38 / 5 ]
– 3 x 16
= 1 /5 [529 + 3481 = 1444] - 48
= 5454 / 100 - 48 = 6.54
SOLUTION Contd.
The degrees of freedom = k – 1 = 3 -1 = 2
Therefore
χ2 (2, 0.05) = 5.991
Decision: Reject H0 if H > χ2 (2, 0.05)
Now 6.54 > 5.991
Therefore the null hypothesis is rejected and the
alternative hypothesis H1 is accepted. We conclude
that there is no difference in the three teaching
methods.
SPEARMEN RANK CORRELATION COEFFICIENT

• Spearmen Rank Correlation Coefficient is a


nonparametric counterpart of the simple correlation
coefficient r. It is a measure of association between
two variables X and Y and is given by
rs = 1 - (6 ∑1n di2) / n(n2 – 1),
where
di = the difference between the ranks assigned to x i
and yi
n = the number of paired observations
SPEARMEN RANK CORRELATION
COEFFICIENT Contd.
• The value of rs will range from -1 to +1. A value
of +1 or -1 indicates perfect association
between X and Y, the plus sign indicating
identical rankings and the minus sign
indicating reverse rankings.
• When rs is close to 0, we would conclude that
the variables are uncorrelated.
ADVANTAGES OF RANK CORRELATION
COEFFICIENT
• We do not assume the underlying relationship
between X and Y to be linear, therefore when the
data possess a distinct curvilinear relationship, the
rank correlation coefficient will likely be more
reliable than the conventional measure.
• No assumptions of normality are made concerning
the distribution of X and Y.
• It is applicable when one is unable to make
meaningful numerical measurements but
nevertheless can establish rankings.
EXAMPLE
• The following figures show the milligram of tar
and nicotine in 10 brands of cigarettes.
• Calculate the rank correlation coefficient to
measure the degree of relationship between
tar and nicotine content in the ten brands of
cigarette.
EXAMPLE Contd.
Cigarette Brand Tar Content Nicotine Content
Brand 1 14 0.9
Brand 2 17 1.1
Brand 3 28 1.6
Brand 4 17 1.3
Brand 5 16 1.0
Brand 6 13 0.8
Brand 7 24 1.5
Brand 8 25 1.4
Brand 9 18 1.2
Brand 10 31 2.0
SOLUTION
• Let X and Y represent the tar and nicotine
contents respectively.
• Assign ranks to each set of measurements
• The following table contains the rankings of
the measurements and the differences in
ranks for the observations.
SOLUTION Contd.
Cigarette xi yi di di2
Brand
Brand 1 2 2 0 0
Brand 2 4.5 4 0.5 0.25
Brand 3 9 9 0 0
Brand 4 4.5 6 -1.5 2.25
Brand 5 3 3 0 0
Brand 6 1 1 0 0
Brand 7 7 8 -1 1
Brand 8 8 7 1 1
Brand 9 6 5 1 1
Brand 10 10 10 0 0
        ∑ di2 = 5.5
SOLUTION Contd.
• Substituting into the formula for rs we have
rs = 1 - (6 ∑1n di2) / n(n2 – 1)
= 1 - (6 x 55) / 10 x (100 – 1)
= 0.97
• Here, rs = 0.97 indicates a high positive
correlation between the amount of tar and
nicotine found in the ten brands of cigarette.

You might also like