Following on from Thierry's reply, I've been wondering about the same thing.  I am trying to run a model with a patient visiting on different dates and taking measurements at various points during the day (let's assume ar(1) structure).  A subset of the data is below.  It seemed to me that applying the code Thierry gave to the previous example
lme(y~age + time * trt, random=~0  + biopsy.site|pid, data = test,  correlation=corAR1(~time))
should lead to  lme(y~x+run, random=~1|date, data=ee1, correlation=corAR1(~run)) in my simpler one ... but this doesn't seem to run unless the correlation structure exactly matches the random term and I keep getting 'Error in abs(value) : non-numeric argument to function'.

Instead, lme(y~x+run, random=~1|date, data=ee1, correlation=corAR1(, ~1|date)) works, but I'm not convinced it's estimating a between subject random effect as I would like as tapply(ee1$y, ee1$date, mean) makes clear.

Sorry for asking what must be a silly question - any pointers would be great,

Paul

1   10/06/2011 12:09   1    91 24.24  5.99
2   10/06/2011 12:20   2    91 24.73  6.27
3   10/06/2011 12:30   3    96 24.87  7.25
4   10/06/2011 12:42   4    85 25.12  7.36
5   10/06/2011 12:47   5   101 25.24  7.09
6   10/06/2011 12:51   6    86 25.38  7.15
7   10/06/2011 12:56   7    89 25.42  6.89
41  21/06/2011 12:46   1    91 25.56 12.00
42  21/06/2011 12:50   2    91 25.66 11.90
43  21/06/2011 12:55   3    87 25.76 11.90
44  21/06/2011 13:01   4    91 25.75 12.00
45  21/06/2011 13:05   5    85 25.81 11.80
46  21/06/2011 13:10   6    85 25.92 11.40
47  21/06/2011 13:15   7    90 25.89 10.90
91  29/06/2011 12:45   1    89 24.22  8.13
92  29/06/2011 12:50   2    89 24.23  7.54
93  29/06/2011 12:54   3    84 24.28  8.34
94  29/06/2011 12:59   4    81 24.43  8.14
95  29/06/2011 13:04   5    84 24.38  8.16
96  29/06/2011 13:10   6    83 24.41  8.85
97  29/06/2011 13:15   7    81 24.55  8.31
141 12/07/2011 12:53   1    81 25.59 11.10
142 12/07/2011 12:59   2    81 25.76 11.20
143 12/07/2011 13:03   3    76 26.01 11.00
144 12/07/2011 13:09   4    80 26.00 11.50
145 12/07/2011 13:14   5    72 26.12 11.50
146 12/07/2011 13:19   6    72 26.28 11.20
147 12/07/2011 13:24   7    79 26.30 11.10

	[[alternative HTML version deleted]]


