Professional Documents
Culture Documents
Nonparametric Tests and Anovas:: What You Need To Know
Nonparametric Tests and Anovas:: What You Need To Know
Nonparametric Tests and Anovas:: What You Need To Know
and
ANOVAs:
What you need to know
Nonparametric tests
• Nonparametric tests are usually based
on ranks
• There are nonparametric versions of
most parametric tests
Parametric Nonparametric
One-sample and
Paired t-test Sign test
Test statistic
x = number of values Null distribution
compare
greater than mo Binomial n, 0.5
Test statistic
U1 or U2 Null distribution
compare
(use the largest) U with n1, n2
14
2
5
4
2
14
18
14
Example
Sorted
Data Data
14 2
2 2
5 4
4 5
2 14
14 14
18 14
14 18
Example
Sorted
Data Data
14 2
2 2
5 4
4 5 TIES
2 14
14 14
18 14
14 18
Example
Sorted
Data Data
14 2 Rank them
2 2 anyway,
5 4
4 5 TIES pretending
2 14 they were
14 14 slightly
18 14
14 18 different
Example
Sorted
Data Data Rank A
14 2 1
2 2 2
5 4 3
4 5 4
2 14 5
14 14 6
18 14 7
14 18 8
Example
Sorted
Data Data Rank A
Find the
14 2 1 average of the
2 2 2
5 4 3 ranks for the
4 5 4 identical
2 14 5 values, and
14 14 6
18 14 7 give them all
14 18 8 that rank
Example
Sorted
Data Data Rank A
14 2 1 Average = 1.5
2 2 2
5 4 3
4 5 4
2 14 5
14 14 6 Average = 6
18 14 7
14 18 8
Example
Sorted
Data Data Rank A Rank
14 2 1 1.5
2 2 2 1.5
5 4 3 3
4 5 4 4
2 14 5 6
14 14 6 6
18 14 7 6
14 18 8 8
Example
Sorted
Data Data Rank A Rank
14 2 1 1.5
2 2 2 1.5
5 4 3 3
4 5 4 4
2 14 5 6
14 14 6 6
18 14 7 6
14 18 8 8
Test statistic
MSgroup Null distribution
F= compare
MSerror F with k-1, N-k df
SSgroup equations
SSgroup here, SSerror SSerror
MSgroup = = MSerror = =
df group and
k −1 this is the df error N − k
€ simplest possible
SS group i
ANOVA
= ∑ n (Y i − Y ) 2 SS error = ∑ i (ni −1)
s 2
€
Y i = mean of group i ni = size of sample i
Y = overall mean
N = total sample size
MSgroup
F=
MSerror
SSgroup SSgroup SSerror SSerror
MSgroup = = MSerror = =
df group k −1 df error N − k
€
SSgroup = ∑ n i (Y i − Y ) 2 SSerror = ∑ si2 (n i −1)
€
SSgroup SSgroup MSgroup
SSgroup = ∑ n i (Y i − Y ) 2
dfgroup = k-1 MSgroup =
df group
=
k −1
F=
MSerror
SSerror SSerror
SSerror = ∑ s (n i −1)
2
i
dferror = N-k MSerror = =
df error N − k
€
€
€
Sum of Squares df Mean Squares F-ratio
€
ANOVA Tables
Source of Sum of df Mean F ratio P
variation squares Squares
Treatment
Error
Total
ANOVA Tables
Source of Sum of df Mean F ratio P
variation squares Squares
Treatment
SSgroup = ∑ n i (Y i − Y ) 2
€
ANOVA Tables
Source of Sum of df Mean F ratio P
variation squares Squares
Treatment k-1
SSgroup = ∑ n i (Y i − Y ) 2
Total € N-1
SSgroup + SSerror
€
ANOVA Tables
Source of Sum of df Mean F ratio P
variation squares Squares
Total € N-1
SSgroup + SSerror
€
€
ANOVA Tables
Source of Sum of df Mean F ratio P
variation squares Squares
Total € N-1
SSgroup + SSerror
€
€
ANOVA Tables
Source of Sum of df Mean F ratio P
variation squares Squares
Total € N-1
SSgroup + SSerror
€
€
ANOVA Table: Example
Source of Sum of df Mean F ratio P
variation squares Squares
Treatment 7.22 2
Error 9.41 19
Total
ANOVA Table: Example
Source of Sum of df Mean F ratio P
variation squares Squares
Total 16.64 21
Additions to ANOVA
• R2 value: how much variance is
explained?
• Comparisons of groups: planned and
unplanned
• Fixed vs. random effects
• Repeatability
Two-Factor ANOVA
• Often we manipulate more than one
thing at a time
• Multiple categorical explanitory
variables
• Example: sex and nationality
Two-factor ANOVA
• Don’t worry about the equations for this
• Use an ANOVA table
Two-factor ANOVA
• Testing three things:
1. Means don’t differ among treatment 1
2. Means don’t differ among treatment 2
3. There is no interaction between the
two treatments
Two-factor ANOVA Table
Source of Sum of df Mean Square F ratio P
variation Squares
Treatment 1 SS1 k1 - 1 SS1 MS1
k1 - 1 MSE
Treatment 2 SS2 k2 - 1 SS2 MS2
k2 - 1 MSE
Treatment 1 * SS1*2 (k1 - 1)*(k2 - 1) SS1*2 MS1*2
Treatment 2 (k1 - 1)*(k2 - 1) MSE
Error SSerror XXX SSerror
XXX
Total SStotal N-1