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

In Salkind (2010), Hervé Abdi states that:在 Salkind (2010) 中,Hervé Abdi 指出:

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 检验变得过于宽松(即,当原假设为真时,拒绝原假设的比例大于 α 水平)。

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:您可以通过 summary 命令查看 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

Only the degrees of freedom corresponding to within subjects variables will be corrected by epsilon, as Vonesh et al.正如 Vonesh 等人,只有与受试者内部变量相对应的自由度才会被 epsilon 校正。 (1997) state: (1997) 状态:

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). Box (1954a, 1954b) 建议通过将 乘以 e 的下限,即 1/(p-1) 来调整单位内 F 检验的分子和分母自由度。

For more detail, I highly recommend the excellent book by Howell (2013) .有关更多详细信息,我强烈推荐 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.重复测量设计一章非常友好,它描述了当您有 1) 两个被试间 + 1 个被试内因子设计或 2) 两个被试内 + 1 个被试间因子设计时该怎么做。 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.第 481 页显示了获得第一个设计的自由度的公式,第 484 页显示了第二个设计的公式。

Finally, this link contains and example of how to calculate degrees of freedom.最后, 此链接包含如何计算自由度的示例。

Sources:资料来源:

  • Box, GEP (1954a).框,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.在方差问题分析研究中应用的关于二次型的一些定理,I. 方差不等式在单向分类中的影响。 The Annals of Mathematical Statistics, 25(2), 290–302.数理统计年鉴,25(2),290-302。 https://doi.org/10.1214/aoms/1177728786 https://doi.org/10.1214/aoms/1177728786
  • Box, GEP (1954b).框,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.数理统计年鉴,25(3),484-498。 https://doi.org/10.1214/aoms/1177728717 https://doi.org/10.1214/aoms/1177728717
  • Greenhouse, SW, & Geisser, S. (1959).温室,西南和盖瑟,S.(1959 年)。 On methods in the analysis of profile data.关于剖面数据分析的方法。 Psychometrika, 24(2), 95–112. Psychometrika,24(2),95-112。 https://doi.org/10.1007/BF02289823 https://doi.org/10.1007/BF02289823
  • Howell, DC (2013).豪厄尔,哥伦比亚特区(2013 年)。 Statistical Methods for Psychology (8th ed).心理学统计方法(第 8 版)。 Wadsworth Cengage Learning. Wadsworth Cengage 学习。
  • Salkind, NJ (Ed.).新泽西州萨尔金德 (Ed.)。 (2010). (2010)。 Encyclopedia of research design.研究设计百科全书。 SAGE Publications. SAGE 出版物。
  • Vonesh, EF, Chinchilli, VM, & NetLibrary, I. (1997). Vonesh, EF, Chinchilli, VM, & NetLibrary, I. (1997)。 Linear and nonlinear models for the analysis of repeated measurements.用于分析重复测量的线性和非线性模型。 M. Dekker. M. 德克尔。

The specific chapter from Salkind (2010) is available here Salkind (2010) 的具体章节可在此处获得

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

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