2024

Mixed ANOVA

  • A mixed ANOVA is a combination of a between-subjects and within-subjects ANOVA.
##              y      A      B subject
##          <num> <fctr> <fctr>  <fctr>
##  1:  1.0084480      1      1       1
##  2:  3.6185704      1      1       2
##  3:  3.8036479      1      1       3
##  4:  3.8790420      1      1       4
##  5:  0.7082411      1      1       5
##  6:  1.5839961      1      2       6
##  7:  5.1697016      1      2       7
##  8:  1.1924059      1      2       8
##  9: -0.1066998      1      2       9
## 10:  0.1699234      1      2      10
## 11:  6.6848107      2      1       1
## 12:  1.3138900      2      1       2
## 13:  4.4263217      2      1       3
## 14:  4.7463849      2      1       4
## 15:  3.2016811      2      1       5
## 16:  3.6489707      2      2       6
## 17:  4.1681880      2      2       7
## 18:  8.7109503      2      2       8
## 19:  5.7247000      2      2       9
## 20:  0.4581123      2      2      10
##              y      A      B subject

Mixed ANOVA using ezANOVA

  • It’s mostly just a matter of specifying the within and between factors.
ezANOVA(data=d, dv=y, wid=subject, within=.(A), between=.(B))
## $ANOVA
##   Effect DFn DFd          F          p p<.05         ges
## 2      B   1   8 0.07731619 0.78801912       0.004423709
## 3      A   1   8 4.48764839 0.06699109       0.232570124
## 4    B:A   1   8 0.49784266 0.50047548       0.032525794

Assumption checks?

  • ezANOVA returns the following:

  • ANOVA A data frame containing the ANOVA results.

  • Mauchly’s Test for Sphericity If any within-Ss variables with >2 levels are present, a data frame containing the results of Mauchly’s test for Sphericity. Only reported for effects >2 levels because sphericity necessarily holds for effects with only 2 levels.

  • Sphericity Corrections If any within-Ss variables are present, a data frame containing the Greenhouse-Geisser and Huynh-Feldt epsilon values, and corresponding corrected p-values.

  • Levene’s Test for Homogeneity If the design is purely between-Ss, a data frame containing the results of Levene’s test for Homogeneity of variance. Note that Huynh-Feldt corrected p-values where the Huynh-Feldt epsilon >1 will use 1 as the correction epsilon.

Into the weeds?

  • It’s beyond the scope of this unit to fully deal with the assumptions of these tests, how to check them, and what do if assumptions are violated.

  • I will be happy for you to undertand the nature of the asumptions, and to have some intuition where they come from.

  • In the case of ANOVAs, key assumptions are made about the distribution of the raw data and their variances.