【发布时间】:2014-05-26 12:42:17
【问题描述】:
我正在尝试使用 compute.es 包的 mes() 函数计算 ANOVA 的效果大小。
mes()-函数需要两组的均值 SD 和 N。我可以使用by(myDF$var1,myDF$var2, "stat.desc") 函数获得这些值。此工作流创建一个表,我必须手动将值从 by() 的结果复制并粘贴到 mes() 函数。
这对于几个 anova 是可行的,但我需要做 50 个额外的 anova,所以我正在寻找一种方法来以编程方式将这些方法链接在一起。有人知道如何做到这一点吗?
by()-方法可以随意更改,只有mes()方法对我很重要。
举个简单的例子:
library(compute.es)
library(pastecs)
v1 <- c(1,1,2,2)
v2 <- c(1,2,3,4)
df <- data.frame(v1,v2)
#I would execute this first, look for the values in the output and paste it to mes()
#I am using by() here because I knew it - there is almost certainly a better way...
print(by(df$v2, df$v1, stat.desc))
#I would like to insert these numbers automatically
print(mes(1.50,3.50,0.71,0.71 ,2,2))
【问题讨论】:
-
一个可重复的例子将大大有助于帮助那些想在这里提供帮助的人。
-
@AriB.Friedman 你完全正确-请原谅遗漏