[R] ANOVA/ANCOVA Repeated Measure Mixed Model

Daniel Malter daniel at umd.edu
Fri Oct 7 07:20:18 CEST 2011


You are modeling Condition * Stimulus * Group as fully interacted fixed
effects. I do not actually think that you would need a complex random effect
structure for this. A simple random effect for the individual might suffice.
You could try to model this with lmer (in the lme4 library) and inspect
whether such a complex error structure actually adds anything to your model.

If the alert/passive stages are distinct measures that were assessed in
strict temporal order, then you could include the passive stage result
(assuming passive was assessed first) in the regression of the active stage
(the Response for the same subject under the same stimulus). Otherwise this
it may not make much sense to include one in the regression of the other if
there was no strict temporal order or if there is reason to believe that the
one measured first does not affect the one measured second.

But after all, these answers depend on your context and what you are trying
to actually show. It is therefore advisable that you talk to your local
statistician, if any.

HTH,
Daniel


Nick GH wrote:
> 
> Hello,
> 
> I am trying to test some results I have for significance. It has been
> recommended that I use R and I am completely new to this.
> 
> 
Set-up:

>    Groups: two groups of 8 subjects (16 total)
>    Two conditions: alert and passive
>    Measurements: responses for three different stimuli (A, B, and C)
> measured in each condition
> 
> 
Experiment: Testing the order of conditions 

>    Group one: Alert A, B and C followed by Passive A, B, and C 
>    Group two: Passive A, B, and C followed by Alert A, B, and C
> 
> Stimuli A, B and C are randomly interleaved in the experiment, does this
> matter in my ANOVA?
>  
> I am interested in making a between and within group comparison of
> responses to A, B, and C
> 
> <he>Here is what I am doing:

> 
> My data is arranged in the following way
> 
> Group Subject Condition Stimulus Response
> One      S1          Alert          A       _Value_
> One      S1          Alert          B       _Value_
> One      S1          Alert          C       _Value_
> One      S1          Passive      A       _Value_
> One      S1          Passive      B       _Value_
> One      S1          Passive      C       _Value_
> One      S2          Alert          A       _Value_
> ...
> 
> Two      S9          Alert          A       _Value_
> Two      S9          Alert          B       _Value_
> Two      S9          Alert          C       _Value_
> ...
> 
> This is the code I used:
> 
> M400_500_anova = aov(Response ~ Condition * Stimulus * Group +
> Error(Subject/Condition * Stimulus ), data=My_Data)
> 
> Is this correct?
> 
> 
ANCOVA question

> 
> I haven't gotten as far with this one, but I want to do an ANCOVA using
> the passive responses as a co-variate, but I am not sure how to even do
> this with so many factors/groups/repeated measures. I am also not sure
> what function to use in R, or how to even write the command. 
> 
> Thank you so much for your help!
> Nick GH
> 

--
View this message in context: http://r.789695.n4.nabble.com/ANOVA-ANCOVA-Repeated-Measure-Mixed-Model-tp3880868p3881024.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list