Question

Hi currently using R with the ez library to run 2-way ANOVA. I have a df as such:

    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

I can use the ez library to run a 2-way ANOVA.

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

This works very well but I'm wondering if there is another way to do this without the ez library, say with the lm function?

thank you!

No correct solution

OTHER TIPS

There is a built-in analysis of variance function, aov.

Type ?aov to access the help documentation. Also, Quick-R has a pretty decent tutorial on it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top