As with the non-parametric equivalent tests for independent and dependent samples t-tests, there are non-parametric tests that are the equivalent of ANOVA and Repeated Measures ANOVA.
Load the data HERE into R into a table called data. Column 1 is participant numbers, column 2 is a grouping variable, and column 3 is the dependent measure. Note that the participant numbers repeat themselves indicating a repeated or dependent measurement. However, we will first pretend this data reflects three independent groups.
data = read.table("anovadata.txt")
For simplicities sake, let's pull the factor and dependent measure out of the table and take a look at them:
group = factor(data$V2)
dv = data$V3
boxplot(dv~group)
Note, the Boxplot alone probably suggests that this data is non-parametric, but you could verify that easily with Levene's Test:
library(car)
leveneTest(dv~group)
The non-parametric version of ANOVA is called a Kruskal-Wallis Test (see Field for full details) and is easy to run in R:
kruskal.test(dv~group)
As with the test in the previous assignment, this test returns a p value and a test statistic, in this instance a Chi Squared value. Again, you can read more about this in the Field text but at the end of the day it is a test statistic to evaluate against a distribution to obtain a p-value.
Now, given that this parallels an ANOVA it needs to undergo Post-Hoc analysis to see where the differences lie. To do this, we use the kruskalmc function which requires a new package to be installed:
install.packages("pgirmess")
library(pgirmess)
kruskalmc(dv~group)
The output will look something like this which shows that all groups are different (significance = TRUE).
Multiple comparison test after Kruskal-Wallis
p.value: 0.05
Comparisons
obs.dif critical.dif difference
1-2 15.4 13.22119 TRUE
1-3 37.7 13.22119 TRUE
2-3 22.3 13.22119 TRUE
Non Parametric Equivalent of RM ANOVA
As noted above, there is also a non-parametric equivalent of the RM ANOVA, and that is Friedman's ANOVA. I will not say much about it here - you can read the appropriate sections of field for that. Running one in R is simple, however, it requires that your data be a matrix as opposed to a data frame. As such, you could run one by going:
friedman.test(as.matrix(data))
And you could post-hoc this by using:
friedmanmc(as.matrix(data))
Load the data HERE into R into a table called data. Column 1 is participant numbers, column 2 is a grouping variable, and column 3 is the dependent measure. Note that the participant numbers repeat themselves indicating a repeated or dependent measurement. However, we will first pretend this data reflects three independent groups.
data = read.table("anovadata.txt")
For simplicities sake, let's pull the factor and dependent measure out of the table and take a look at them:
group = factor(data$V2)
dv = data$V3
boxplot(dv~group)
Note, the Boxplot alone probably suggests that this data is non-parametric, but you could verify that easily with Levene's Test:
library(car)
leveneTest(dv~group)
The non-parametric version of ANOVA is called a Kruskal-Wallis Test (see Field for full details) and is easy to run in R:
kruskal.test(dv~group)
As with the test in the previous assignment, this test returns a p value and a test statistic, in this instance a Chi Squared value. Again, you can read more about this in the Field text but at the end of the day it is a test statistic to evaluate against a distribution to obtain a p-value.
Now, given that this parallels an ANOVA it needs to undergo Post-Hoc analysis to see where the differences lie. To do this, we use the kruskalmc function which requires a new package to be installed:
install.packages("pgirmess")
library(pgirmess)
kruskalmc(dv~group)
The output will look something like this which shows that all groups are different (significance = TRUE).
Multiple comparison test after Kruskal-Wallis
p.value: 0.05
Comparisons
obs.dif critical.dif difference
1-2 15.4 13.22119 TRUE
1-3 37.7 13.22119 TRUE
2-3 22.3 13.22119 TRUE
Non Parametric Equivalent of RM ANOVA
As noted above, there is also a non-parametric equivalent of the RM ANOVA, and that is Friedman's ANOVA. I will not say much about it here - you can read the appropriate sections of field for that. Running one in R is simple, however, it requires that your data be a matrix as opposed to a data frame. As such, you could run one by going:
friedman.test(as.matrix(data))
And you could post-hoc this by using:
friedmanmc(as.matrix(data))