[英]R- Partial eta squared for repeated measures ANOVA (car package)
I have a 2-way repeated measures design (3 x 2), and I would like to get figures out how to calculate effect sizes (partial eta squared). 我有一个双向重复测量设计(3 x 2),我想弄清楚如何计算效果大小(部分eta平方)。
I have a matrix with data in it (called a) like so (repeated measures) 我有一个矩阵,其中包含数据(称为a),如此(重复测量)
A.a A.b B.a B.b C.a C.b
1 514.0479 483.4246 541.1342 516.4149 595.5404 588.8000
2 569.0741 550.0809 569.7574 599.1509 621.4725 656.8136
3 738.2037 660.3058 812.2970 735.8543 767.0683 738.7920
4 627.1101 638.1338 641.2478 682.7028 694.3569 761.6241
5 599.3417 637.2846 599.4951 632.5684 626.4102 677.2634
6 655.1394 600.9598 729.3096 669.4189 728.8995 716.4605
idata = idata =
Caps Lower
A a
A b
B a
B b
C a
C b
I know how to do a repeated measures ANOVA with the car package (type 3 SS is standard in my field although I know that it results in a logical error.. if somebody wants to explain that to me like I'm 5 I would love to understand it): 我知道如何使用汽车包重复测量ANOVA(3型SS在我的领域是标准的,虽然我知道它会导致逻辑错误..如果有人想向我解释这就像我5我会喜欢了解它):
summary(Anova(lm(a ~ 1),
idata=idata,type=3,
idesign=~Caps*Lower)),
multivariate=FALSE)
I think what I want to do is take this part of the summary print out: 我想我想要做的是将这部分摘要打印出来:
Univariate Type III Repeated-Measures ANOVA Assuming Sphericity 单变量III型重复测量ANOVA假设球形度
SS num Df Error SS den Df F Pr(>F)
(Intercept) 14920141 1 153687 5 485.4072 3.577e-06 ***
Caps 33782 2 8770 10 19.2589 0.000372 ***
Lower 195 1 13887 5 0.0703 0.801451
Caps:Lower 2481 2 907 10 13.6740 0.001376 **
And use it to calculate partial ETA squared. 并用它来计算部分ETA平方。 So, if I'm not mistaken, I need to take the SS from the first column and divide it by (itself + SS Error for that row) for each effect. 所以,如果我没有弄错的话,我需要从第一列中取出SS并将其除以(本身+该行的SS错误)每个效果。 Is this the correct way to go about it? 这是正确的方法吗? If so, how do I do it? 如果是这样,我该怎么办? I can't figure out how to reference values from the summary print out. 我无法弄清楚如何从摘要打印中引用值。
The partial eta-squared can be calculated with the etasq
function in heplots
package 可以使用heplots
包中的etasq
函数计算部分eta平方
library(car)
mod <- Anova(lm(a ~ 1),
idata = idata,
type = 3,
idesign = ~Caps*Lower)
mod
library(heplots)
etasq(mod, anova = TRUE)
Since you are asking about the calculations: 既然你在询问计算:
From ?etasq
: 'For univariate linear models, classical η^2 = SSH / SST and partial η^2 = SSH / (SSH + SSE). 来自?etasq
:'对于单变量线性模型,经典η^ 2 = SSH / SST和部分η^ 2 = SSH /(SSH + SSE)。 These are identical in one-way designs.'. 这些在单向设计中是相同的。'
If you wish to inspect the code for the calculations of η^2 for a model with a class
as in the example, you may use getS3method(f = "etasq", class = "Anova.mlm")
. 如果您希望检查具有class
的模型的η^ 2的计算代码,则可以使用getS3method(f = "etasq", class = "Anova.mlm")
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.