Dear list members, 
I extensively searched in the previous threads of this mailing list an example 
easy to understand for me, 

and able to fit my problem, but I didn´t succed to find a solution for which I 
feel certain.
At the moment I am stuck with this solution for my unbalanced design, and I 
don´t know if it is correct or not:

library(nlme)
scrd.lme <- lme(response~stimulus*condition,random=~1|subject,data=scrd)

Now at this point is it correct to simply run the command anova(scrd.lme) ? Or 
should I do something different using aov?

As I told, for a balanced case I would use the command 

> aov1 = aov(response ~ stimulus*condition + Error(subject/(stimulus*condition)), 
>data=scrd)


Now in the R prompt I get this output, which is very different from the one 
listed of aov for a balanced case:

> anova(scrd.lme) 
                   numDF denDF   F-value p-value
(Intercept)            1   182 178.56833  <.0001
stimulus               6   182   1.57851  0.1557
condition              1   182  39.68822  <.0001
stimulus:condition     6   182   0.67992  0.6660


Now, (if the previous point is correct) I am burning with curiosity to solve 
another problem.
I found that for condition there are significatively differences. 
For condition I have only 2 levels so there is no need to do a post-hoc 
analysis.
But if I had 4 levels, I would need.
Now, which is for the ANOVA with repeated measures with UNBALANCED design the 
right
approach for a post hoc test?

Is there anyone who can provide a R code example to solve this problem so I can 
better understand?


I know, I should read some books to understand better the subject. I am doing my 
best.


Thanks for any suggestion





________________________________
From: Ben Bolker <bbolker@gmail.com>
To: r-help@stat.math.ethz.ch
Sent: Sat, January 8, 2011 9:39:20 PM
Subject: Re: [R] Anova with repeated measures for unbalanced design

Frodo Jedi <frodo.jedi <at> yahoo.com> writes:

> 
> Dear all,
> I need an help because I am really not able to find over 
> internet a good example
> in R to analyze an unbalanced table with Anova with 
> repeated measures.
> For unbalanced table I mean that the questions are 
> not answered all by the same 
> number of subjects.
> 
> For a balanced case I would use the command 
>
> aov1 = aov(response ~ stimulus*condition + 
>  Error(subject/(stimulus*condition)), 
> data=scrd)

  I recommend that you find a copy of Pinheiro and Bates 2000 ...


> 
> Does the same code still work for unbalanced design?

  No, it doesn't.


> Can anyone provide a R example of code in order to get the same analysis?

  Something like

library(nlme)
lme1 <- lme(response~stimulus*condition,random=~1|subject,data=scrd)

or possibly

lme1 <- lme(response~stimulus*condition,random=~stimulus*condition|subject,
   data=scrd)

if your experimental design would allow you to estimate stimulus and condition
effects for each subject.

  Further questions along these lines should probably go to
the r-sig-mixed-model mailing list.

______________________________________________
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.



      
	[[alternative HTML version deleted]]

