R - Anova

> Procedural Languages > R

1 - About

To compare the gain scores across all groups, use anova

3 - Steps

3.1 - Homogeneity of variance assumption

First, check the homogeneity of variance assumption:

leveneTest(data$score, data$condition, center="mean")
Levene's Test for Homogeneity of Variance (center = "mean")
      Df F value Pr(>F)
group  3  1.1269 0.3436
      76
leveneTest(data$score, data$condition)
Levene's Test for Homogeneity of Variance (center = median)
      Df F value Pr(>F)
group  3  1.3134 0.2763
      76 
Advertising

3.2 - Anova

aov.model = aov(data$score ~ data$condition)
summary(aov.model)

3.3 - Model comparison

anova(model1, model2)
lang/r/anova.txt · Last modified: 2017/11/16 23:42 by 162.158.106.52