Stephan Moratti
2006-May-30 10:48 UTC
[R] multiple comparisons of time series data (Stephan Moratti)
To account for the strong serial correlation you could try the lme() function of the nlme package. There you can apply different covariance structures in your linear model such as a first-order autoregressive covariance structure (AR1). example: model.fit <- lme(response ~ condition * time, data = time.series.data, random=~1|case, correlation = corCAR1()); This model uses an autoregressive process for continous data. The random expression defines the intercept for each case (or observation, subject) as a random factor. Condition and time would be fixed factors in this case. See also help(lme) and help(corClasses). Hopes that helps, Stephan Stephan Moratti, PhD Centro de Magnetoencefalografía Dr. Perez Modrego Faculdad de Medicina Universidad Complutense de Madrid Pabellón 8 Avda. Complutense, s/n 28040 Madrid Spain email: moratti@med.ucm.es Tel.: +34 91 394 2292 Fax.: +34 91 394 2294 [[alternative HTML version deleted]]