Skip to content

MCMCglmm: correslation between variables two variables in repeated measure?

3 messages · Ndjido Ardo BAR, Jarrod Hadfield, Ben Bolker

#
Hi,

Section 5.1 of the CourseNotes demonstrates how to fit such a model. A  
limitation of MCMCglmm if there are >2 time points is that there will  
probably be temporal auto-correlation which will not be accounted for  
by simply fitting subject as a random effect.  ASReml would allow you  
to include temporal auto-correlation if needed, and possibly lme.

Jarrod






Quoting Ndjido Ardo BAR <ndjido at gmail.com> on Sun, 3 Jul 2011 13:31:05 +0200:

  
    
#
Jarrod Hadfield <j.hadfield at ...> writes:
I would say that lme would allow you to fit this model, something
like:

(1) "melt" your data (possibly using melt() from the reshape package
so that it is structured as

  subject time var value
   1       1    1   0.2342
   1       1    2   0.2
   1       2    1   0.3
   1       2    2   0.1
...

 etc.

 then you can model this in lme() via something like:

lme(value~(var-1),random=~var|subject/time,correlation=corAR1(~time|subject))

  (you should probably check for yourself that this makes sense ...)

  This only tests correlation within subjects -- I'm not sure how to think
about correlation within time, across subjects ...