具有不平衡组的双因素方差分析

时间:2014-02-07 04:24:55

标签: r statistics regression anova

您目前正在使用R与ez库运行双向ANOVA。我有一个df:

    Adult_Group Condition   ID    value
1   TS   BaseLine CC8 3.549067
2   TS   BaseLine BOB 3.518851
3   TS   BaseLine 1910 3.432579
4   TS   BaseLine  cc80 3.542127
5   TS   BaseLine  83d 3.555026
6   TS   BaseLine  976c 3.514849
7  Control   BaseLine hum2 3.533039
8  Control   BaseLine ze8 3.435466
9  Control   BaseLine 1177 3.365024
10 Control   BaseLine jj89 3.584407
11 Control   BaseLine 1811 3.439752
12 Control   BaseLine 1812 3.356929
13 Control   BaseLine ui77 3.288869
14 Control   BaseLine 1816 3.421073
15 Control   BaseLine hY89 3.445101
16 Control   BaseLine ant3 3.527448
17 Control   BaseLine zz890 3.651334
18 Control   BaseLine 54e 3.733847
19  TS     Drug CC8 19.477935
20  TS     Drug BOB 19.493235
21  TS     Drug 1910 19.552410
22  TS     Drug  cc80 19.462172
23  TS     Drug  83d 19.524890
24  TS     Drug  976c 19.459000
25 Control     Drug hum2 19.567258
26 Control     Drug ze8 19.450310
27 Control     Drug 1177 19.609983
28 Control     Drug jj89 19.698721
29 Control     Drug 1811 19.459862
30 Control     Drug 1812 19.605273
31 Control     Drug ui77 19.369069
32 Control     Drug 1816 19.523160
33 Control     Drug hY89 19.648593
34 Control     Drug ant3 19.417133
35 Control     Drug zz890 19.547570
36 Control     Drug 54e 19.5650688

我可以使用ez库来运行双向ANOVA。

A = ezANOVA(
  data = temp
  , dv = value
  , wid = ID
  , within = Condition
  , between = Adult_Group
  ,return_aov=TRUE
  , type = 3
)

这非常有效,但我想知道是否有另一种方法可以在没有ez库的情况下执行此操作,比如使用lm函数?

谢谢你!

1 个答案:

答案 0 :(得分:0)

有一个内置的方差函数分析aov

键入?aov以访问帮助文档。此外,Quick-R上有pretty decent tutorial