1
Nonparametric test
Chi square test
2
Test the correlation between two sets of data.
Samples are independent
Only works for categorical data such as Gender {Men, Women} or color {Red,
Yellow, Green, Blue} but not numerical data such as height or weight.
The numbers must be large enough (>50). Each entry must be 5 or more.
3
Ho: Variable A and Variable B are independent.
H1: Variable A and Variable B are not independent.
4
Hypothesis
5
H0: Gender and willingness to heart attach disease voting are independent
H1: Gender and willingness to heart attach disease voting are not independent
Example: Republican, Democratic parties and Independent
6
Ho: Gender and voting preferences are independent.
H1: Gender and voting preferences are not independent.
7
Interpret results. Chi-value (0.0003), Chi = 1> significance level (P = 0.05)
Accept null hypothesis.
Thus, we conclude that there is no relationship between gender and voting
preference.
Limitation
8
If the test comes out significant that means there is some association. No further
information.
Tests only two variables at one time
Some cells may have small values. Each cell should have at least a value of 1,
and no more than 20% of cells can have values lower than 5.
Mann-Whitney test
9
Non-Parametric Test for Independent Measures Between Two groups, can be
performed on ranked data (equal to parametric t – test)
On non-normally distributed data
19 – 18
20- 19
22 – 21- 19
18 – 17- 22
23 20
Sample 2
Sample 1
Are these 2 samples come from the same population with
10
α = 5% ?
19 – 18
20- 19
22 – 21- 19
18 – 17- 22
20
23
Sample 2
Sample 1
H0: there is no different between the ranks of 2 samples
H1: there is different between the ranks of 2 samples
1 17 18 19 20 22 23
2 18 19 19 20 21 22
Mann–Whitney signed-rank test.
11 Non-parametric statistical hypothesis test for assessing whether two
independent samples of observations have equally large values (n < 30)
20 - 19 19 – 18
22 – 21- 19 Sample 2
Sample 1 18 – 17- 22
23 20
The two samples data are ranked against each other : at first U1 for
sample 1
(1) 17 18 19 20 22 23
(2) 18 19 19 20 21 22
No data (2)
> 23, u = 0
0 data in (2) > 22 +22
common u = 0,5
2 data(2) > 20 & 20 common u = 2 + 0,5 = 2,5
4 Data (2) > 19 and 19 common u = 4 + 0,5 = 4,5
5 data (2)> 18 and 18 common u = 5 + 0,5 = 5,5
6 data (2) > 17 u = 6
U1 = u = 19
U1 = 6 + 5,5 + 4,5 + 2,5 + 0,5 = 19
… and now U2, for the second sample:
12
(2) 18 19 19 20 21 22
(1) 17 18 19 20 22 23
1 data(1) > 23 + 22 common
u = 1,5
2 data(1) > 21 u = 2
2 data(1) > 20 + 20 common u = 2,5
3 data(1) > 19 u = 3
3 data(1) > 19 + 19 common u = 3,5
4 data(1) > 18 + 18 common u = 4,5
U2 = 17
U2 = 4,5 + 3,5 + 3 + 2,5 + 2 + 1,5 = 17 U1 + U2 = 17 + 19 = 36 = n1* n2
13
The U statistic show you how degrees of
overlap in rank between 2 groups
14
Sample
1
U
Sample
2
What are the limits of U1 and U2?
15 Example 2
1 2 3
1 2 3
U1 = 2,5 + 1,5 + 0,5 = 4.5
U2 = 2,5 + 1,5 + 0,5 = 4.5
n1 n2
U1 = U2 =3 3 = 2
2
Example 3
16
1 2 3
4 5 6
U2 = 0 and U1 = n1*n2
Sample
1
U=0
Sample
2
17
Smaller U = Bigger different between groups
Bigger U = Smaller different between groups
What are the limits of U1 and U2?
18 Example 2
1 2 3
1 2 3
U1 = 2,5 + 1,5 + 0,5 = 4.5
U2 = 2,5 + 1,5 + 0,5 = 4.5
n1 n2
U1 = U2 =3 3 = 2
2
The 2 samples are belong to the same population
Example 3
19
1 2 3 U1 = 3 + 3 + 3 = 9
4 5 6 U2 = 0
U2 = 0 and U1 = n1*n2
The 2 samples are different
Sample
1
U=0
Sample
2
… and now U2, for the second sample:
20
(2) 18 19 19 20 21 22
(1) 17 18 19 20 22 23
1 data(1) > 23 + 22 common
u = 1,5
2 data(1) > 21 u = 2
2 data(1) > 20 + 20 common u = 2,5
3 data(1) > 19 u = 3
3 data(1) > 19 + 19 common u = 3,5
4 data(1) > 18 + 18 common u = 4,5
U2 = 17
U2 = 4,5 + 3,5 + 3 + 2,5 + 2 + 1,5 = 17 U1 + U2 = 17 + 19 = 36 = n1 *n2
U1 and U2 are far different from n1 n2
21 2
Using Mann-Whitney table
Uscrit (α = %) n1 n2
U=0 U= 2
Hypothesis refused. Hypothesis accepted
////////////////////////////////////////////////////////////
22
Let hypothesis : the two samples belong to
n1 statistical…population
the same 5 6 7 …
n2
If n < 20
… … … … …
6 - 5 6 …
… Uscrit (α = 5 %) … … …
U=0 5 U = 18
////////////////////////////////////////////////////////////
Hypothesis refused Hypothesis accepted
The Hypothesis is accepted with an a risk of 5%
23 U stat A = Sum of rank A – n(n+1)/2
U stat B = Sum of rank B – n(n+1)/2
U stat A = 19 – 6(6+1)/2 = -2
U stat B = 17 – 6(6+1)/2 = -4
U stat = smallest = |2|
U crit = 5 by checking the Mann Whitney table
Reject H0: There is different between the ranks of 2 samples
24
• The Mann–Whitney U-test is limited to nominal
variables (Qualitative data) with only two samples
• It is the non-parametric analogue to two-sample t–test.
• Nominal variables: sex (male or female), genotype (AA,
Aa, or aa), or ankle condition (values are normal, sprained,
torn ligament, or broken).