Upload
hairilmuhamad
View
224
Download
0
Embed Size (px)
DESCRIPTION
KP2
Citation preview
NON PARAMETRIC TESTS
1
REVIEW
2
PARAMETRIC & NON PARAMETRIC
**Non parametric tests can be applied to Normal data but parametric tests
have greater power IF assumptions met.
Wilcoxon Rank Sum test
Wilcoxon Matched-Pair Rank test
3
Non-parametric methods have fewer assumptions than parametric tests. So useful when these assumptions not met.
Nonparametric procedures are sometimes less powerful than tests designed for use with a specific distr ibution I t is better to use a test that is powerful when we believe that our assumptions are approximately satisfied than a less powerful test with fewer assumptions.
Often used when sample size is small and dif ficult to tel l i f normally distr ibuted.
Appropriate for dealing with data that are measured on a nominal or
ordinal scale and whose distr ibution is unknown.
Nonparametric tests use the order/rank of the values rather than the actual values themselves.
NON PARAMETRIC TESTS
4
A Wilcoxon Rank Sum Test is most often used for three types of study design as an alternative for the independent t -test:
Determining if there are differences between two independent groups
Determining if there are differences between interventions
Determining if there are differences in change scores
t -test relies on several conditions: independent samples, normality, and equal variances. We can use the Wilcoxon
Rank Sum Test as an alternative when the distribution is not
normal.
5
Assumption #1: The dependent variable should be measured at the ordinal or continuous level . The independent
variable should consist of two categorical, independent
groups.
Assumption #2: The underlying distribution is not normal.
Assumption #3: The observations are chosen randomly and independent.
Assumption #4: The distribution of scores for both groups of the independent variable have the same shape (identical).
WILCOXON RANK SUM TEST
6
WILCOXON RANK SUM TEST
To compare the running time of the first grade boys (B) and girls
(G), the following information is collected.
Is there a difference between the running time of boys and
girls?
Time (in secs) 20 24 29 33 57 35 10 17 23 19 22 21
Sex G G G G G G B B B B B B
7
Hypotheses are sometimes defines in terms of population medians , but can also be expressed in words.
H0: = (The median running time is not different between boys and girls.)
There is no difference in the running time of boys and girls
(i.e. the sum of ranks for group 1 is no different than the sum of ranks for
group 2).
Ha: (The median running time is different between boys and girls.)
There is a difference in the running time of boys and girls
(i.e. the sum of ranks for group 1 is significantly different from the sum of
ranks for group 2).
The Wilcoxon Rank Sum Test requires that the two tested samples be similar in shape (boxplot/histogram).
8
Rank all 12 observations. Arrange them in order from
smallest to largest.
The rank of each observation is its position in this ordered
list, starting with rank 1 from
the smallest observation.
Assign all tied values the average of the ranks they
occupy (if any).
Sex Time Rank
1
2
3
4
5
6
7
8
9
10
11
12 9
Rank all 12 observations. Arrange them in order from
smallest to largest.
The rank of each observation is its position in this ordered
list, starting with rank 1 from
the smallest observation.
Assign all tied values the average of the ranks they
occupy.
Sex Time Rank
B 10 1
B 17 2
B 19 3
G 20 4
B 21 5
B 22 6
B 23 7
G 24 8
G 29 9
G 33 10
G 35 11
G 57 12 10
Sex Sum of ranks
Boys
Girls
Calculate the sum of ranks per group
The Wilcoxon W statistic is the smaller of these two numbers:
(obtained value).
Critical value?
= 0.05, two tailed test
1 = 6 , 2 = 6 (1 is always smaller of the two groups)
From table D.8, critical value =
11
Sex Sum of ranks
Boys 24
Girls 54 Calculate the sum of ranks per group
The Wilcoxon W statistic is the smaller of these two numbers: 24
(obtained value).
Critical value?
= 0.05, two tailed test 1 = 6 , 2 = 6 (1 is always smaller of the two groups) From table D.8, critical value = 28
Reject or Do not reject H0 ?
(The obtained value needs to be equal to or less than the critical value in
order to be statistically significant).
12
There is enough evidence to conclude that there is a difference in the running time of boys and girls (The ranks in the two groups differed) where 1 = 6, 2 = 6 = 24, = .015.
13
A study of early childhood education asked nursery school
pupils to retell a fairy tale that had been read to them earlier in
the week. There were 5 high-progress readers and 5 low -
progress readers. An expert listened to a recording of the
children and assigned a score for certain uses of languages.
High 0.55 0.57 0.72 0.70 0.84
Low 0.40 0.72 0.00 0.36 0.55
To what extent the scores of the high progress group are
significantly higher than those of the low progress group?
WILCOXON RANK SUM TEST
14
Can be used as an alternative to the paired -samples t -test (dependent t -test) when the population cannot be assumed to be normally distributed.
Assumption #1: The dependent variable should be measured at the ordinal or continuous level. The independent variable should consist of two categorical, "related groups" or "matched pairs.
Assumption #2: The data are paired and the differences come from the same population.
Assumption #3: Each pair is chosen randomly and independent .
Assumption #4: The data need not be normally distributed, but the distribution should be symmetric around the median.
WILCOXON MATCHED-PAIRS SIGNED RANK
TEST
15
A group of 10 students with chronic
anxiety receive sessions of cognitive
therapy. Quality of Life (QoL) scores
are measured before and after therapy.
Is there a dif ference on the QoL scores
after the cognitive therapy?
WILCOXON MATCHED-PAIRS SIGNED RANK
TEST
H0: = 0 (The median QoL scores is not different before and after the cognitive therapy.
Ha: 0 (The median QoL scores is different before and after the cognitive therapy).
QoL scores
Before After
6 9
5 12
3 9
4 9
2 3
1 1
3 2
8 12
6 9
12 10
16
Before After Difference, d Sign Absolute value Rank
6 9
5 12
3 9
4 9
2 3
1 1
3 2
8 12
6 9
12 10
WILCOXON MATCHED-PAIRS SIGNED RANKS
TEST
The Wilcoxon W+ statistic is the sum of the ranks of the positive differences: ??
The Wilcoxon W- statistic is the sum of the ranks of the negative differences: ??
17
Before After Difference, d Sign Absolute value Rank
6 9 -3 - 3 4.5
5 12 -7 - 7 9
3 9 -6 - 6 8
4 9 -5 - 5 7
2 3 -1 - 1 1.5
1 1 0
3 2 1 + 1 1.5
8 12 -4 - 4 6
6 9 -3 - 3 4.5
12 10 2 + 2 3
WILCOXON MATCHED-PAIRS SIGNED RANKS
TEST
The Wilcoxon W+ statistic is the sum of the ranks of the positive differences: 1.5 + 3 = 4.5 .
The Wilcoxon W- statistic is the sum of the ranks of the negative differences: 1.5 + 4.5 + 4.5 + 6 + 7
+ 8 + 9 = 40.5
Whichever of these sums is the smaller, is our value of W. So, W = 4.5 (obtained value)
18
Critical value?
= 0.05 , two tailed test
n= 10-1 = 9 (omitting 0 dif ference)
From table D.7, critical value = 5.0195
Reject or Do not reject H 0 ?
(The obtained value needs to be equal to or less than the
critical value in order to be statistically significant).
WILCOXON MATCHED-PAIRS SIGNED
RANK TEST
19
WILCOXON MATCHED-PAIRS SIGNED RANK
TEST
The distribution was symmetric around the median. The Wilcoxon matched-pairs
signed rank test determined that there was a statistically significant median
different before and after the cognitive therapy (W=4.5, p=.033). 20
A study of early childhood education asked nursery school pupils to retell a fairy tale that had been read to them earlier in the week. Each child told two stories. The rest had been read to them, and the second had been read but also illustrated with pictures. There were 5 low-progress readers. An expert listened to a recording of the children and assigned a score for certain uses of languages.
Are the story 2 scores significantly higher than the story 1 scores?
WILCOXON MATCHED-PAIRS SIGNED RANK
TEST
Child 1 2 3 4 5
Story 2 0.77 0.49 0.66 0.28 0.38
Story 1 0.40 0.72 0.00 0.36 0.55
21
generally considered the nonparametric alternative to the one -way ANOVA, which can be used when the data fail the assumptions of the one-way ANOVA.
Assumption #1: The dependent variable is measured at the continuous or ordinal level and the independent variable consists of two or more categorical , independent groups.
Assumption #2: You should have independence of observations, which means that there is no relationship between the observations in each group of the independent variable or between the groups themselves .
Assumption #3: The distribution of scores for each group of the independent variable have the same shape. (N.B., having the same shape also means having the same variability ).
KRUSKAL-WALLIS TEST
22
The Kruskal-Wallis hypothesis test:
H0: All k populations have the same distribution.
Ha: Not all k populations have the same distribution.
The Kruskal-Wallis test statistic:
where
n=sum of sample sizes
k=number of samples
R j=sum of ranks in the jth sample
n j=size of the jth sample
If each n j > 5, then H is approximately distributed as a 2 (Chi-
square distribution).
KRUSKAL-WALLIS TEST
23
Do dif ferent departments have dif ferent class sizes?
KRUSKAL-WALLIS TEST
Class size (Math) Class size (English) Class size (History)
23 55 30
41 60 40
54 72 18
78 45 34
66 70 44
HO: MedianM = MedianE = MedianH
(The three departments have the same median class size)
Ha: Not all of the three department medians are equal.
24
KRUSKAL-WALLIS TEST
Group Class size Rank
M 23
M 41
M 54
M 78
M 66
E 55
E 60
E 72
E 45
E 70
H 30
H 40
H 18
H 34
H 44
Sum of group rank
for M =?
Sum of group rank
for E =?
Sum of group rank
for H=?
25
KRUSKAL-WALLIS TEST
Group Class size Rank
M 23 2
M 41 6
M 54 9
M 78 15
M 66 12
E 55 10
E 60 11
E 72 14
E 45 8
E 70 13
H 30 3
H 40 5
H 18 1
H 34 4
H 44 7
Sum of group rank
for M =?
Sum of group rank
for E =?
Sum of group rank
for H=?
26
KRUSKAL-WALLIS TEST
Group Class size Rank
M 23 2
M 41 6
M 54 9
M 78 15
M 66 12
E 55 10
E 60 11
E 72 14
E 45 8
E 70 13
H 30 3
H 40 5
H 18 1
H 34 4
H 44 7
Sum of group rank
for M =44
Sum of group rank
for E =56
Sum of group rank
for H =20
=12
15(15+1)
442
5+
562
5+
202
5 3 15 + 1 = 6.72
27
H=6.72 (Obtained value)
Critical value=?
=0.05, two tailed test
df=k-1=2
From chi-square dist. Table A.4, the critical value = 5.992
Reject or Do not reject H 0 ? (H is statistically significant if it is
larger than the critical value of Chi-Square)
If the null hypothesis in the Kruskal-Wallis test is rejected, then
we may wish, in addition, compare each pair of populations to
determine which are dif ferent and which are the same.
KRUSKAL-WALLIS TEST
28
KRUSKAL-WALLIS TEST
KW
2
1,KW
C>D ifReject
11
12
)1()(C
:scomparison paired for thepoint critical The
. and population
from nsobservatio theof ranks theofmean theis and where
:statistic test comparison pairwise The
ji
k
ji
ji
nn
nn
ji
RR
RRD
Further Analysis (Pairwise Comparisons of Average Ranks)
29
KRUSKAL-WALLIS TEST
= 2
0.05,2
15(15 + 1)
12
1
5+
1
5
= 5.992 (20)(2
5)
= 47.936 = 6.925
Reject if D > CKW
=44
5= 8.8
=56
5= 11.2
=20
5= 4
, = 8.8 11.20 = 2.4 , = 11.20 4 = 7.2 , = 8.8 4 = 4.8
Pairwise Comparisons of Average Ranks
30
KRUSKAL-WALLIS TEST
Distributions of class size were similar for all groups, as assessed by visual inspection of a
boxplot. The medians of class size were statistically significantly different between the Math,
History and English departments , 2 (2) = 6.72, p = .035. The post hoc analysis revealed statistically significant differences in the class size between the History and English (p =.033)
departments but not between the other group combinations.
31