02 Non-Parametric Transformation
02 Non-Parametric Transformation
parametric
Today’s topics
1 2
Distributions Transformation MWU Wilcoxon KW test Graphs One/two side Distributions Transformation MWU Wilcoxon KW test Graphs One/two side
80
60
40
Frequency
skewed
0 N = 1011.00
26
28
30
32
34
36
38
40
42
44
46
48
50
52
54
56
58
.0
.0
.0
.0
.0
.0
.0
.0
.0
.0
.0
.0
.0
.0
.0
.0
.0
Weight (Kg)
not continuous: discrete,
counts, e.g., quadrats
biomass, concentrations
Binomial distribution: two outcomes:
Frequency
dead/alive
present/absent
smoking: y/n
not continuous, discrete
3 4
Distribution type
80
Frequency
60
20
Std. Dev = 5.24
Mean = 41.7
0 N = 1011.00
26
28
30
32
34
36
38
40
42
44
46
48
50
52
54
56
58
.0
.0
.0
.0
.0
.0
.0
.0
.0
.0
.0
.0
.0
.0
.0
.0
.0
Weight (Kg)
5 6
1
2 EM: transformation and Non
parametric
Distributions Transformation MWU Wilcoxon KW test Graphs One/two side Distributions Transformation MWU Wilcoxon KW test Graphs One/two side
Elephant movement
Speed (m/min)
136.1
119.4
143.8
191.4
40.0
64.7
144.4
98.5
94.0
29.3
68.0
How to
104.3
60.5 make
42.1
161.0 this tail
36.6
27.2
55.2
shorter?
20.3
…….
N > 1000
7 8
Distributions Transformation MWU Wilcoxon KW test Graphs One/two side Distributions Transformation MWU Wilcoxon KW test Graphs One/two side
9 10
Distributions Transformation MWU Wilcoxon KW test Graphs One/two side Distributions Transformation MWU Wilcoxon KW test Graphs One/two side
Transformation?
11 12
2
2 EM: transformation and Non
parametric
Introduction Transformation MWU Wilcoxon KW test Graphs Distributions Transformation MWU Wilcoxon KW test Graphs One/two side
?
Transformation and 0-values:
Speed (classes)
13 14
Distributions Transformation MWU Wilcoxon KW test Graphs One/two side Distributions Transformation MWU Wilcoxon KW test Graphs One/two side
Today’s topics
15 16
Distributions Transformation MWU Wilcoxon KW test Graphs One/two side Distributions Transformation MWU Wilcoxon KW test Graphs One/two side
17 18
3
2 EM: transformation and Non
parametric
Distributions Transformation MWU Wilcoxon KW test Graphs One/two side Distributions Transformation MWU Wilcoxon KW test Graphs One/two side
Mann-Whitney U test:
> wilcox.test(nrbeetles ~ area, data = beetles) # tied data:
This test: our test variable (U) should be < critical value
…there is a statistically significant difference between the medians (Mann
Whitney U -test, U=8.5, N1= 8 and N2=7, P<0.05)…..
Power of the Mann Whitney U test << t-test
19 20
Distributions Transformation MWU Wilcoxon KW test Graphs One/two side Distributions Transformation MWU Wilcoxon KW test Graphs One/two side
Area A Area B
50 50
% %
Median
H0: the two medians are equal
21 22
Distributions Transformation MWU Wilcoxon KW test Graphs One/two side Distributions Transformation MWU Wilcoxon KW test Graphs One/two side
Matched pairs? Not Normal?
Today’s topics
Wilcoxon matched pairs test
23 24
4
2 EM: transformation and Non
parametric
Introduction Transformation MWU Wilcoxon KW test Graphs Distributions Transformation MWU Wilcoxon KW test Graphs One/two side
25 26
Introduction
Mean/SD Unequal Hypothesis
P Equal
t-test uneq df 1-2 sided
P<0.05 Typet-test
I & IIeq Pairedt-test paired
Power Distributions Transformation MWU Wilcoxon KW test Graphs One/two side
Today’s topics
27 28
Distributions Transformation MWU Wilcoxon KW test Graphs One/two side Distributions Transformation MWU Wilcoxon KW test Graphs One/two side
Kruskal Wallis χ2 test
>2 groups?
= Σ(R2/N) X 12/(N(N+1)) = 14.58
N = total number of samples in all groups
Kruskal-Wallis test, test for medians,
> 2 groups, similar number of samples
Compare with χ2 Table
e.g., mean number of beetles/cup in 4 areas:
A B C D df = Number of groups – 1 = 4 – 1 = 3
27.1 48.5 11.2 44.5
14.4 18.9 0.0 1 72.0 So median number of beetles is
different among areas (Kruskal-Wallis test,
8.2 4.5 32.3 3.3 2 81.8 20 χ2 =14.58, df=3, P<0.01)
18.5 51.0 15.7 55.2
This table: calculated χ2
7.7 3 22.7 8.2 4.5 39.0
should be ≥ critical
N 5 5 5 5 threshold in table
R 36 66.5 21.5 86
29 30
5
2 EM: transformation and Non
parametric
Distributions Transformation MWU Wilcoxon KW test Graphs One/two side Distributions Transformation MWU Wilcoxon KW test Graphs One/two side
Today’s topics
31 32
Introduction Transformation MWU Wilcoxon KW test Graphs Introduction Transformation MWU Wilcoxon KW test Graphs
Normal distribution
95%
Mean in middle
Symmetrical
Means differ significantly Mean=median Means differ significantly
SD: 68%
2SDs: 95%
N beetles
Mean in middle
Symmetrical
Mean=median
SD: 68%
1 2 3 4
2SDs: 95%
Meadow
Dependent variable
33 34
Distributions Transformation MWU Wilcoxon KW test Graphs One/two side Distributions Transformation MWU Wilcoxon KW test Graphs One/two side
Boxplot
Interpretation
Number of beetles (n/ha)
Medians with
4 quartiles
Mean, s.d. (or c.l) can not be Means differ significantly * Outlier
used ≈100%
Data not normal? 75%
Error bars are not informative 50%
Use different plot type median
H0: medians are equal 25%
* ≈0%
Outlier
>1.5*interquartile
range
35 36
6
2 EM: transformation and Non
parametric
Distributions Transformation MWU Wilcoxon KW test Graphs One/two side Distributions Transformation MWU Wilcoxon KW test Graphs One/two side
Number of beetles (n/ha)
Today’s topics
Number of beetles (n/ha)
Number of observations
1. Data distributions & transformation
2. Non-parametric tests:
Mann-Whitney U test
Wilcoxon matched pairs test
Kruskal-Wallis test
3. Graphs for non-normal data
4. One-two sided testing
37 38
Distributions Transformation MWU Wilcoxon KW test Graphs One/two side Distributions Transformation MWU Wilcoxon KW test Graphs One/two side
df = 6
This test: our test variable (U) should be < critical value
…there is a statistically significant difference between the medians (Mann
Whitney U -test, U=8.5, N1= 8 and N2=7, P<0.05)…..
Power of the Mann Whitney U test << t-test
39 40
Distributions Transformation MWU Wilcoxon KW test Graphs One/two side Distributions Transformation MWU Wilcoxon KW test Graphs One/two side
Posthoc
41 42
7
2 EM: transformation and Non
parametric
Distributions Transformation MWU Wilcoxon KW test Graphs One/two side Distributions Transformation MWU Wilcoxon KW test Graphs One/two side
Anova
Posthoc
43 44
Distributions Transformation MWU Wilcoxon KW test Graphs One/two side Distributions Transformation MWU Wilcoxon KW test Graphs One/two side
Mann-Whitney U
wilcox.test(speed ~ daynight,
Normal distribution data = elespeed_small,
exact = FALSE)
Parametric tests wilcox.test(Pair(massw2, massw3)~1,
data = nestlings)
Power test: +++ Wilcox matched
pairs
kruskal.test(nrbeestles ~ area,
data = beetles) Bar graph + SD
Kruskal-Wallis
45 46
Today’s topics
47