[R] mixed model fitting between R and SAS

array chip arrayprofile at yahoo.com
Mon Aug 8 08:48:21 CEST 2011


Hi al,

I have a dataset (see attached), which basically involves 4 treatments for a chemotherapy drug. Samples were taken from 2 biopsy locations, and biopsy were taken at 2 time points. So each subject has 4 data points (from 2 biopsy locations and 2 time points). The objective is to study treatment difference. 

I used lme to fit a mixed model that uses "biopsy.site nested within pid" as a random term, and used corAR1() as the correlation structure for between the 2 time points:


library(nlme)

test<-read.table("test.txt",sep='\t',header=T,row.names=1)
fit<-lme(y~age + time * trt, random=~1|pid/biopsy.site, data = test, correlation=corAR1())

First, by above model specification, corAR1() is used for the correlation between the 2 time points; what is the correlation structure implicitly used for between biopsy locations? How do I specify a particular correlation structure for between biopsy locations in this situation?

Second, does anyone know how to write the above mixed model in SAS? One of my colleagues wrote the following, but it gave me different results:

proc mixed data=test;

class time trt pid biopsysite;
model y=age time trt time*trt;
random biopsysite
repeated pid / type=ar(1)
run;

Is there anyone familiar with SAS and know if the above SAS code does what the R code does?

Many thanks

John
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: test.txt
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20110807/f9e1ff72/attachment.txt>


More information about the R-help mailing list