-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
project.org] On Behalf Of Michael Dewey
Sent: November-30-11 6:49 AM
To: Kristi Shoemaker; r-help at r-project.org
Subject: Re: [R] SPSS -> R
At 16:41 27/11/2011, Kristi Shoemaker wrote:
Hi John,
Your assumptions are correct and those examples were very helpful,
I think I'm almost there, but I'm screwing up something with the
within-subjects factor (the example has two, I only have one). See
below. Why am I not seeing my within-subjects factors in the ANOVA
report?
I am by no means an expert in this but my reading of the documentation
suggests that the idata and idesign parameters are for multivariate
models and that is not what you specified.
Subj Age Sex Time HippV
1 s01 32.9 1 0w 6.50098
2 s01 32.9 1 6w 6.91793
3 s02 35.1 0 0w 7.32480
4 s02 35.1 0 6w 7.56012
5 s03 34.4 0 0w 6.51385
6 s03 34.4 0 6w 6.56875
9 s05 39.9 1 0w 6.92855
10 s05 39.9 1 6w 6.94926
11 s06 29.5 1 0w 6.99383
12 s06 29.5 1 6w 7.10568
13 s07 45.9 1 0w 6.94380
14 s07 45.9 1 6w 7.08190
15 s08 20.3 1 0w 7.76881
16 s08 20.3 1 6w 7.72725
17 s09 26.9 0 0w 5.37566
18 s09 26.9 0 6w 5.74887
21 s11 22.0 0 0w 7.12992
22 s11 22.0 0 6w 7.16237
23 s12 31.0 1 0w 6.70629
24 s12 31.0 1 6w 6.80872
25 s13 50.1 1 0w 7.22649
26 s13 50.1 1 6w 7.58900
27 s14 22.2 0 0w 5.97577
28 s14 22.2 0 6w 5.80801
29 s16 20.4 1 0w 7.99554
30 s16 20.4 1 6w 8.09260
31 s20 24.0 0 0w 7.01014
32 s20 24.0 0 6w 6.87821
33 s21 32.4 0 0w 5.90883
34 s21 32.4 0 6w 5.95392
37 s24 22.2 0 0w 6.15474
38 s24 22.2 0 6w 6.00906
41 s27 22.2 1 0w 7.88765
42 s27 22.2 1 6w 7.76038
49 s35 24.3 0 0w 6.05998
50 s35 24.3 0 6w 6.07399
51 s36 23.5 0 0w 7.83182
52 s36 23.5 0 6w 7.60268
53 s38 59.7 1 0w 7.39672
54 s38 59.7 1 6w 6.98291
55 s39 40.5 0 0w 7.31330
56 s39 40.5 0 6w 7.50559
57 s40 24.2 1 0w 8.54958
58 s40 24.2 1 6w 8.65016
59 s41 23.6 1 0w 7.76049
60 s41 23.6 1 6w 7.58946
61 s42 53.3 0 0w 7.03388
62 s42 53.3 0 6w 7.48384
63 s43 34.4 0 0w 6.86967
64 s43 34.4 0 6w 6.81076
65 s44 44.8 0 0w 7.33779
66 s44 44.8 0 6w 7.86175
67 s45 40.2 1 0w 6.55963
68 s45 40.2 1 6w 6.52577
71 s47 26.5 0 0w 7.09418
72 s47 26.5 0 6w 6.92850
73 s48 22.7 0 0w 6.77078
74 s48 22.7 0 6w 6.67289
75 s50 36.1 1 0w 7.47208
76 s50 36.1 1 6w 7.55876
Loading required package: MASS
Loading required package: nnet
Loading required package: survival
Loading required package: splines
timepoints <- factor(c("0w", "6w"),
idata=data.frame(timepoints)
mod.ok <- lm(HippV ~ Age*Sex,data=Dat2) (av.ok <- Anova(mod.ok,
idata=idata, idesign=~timepoints))
Anova Table (Type II tests)
Response: HippV
Sum Sq Df F value Pr(>F)
Age 0.0234 1 0.071 0.7909202
Sex 5.3082 1 16.128 0.0001781 ***
Age:Sex 4.7772 1 14.514 0.0003478 ***
Residuals 18.4314 56
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1