[R-sig-ME] repeat measures: time series or mixed model?

Samer Mouksassi smouksassi at Pharsight.com
Tue Mar 24 20:43:27 CET 2009


One way to account for within butterfly correlation is to have this
effect entered as a random effect. This will automatically accounts for
the correlation.

A good structural model ( i.e linear, quadratic or nonlinear in Week
(time)  ) will explain the time course of your endpoint and then no
residual serial correlation should remain. You may also model the
correlation itself but again this will depend on the questions you are
trying to answer.


-----Original Message-----
From: r-sig-mixed-models-bounces at r-project.org
[mailto:r-sig-mixed-models-bounces at r-project.org] On Behalf Of CL
Sent: 2009-03-24 15:13
To: r-sig-mixed-models at r-project.org
Subject: Re: [R-sig-ME] repeat measures: time series or mixed model?

Dear all,

I've scrolled through the archives and CRAN help pages and can't find an

answer for my query: my apologies if it is rather basic.

I have a data set that is unbalanced and consists of:

67 SITEs measured over several YEARs every WEEK (April-Sept) for 
butterflies (LEPS per m - continuous data). I'm interested in the 
MANagement code (categorical) assigned to each site, but I have also
on TEMPerature, average SUN and WIND (some missing data with weather 
variables though). My guess is that a linear mixed model would be most 
appropriate and have constructed this code first of all:


The output gives me:
Linear mixed-effects model fit by REML
 Data: NULL
        AIC       BIC   logLik
  -37631.24 -37566.48 18824.62

Random effects:
 Formula: ~YEAR/WEEK| SITE
 Structure: General positive-definite, Log-Cholesky parametrization
             	 StdDev       Corr
(Intercept)   	5.875102e-03 (Intr) YEAR
YEAR          	1.392439e-06 -0.164
YEAR:WEEK 		5.068196e-07  0.531  0.301
Residual      	3.532589e-02

Fixed effects: LEPS ~ MAN
                  Value   Std.Error   DF  t-value p-value
(Intercept) 0.009866718 0.001428957 9793 6.904841    0.00
MAN     	0.000028304 0.001127429   65 0.025105    0.98
MAN -0.685

Standardized Within-Group Residuals:
        Min          Q1         Med          Q3         Max
-2.70566579 -0.40089121 -0.18073723  0.05900735 19.16411466

Number of Observations: 9860
Number of Groups: 67

I am slightly confused by the output. I figure that this clearly means
management has no effect on butterflies but how can I figure out what 
effect SITE, YEAR and WEEK have on the data? Would I have to also
them in the fixed effects side of the formula (I'm unsure if this is 
allowed)? Also, how could I include my weather variables? Would they
be placed on the fixed effect side of the formula as they are

e.g. model<-lme(LEPS~MAN+TEMP+SUN+WIND,random=~YEAR/WEEK|SITE)

They are bound to be correlated so does that cause problems when putting

into the same model? Could I simply use na.exclude in this instance to 
remove records missing but still include the data for the other effects?
have seen so many different ways in which this can be done - I want to
sure I do it correctly.

Furthermore, I am unsure if this qualifies as a time-series analysis or
linear mixed modeling is ok. The data is unbalanced as not all sites
records for each week. The data are clearly nested so from all I've read

seems to be pointing to lmm. I understand that there will be
between each repeat measure (week) as a butterfly recorded in week 1 
*might* be the same butterfly in week 2, but surely this occurs with all

repeat measures designs?

I'm certain this query must be simple - can anyone clarify what to do?

Any help is truly appreciated.


R-sig-mixed-models at r-project.org mailing list

More information about the R-sig-mixed-models mailing list