[R] reading the results of a within subject test

2011-06-23 Thread Ann
Hi, I ran the following in R (on item means):

aov(VAR ~(a*b)+Error(item/(a*b)), data = item)

I got this result:

Error: item
  Df Sum SqMean Sq F value   Pr(F)   
a   1 7.7249e+13 7.7249e+13  11.329 0.003934 **
Residuals 16 1.0910e+14 6.8187e+12
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 

Error: item:a
  Df Sum SqMean Sq F value   Pr(F)   
a   1 1.1218e+14 1.1218e+14  8.6909 0.009449 **
b 1 2.7264e+10 2.7264e+10  0.0021 0.963912   
Residuals 16 2.0653e+14 1.2908e+13
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 

Error: item:b
Df Sum SqMean Sq F value  Pr(F)  
b   1 6.0538e+13 6.0538e+13  2.7157 0.11886  
a:b  1 1.7894e+14 1.7894e+14  8.0272 0.01199 *
Residuals   16 3.5666e+14 2.2292e+13  
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 

Error: item:a:b
Df Sum SqMean Sq F value Pr(F)
a:b  1 4.9726e+12 4.9726e+12   0.629 0.4461
Residuals   10 7.9061e+13 7.9061e+12 

and I'm not sure what is what in there. Is it reporting a between analysis
as well?Why does the interaction between a and b appear several times?

 When I ran the anova I did get a warning message (In aov(VAR ~ (a * b) +
Error(item/(a * b)),  :
  Error() model is singular) 

I'm confused...

Thanks!

--
View this message in context: 
http://r.789695.n4.nabble.com/reading-the-results-of-a-within-subject-test-tp3621044p3621044.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] reading the results of a within subject test

2011-06-23 Thread Stephen Ellison

From: r-help-boun...@r-project.org [r-help-boun...@r-project.org] On Behalf Of 
Ann [trivialesc...@gmail.com]
Subject: [R] reading the results of a within subject test

Hi, I ran the following in R (on item means):

 aov(VAR ~(a*b)+Error(item/(a*b)), data = item)

 
 I'm confused...

Could you say more about what 'item' in 'data=item' is? The data= argument is 
usually a data frame which would normally (for your model specification) 
contain a continuous variable 'VAR', and probably categorical variables 
(factors) a, b and item. It is possible to have a data fram called item 
containing a variable called item, but I'm not quite sure that's what you have.

Assuming that you have - or at least hoping so, 'cos I can't see how the model 
would work properly otherwise - you seem to have specified a two-way anova with 
interactions against fixed effect factors a and b, (with a*b expanding to a, b 
and a:b) and an Error term which effectively says you want to test your a, b 
and a:b fixed effects against random effects a, b and a:b (from the a*b) nested 
within Item, so expanding to item:a, item:b and item:a:b. That is why you got 
all those extra tables. But that sounds a bit unlikely. Most experimenters 
either nest items in a:b subgroups (ie observing several different items for 
each a:b group) or, for blocked designs, use all combinations of a:b treatments 
on every one of a number of different items (obviously hard to do unless the 
treatments are reversible  - an example might be experiments like reversible 
exterior temperature/pressure effects on, say, flow meter readings).

I'd guess the more likely scenario is that you have multiple different items 
per a:b group. That would require only one error term - item, uniquely 
identified perhaps as a:b:item or simply as item if the items are already 
individually labelled. 

But you also say 'on the item means'. Asking for item as an error term implies 
that you have residual error within item. You clearly can't see that if you 
only supply item means (which may be one reason aov warned you that you had a 
singular model - that last table would have been seeking to calculate the 
residual variance, and after the item means were taken out, there wan't any 
residual variance). If you had a nested model (multiple different items per a:b 
subgroup), _either_ you should have provided the raw observations (and not the 
means) and specified Error(item) or Error(a:b:item) for which aov() would give 
you a table of tests against the residual MS and another table with tests 
against the item MS (the latter being the more sensible of the two if items are 
random and appreciably different), _or_ you should supply the item means, in 
which case you need not include item in the model because the variation between 
item means within each group is simply the residual error!
 . 

Admittedly I'm speculating quite a bit on what experiment you've actually done, 
but with a bit of luck some of the above will give you a clue...


***
This email and any attachments are confidential. Any use...{{dropped:8}}

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.