Skip to main content
1 of 2
BenP
  • 1.9k
  • 1
  • 7
  • 15

You could use glm in combination with the corCAR1 correlation structure from the nlme package in R. This is for continuous data. Although this is not exactly an answer to your question, because you do not have/need a random effect in gls models.

To answer your question, you could use a random linear (or quadratic,cubic, ...) slope of "week". With a random linear slope, you e.g. model a quadratic pattern in the variances over the weeks. And also a particular pattern for the correlations between any pair of weeks you select. E.g. Singer and Willet show the formula's in their book Applied Longitudinal Data Analysis: Modeling Change and Event Occurrence.

BenP
  • 1.9k
  • 1
  • 7
  • 15