09 Nonparametric Test Li Wenyun1730862642
09 Nonparametric Test Li Wenyun1730862642
Li Wenyun
15 16
13 14
11 12
8 9 10
6 7
3 4 5
1 2
9.1 Wilcoxons Signed Rank Test
· It is used for paired quantitative data,
which do not follow normal distributions.
· Extension to paired-sample t test
· Example 9-1: A physician designed to
study whether there is significant
difference in interleukin-6 between skin
lesion and uninvolved normal skin among
patients with vitiligo. Data from 9 patients
are in Table 9-1.
· Paired sample t test
whether the mean of the difference in test
variable between the two populations
equals 0
· Wilcoxon Signed Rank Test
whether the median (center of the
distribution) of the difference in test
variable between the two populations
equals 0
The dispersion of the two samples and their difference
are large, so data are not normally distributed
(1) State the Hypotheses and Select
the Level of Significance
In nonparametric tests, distributions of data
are usually skewed, mean is not a suitable
representative of central tendency. Hypothesis
testing is based on median.
· H0: The median of the difference is 0
· H1: The median of the difference is not 0
· =0.05
If the level of interleukin-6 in skin lesion and in
normal skin are not different, their difference
should be centered at 0
(2) Select an appropriate test and
calculate the test statistics
· Calculate the difference for each pair;
· Rank the absolute differences (omit zero); if
two or more of the absolute differences are
equal (we say there is a tie), the average rank
will be assigned to the tied values;
· Give the signs of the differences to their ranks;
· Calculate the rank sum of positive and negative
ranks, separately;
· choose the smaller absolute rank sum as test
statistic (T- = 3).
(3) Determine P value, and state
the conclusion
· n: number of valid pairs (non-zero difference)
· From Table 9-6, for n=8, critical values are (3,
33).
¨ Probability of T≤3 or T≥33 is <0.05;
¨ Probability of 3<T<33 is ≥0.05.
· Tcalc=3, Tcalc = Tcrit, P<0.05, H0 is rejected.
· There was significant difference in level of
interleukin-6 between skin lesion and
uninvolved normal skin among the patients
with vitiligo. The levels of Interleukin-6 are
related to skin lesion of patients with vitiligo.
0.01952=0.039
Probability of T≤3 or
T≥33 is 0.039;
Probability of 3<T<33
is 1-0.039=0.961
· When n>25, the Table 9-10 cannot help. Then we
turn to the normal approximation.
· When n is large enough, the distribution of
statistic T will be close to normal.
· Calculate Z statistic
Z~N(0,1)
tp is number of pairs
for the pth of tied value
9.2 Wilcoxons Rank-sum Test
(Mann-Whitney U Test)
· It is used for two independent samples,
which do not follow normal distributions.
· Example 9-2: The survival time (minute)
of 5 cats and 14 rabbits without oxygen
are listed in Table 9-3. Now we try to
compare the survival times of cats and
rabbits in an environment without
oxygen.
(1) State the hypotheses and select
the significance level
· H0: The medians or distributions of two
populations are the same (Md1 = Md2)
· H1: The two medians or two distributions
are not the same (Md1 Md2)
· =0.05
(2) Select an appropriate test and
calculate the test statistics
· Pool the two samples and rank all the
observations from the smallest to the largest
while keeping track of sample to which each
observation belongs;
· For same values (tie), give a mean rank: there are
two “25”, and the ranks should be 9 and 10, so
the rank is (9+10)/2= 9.5 for each;
· Compute the rank sum for each sample;
· The rank sum for the smaller sample (smaller n),
T=T1= 78.5 is the test statistic; When n1=n2, let
T=min (T1, T2).
(3) Determine P value, and state
the conclusion
· Here T=78.5, n1=5, n2=14 and n2- n1=9.
· From Table 9-7 by n1 (<n2) and n2- n1,
T0.05,5,9=28~72.
· if T is outside the range or on the boundary,
P < 0.05; if T is inside the range, P ≥ 0.05.
· T=78, outside the range, P<0.05, H0 is rejected.
· Wilcoxon rank-sum test indicated that the
survival times of cats and rabbits in the
environment without oxygen differed
significantly (P < 0.05) .
· It can be proven that when sample size is
large enough, the distribution of the
statistic T is close to normal with
n=n1+n2
Table 7-4. Survival times (minute) of cats and rabbits without oxygen
Cats 25 34 44 46 46
Rabbits 15 15 16 17 19 21 21 23 25 27 28 28 30 35
Analyze Non-parametric Test
2 independent samples
Move time to Test Variable List
Move group to Grouping Variable box
Click Define Groups, type “1” in the box of Group 1 and
type “2” in the box of Group 2
Test type, select Mann-Whitney U
Output and Interpretation