简体   繁体   English

重复测量方差分析 - 自由度

[英]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.我正在研究重复测量方差分析,在网上找到了这个例子,但不明白 df 是如何计算的。 What would be the mathematical expression for calculating both df values in this example?在这个例子中计算两个 df 值的数学表达式是什么?

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, which is the default correction applied by aov_car, as far as I know.据我所知,这些自由度是应用 Greenhouse–Geisser 校正的结果,这是 aov_car 应用的默认校正。

Salkind (2010), states that: Salkind (2010) 指出:

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.除了误差的正态性和方差同质性的通常假设外,重复测量设计的 F 检验还假设了一个称为球形度的条件。 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).如果球形假设不成立,则 F 检验变得过于宽松(即,当 null 假设为真时,拒绝 null 假设的比例大于 α 水平)。

As per this link :根据此链接

The degree to which sphericity is present, or not, is represented by a statistic called epsilon (ε).存在或不存在球形度的程度由称为 epsilon (ε) 的统计量表示。 An epsilon of 1 (ie, ε = 1) indicates that the condition of sphericity is exactly met. epsilon 为 1(即 ε = 1)表示完全满足球形条件。 The further epsilon decreases below 1 (ie, ε < 1), the greater the violation of sphericity. epsilon 进一步降低到 1 以下(即 ε < 1),对球形度的破坏越大。 Therefore, you can think of epsilon as a statistic that describes the degree to which sphericity has been violated.因此,您可以将 epsilon 视为描述违反球形度的程度的统计量。 The lowest value that epsilon (ε) can take is called the lower-bound estimate. epsilon (ε) 可以取的最低值称为下限估计。 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). Greenhouse-Geisser 和 Huynd-Feldt 程序都试图估计 epsilon (ε),尽管方式不同(这是一个估计值,因为我们处理的是样本,而不是总体)。 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.通过估计 epsilon (ε),所有这些程序然后使用它们的球形估计 (ε) 来校正 F 分布的自由度。

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:您可以通过汇总命令查看 R 用于执行校正的 ε 值:

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

Sources: Salkind, NJ (Ed.).资料来源:新泽西州萨尔金德(主编)。 (2010). (2010)。 Encyclopedia of research design.研究设计百科全书。 SAGE Publications. SAGE 出版物。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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