[R] aov and Error function
John Sorkin
JSorkin at grecc.umaryland.edu
Sat Jan 31 14:17:43 CET 2015
I am trying to understand the Error function and its use in ANOVA. In particular I want to understand the difference between two models that differ only with respect to the Error statement:
aovsubj<- aov(value~group+time+Error(subject),data=dataRMANOVA)
and
aovsubjgroup<-aov(value~group+time+Error(subject/group),data=dataRMANOVA)
You will note that in my data I have two subject identifiers, subject and subject2. I am also trying to trying to understand how I should identify subjects, within group (i.e. intervention vs. control) or within time (0=baseline, 1=post)
> dataRMANOVA
value time group subject subject2
1 1.000000 0 int 1 1
2 2.000000 0 int 2 2
3 3.000000 0 int 3 3
4 4.000000 0 int 4 4
5 5.000000 0 int 5 5
6 6.000000 0 int 6 6
7 7.000000 0 int 7 7
8 8.000000 0 int 8 8
9 9.000000 0 int 9 9
10 10.000000 0 int 10 10
11 11.000000 0 int 11 11
12 12.000000 0 int 12 12
13 13.000000 0 int 13 13
14 14.000000 0 int 14 14
15 15.000000 0 int 15 15
16 16.000000 0 int 16 16
17 17.000000 0 int 17 17
18 18.000000 0 int 18 18
19 19.000000 0 int 19 19
20 20.000000 0 int 20 20
21 21.000000 0 cont 1 21
22 22.000000 0 cont 2 22
23 23.000000 0 cont 3 23
24 24.000000 0 cont 4 24
25 25.000000 0 cont 5 25
26 26.000000 0 cont 6 26
27 27.000000 0 cont 7 27
28 28.000000 0 cont 8 28
29 29.000000 0 cont 9 29
30 30.000000 0 cont 10 30
31 31.000000 0 cont 11 31
32 32.000000 0 cont 12 32
33 33.000000 0 cont 13 33
34 34.000000 0 cont 14 34
35 35.000000 0 cont 15 35
36 36.000000 0 cont 16 36
37 37.000000 0 cont 17 37
38 38.000000 0 cont 18 38
39 39.000000 0 cont 19 39
40 40.000000 0 cont 20 40
41 2.879131 1 int 1 1
42 1.533651 1 int 2 2
43 2.487756 1 int 3 3
44 3.446068 1 int 4 4
45 5.179854 1 int 5 5
46 5.775819 1 int 6 6
47 6.923979 1 int 7 7
48 8.163734 1 int 8 8
49 9.545974 1 int 9 9
50 8.792186 1 int 10 10
51 11.657503 1 int 11 11
52 12.681393 1 int 12 12
53 15.058688 1 int 13 13
54 13.757673 1 int 14 14
55 15.459029 1 int 15 15
56 15.535549 1 int 16 16
57 16.433237 1 int 17 17
58 17.247330 1 int 18 18
59 19.061927 1 int 19 19
60 21.165003 1 int 20 20
61 20.436705 1 cont 1 21
62 23.143230 1 cont 2 22
63 23.456946 1 cont 3 23
64 23.132284 1 cont 4 24
65 24.902017 1 cont 5 25
66 26.450399 1 cont 6 26
67 27.356943 1 cont 7 27
68 27.402023 1 cont 8 28
69 29.759883 1 cont 9 29
70 27.969628 1 cont 10 30
71 30.061475 1 cont 11 31
72 32.532427 1 cont 12 32
73 33.378877 1 cont 13 33
74 34.852244 1 cont 14 34
75 34.958594 1 cont 15 35
76 35.673225 1 cont 16 36
77 37.908208 1 cont 17 37
78 37.982471 1 cont 18 38
79 39.016917 1 cont 19 39
80 39.507583 1 cont 20 40
Thank you,
John
John David Sorkin M.D., Ph.D.
Professor of Medicine
Chief, Biostatistics and Informatics
University of Maryland School of Medicine Division of Gerontology and Geriatric Medicine
Baltimore VA Medical Center
10 North Greene Street
GRECC (BT/18/GR)
Baltimore, MD 21201-1524
(Phone) 410-605-7119
(Fax) 410-605-7913 (Please call phone number above prior to faxing)
Confidentiality Statement:
This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.
More information about the R-help
mailing list