简体   繁体   中英

Repeated measures ANOVA - degrees of freedom

I'm studying repeated measures ANOVAs, found this example online and can't understand how are the df calculated. What would be the mathematical expression for calculating both df values in this example?

data(obk.long, package = "afex")

# estimate mixed ANOVA on the full design:
aov_car(value ~ treatment * gender + Error(id/(phase*hour)), 
        data = obk.long, observed = "gender")


# the three calls return the same ANOVA table:
# Anova Table (Type 3 tests)
# 
# Response: value
#                         Effect          df   MSE         F  ges p.value
# 1                    treatment       2, 10 22.81    3.94 + .198    .055
# 2                       gender       1, 10 22.81    3.66 + .115    .085
# 3             treatment:gender       2, 10 22.81      2.86 .179    .104
# 4                        phase 1.60, 15.99  5.02 16.13 *** .151   <.001
# 5              treatment:phase 3.20, 15.99  5.02    4.85 * .097    .013
# 6                 gender:phase 1.60, 15.99  5.02      0.28 .003    .709
# 7       treatment:gender:phase 3.20, 15.99  5.02      0.64 .014    .612
# 8                         hour 1.84, 18.41  3.39 16.69 *** .125   <.001
# 9               treatment:hour 3.68, 18.41  3.39      0.09 .002    .979
# 10                 gender:hour 1.84, 18.41  3.39      0.45 .004    .628
# 11       treatment:gender:hour 3.68, 18.41  3.39      0.62 .011    .641
# 12                  phase:hour 3.60, 35.96  2.67      1.18 .015    .335
# 13        treatment:phase:hour 7.19, 35.96  2.67      0.35 .009    .930
# 14           gender:phase:hour 3.60, 35.96  2.67      0.93 .012    .449
# 15 treatment:gender:phase:hour 7.19, 35.96  2.67      0.74 .019    .646
# ---
# Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘+’ 0.1 ‘ ’ 1 

Those degrees of freedom are the result of applying the Greenhouse–Geisser correction (Greenhouse & Geisser, 1959), which is the default correction applied by aov_car, as far as I know.

In Salkind (2010), Hervé Abdi states that:

In addition to the usual assumptions of normality of the error and homogeneity of variance, the F test for repeated-measurement designs assumes a condition called sphericity. Intuitively, this condition indicates that the ranking of the subjects does not change across experimental treatments. This is equivalent to stating that the population correlation (computed from the subjects' scores) between two treatments is the same for all pairs of treatments. This condition implies that there is no interaction between the subject factor and the treatment. If the sphericity assumption is not valid, then the F test becomes too liberal (ie, the proportion of rejections of the null hypothesis is larger than the α level when the null hypothesis is true).

As per this link :

The degree to which sphericity is present, or not, is represented by a statistic called epsilon (ε). An epsilon of 1 (ie, ε = 1) indicates that the condition of sphericity is exactly met. The further epsilon decreases below 1 (ie, ε < 1), the greater the violation of sphericity. Therefore, you can think of epsilon as a statistic that describes the degree to which sphericity has been violated. The lowest value that epsilon (ε) can take is called the lower-bound estimate. Both the Greenhouse-Geisser and the Huynd-Feldt procedures attempt to estimate epsilon (ε), albeit in different ways (it is an estimate because we are dealing with samples, not populations). For this reason, the estimates of sphericity (ε) tend to always be different depending on which procedure is used. By estimating epsilon (ε), all these procedures then use their sphericity estimate (ε) to correct the degrees of freedom for the F-distribution.

The calculation of ε is rather long, and one would need to paste here a series of formulas and notations to fully reproduce the logic, so I just refer you to the quoted sources.

You can see what ε values R is using to perform the correction through the summary command:

b<-aov_car(value ~ treatment * gender + Error(id/(phase*hour)), 
        data = obk.long, observed = "gender")
b
summary(b)

The degrees of freedom you see in your question are the result of multiplying the original degrees of freedom by ε.

If you want to see those original degrees of freedom, you can specify that you don't want any correction:

c<-aov_car(value ~ treatment * gender + Error(id/(phase*hour)), 
           data = obk.long, observed = "gender", anova_table = list(correction = "none"))
c

Only the degrees of freedom corresponding to within subjects variables will be corrected by epsilon, as Vonesh et al. (1997) state:

Box (1954a, 1954b) suggested adjusting the numerator and denominator degrees of freedom for the within-units F tests by multiplying the by the lower bound of e, namely, 1/(p-1).

For more detail, I highly recommend the excellent book by Howell (2013) . The repeated-measures designs chapter is very friendly and it describes what to do when you have either 1) two between-subjects + 1 within-subjects factors design or 2) two within-subjects + 1 between-subjects factors design. Page 481 shows the formulas to obtain the degrees of freedom for the first design, and page 484 shows the formulas for the second design.

Finally, this link contains and example of how to calculate degrees of freedom.

Sources:

  • Box, GEP (1954a). Some Theorems on Quadratic Forms Applied in the Study of Analysis of Variance Problems, I. Effect of Inequality of Variance in the One-Way Classification. The Annals of Mathematical Statistics, 25(2), 290–302. https://doi.org/10.1214/aoms/1177728786
  • Box, GEP (1954b). Some Theorems on Quadratic Forms Applied in the Study of Analysis of Variance Problems, II. Effects of Inequality of Variance and of Correlation Between Errors in the Two-Way Classification. The Annals of Mathematical Statistics, 25(3), 484–498. https://doi.org/10.1214/aoms/1177728717
  • Greenhouse, SW, & Geisser, S. (1959). On methods in the analysis of profile data. Psychometrika, 24(2), 95–112. https://doi.org/10.1007/BF02289823
  • Howell, DC (2013). Statistical Methods for Psychology (8th ed). Wadsworth Cengage Learning.
  • Salkind, NJ (Ed.). (2010). Encyclopedia of research design. SAGE Publications.
  • Vonesh, EF, Chinchilli, VM, & NetLibrary, I. (1997). Linear and nonlinear models for the analysis of repeated measurements. M. Dekker.

The specific chapter from Salkind (2010) is available here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM