-1

我必须使用内置包在 R 中制作方差分析,我的数据看起来像这样:

dane=cbind(a=rnorm(10),b=rnorm(10),c=c(1,1,1,1,2,2,2,2,2,2))

a并且b是我想测试关于变量分配的组中均值相等假设的c变量。我的情况是最简单的情况t-test是不够的。

4

1 回答 1

1
dane <- data.frame(dane)
with(dane, aov(c(a[c==1],b[c==2]) ~ c))

或者,如果您打算同时测试两者ab作为单独的 dvs:

with(dane, aov(a ~ c))
with(dane, aov(b ~ c))
于 2013-06-10T19:59:53.930 回答