Date: Thu, 27 Mar 2008 04:51:08 -0700 Steve Denham "SAS(r) Discussion" Steve Denham Re: Repeated measure in Mixed procedure To: Walid Alali text/plain; charset=us-ascii

Hi Walid,

Looks like a doubly repeated measures design, with both day and replicate as repeated measures. The following (UNTESTED) code should get you started down the right track.

proc mixed data=data; class pen TRT Day animal replicate; model response= TRT Day TRT*Day ; random pen; repeated replicate Day / subject = animal(TRT) type = un@ar(1) r rcorr; lsmeans TRT Day TRT*Day/diff; run;

Note the Kronecker product specification in the type. This assumes that your Day variable are equally spaced (according to your post, once a week).

I hope this helps. I would guess that if you don't do something with replicate, you are going to run into infinite likelihood problems with the repeated statement (multiple obs with identical qualifiers). The big problem with this approach is computing resources--that is going to be one big matrix to have in memory. If it doesn't work, you're probably going to have to fiddle around some with replicate as a random effect somehow. Maybe some of the other PROC MIXED gurus will jump in with a more elegant solution.

Steve Denham Associate Director, Biostatistics MPI Research

----- Original Message ---- From: Walid Alali <walidalali@GMAIL.COM> To: SAS-L@LISTSERV.UGA.EDU Sent: Wednesday, March 26, 2008 3:16:13 PM Subject: Repeated measure in Mixed procedure

Hello all,

I am having trouble finding the best way of including all sources of variability in my mixed model.

My study design (which is a clinical trial) goes like this: I have 3 pens, in each pen; 10 animals (5 exposed and 5 controls). The response (i.e. the outcome) is measured over time (every week for 2 months). To make this complicated, the response was measured in triplicate (i.e. 3 times) at each time point.

Here is a glimpse of the data (just for the 1st pen): Animal TRT DAY Pen Replicate response 151 E 0 5 1 6.75E+03 151 E 0 5 1 6.22E+03 151 E 0 5 1 4.98E+03 152 E 0 5 10 6.25E+03 152 E 0 5 10 8.92E+03 152 E 0 5 10 6.09E+03 153 E 0 5 2 7.38E+03 153 E 0 5 2 4.68E+03 153 E 0 5 2 6.94E+03 154 E 0 5 3 2.49E+03 154 E 0 5 3 2.31E+03 154 E 0 5 3 2.03E+03 155 E 0 5 4 1.32E+04 155 E 0 5 4 9.92E+03 155 E 0 5 4 9.49E+03 156 C 0 5 5 4.22E+03 156 C 0 5 5 4.21E+03 156 C 0 5 5 3.46E+03 157 C 0 5 6 3.70E+03 157 C 0 5 6 3.62E+03 157 C 0 5 6 2.85E+03 158 C 0 5 7 1.54E+03 158 C 0 5 7 1.38E+03 158 C 0 5 7 1.63E+03 159 C 0 5 8 5.16E+03 159 C 0 5 8 5.00E+03 159 C 0 5 8 4.66E+03 160 C 0 5 9 5.37E+03 160 C 0 5 9 5.30E+03 160 C 0 5 9 5.41E+03

I have the model set up like this, but not sure how to include 'replicate' in it??

proc mixed data=data; class pen TRT Day animal; model response= TRT Day TRT*Day ; random pen; repeated Day / subject = animal(TRT) type = un r rcorr; lsmeans TRTcode Day TRTcode*Day/diff; run;