# Re: [R] lme - Random Effects Struture

From: harry wills <harry.wills_at_gmail.com>
Date: Thu 29 Jun 2006 - 04:46:07 EST

Hi Rick,
Thanks a lot for pointing out the mistake. I changed it and now the results match perfectly !

Harry

On 6/28/06, Rick Bilonick <rab45+@pitt.edu> wrote:
>
> On Wed, 2006-06-28 at 11:04 -0400, harry wills wrote:
> > Thanks for the help Dimitris,
> >
> > However I still have a question, this time I'll be more specific,
> >
> > the following is my SAS code
> >
> >
> >
> > proc mixed data=Reg;
> > class ID;
> > model y=Time Time*x1 Time*x2 Time*x3 /S;
> > random intercept Time /S type=UN subject=ID G GCORR V;
> > repeated /subject = ID R RCORR;
> > run; **
> >
> > (Type =UN for random effects)
> >
> >
> >
> > The eqivalent lme statement I am using is :
> >
> > reglme <- lme(y ~ Time+Time*x1+Time*x2+Time*x3, data=Reg, random = ~
> Time |
> > ID)
> >
> >
> >
> > When I compare the results, the values differ by considerable margin; I
> > suppose this is due to the Random effects covariance structure. R output
> > tells me that the structure is
> >
> >
> >
> > "Structure: General positive-definite, Log-Cholesky parametrization"
> >
> >
> >
> > Hence the problem for me is how to control this structure in R. Any help
> > would appreciated
> >
> > Thanks
> >
> > Harry
>
> >From my understanding of SAS, a*b means the interaction of a and b. But
> in R, a*b is shorthand for a + b + a:b where a:b is the interaction
> term. The way you've written the lme formula, you have time showing up 4
> times plus you have additional main effects x1, x2, and x3. Is this what
> you want? Maybe I'm wrong but I don't think the SAS code and the R code
> represent the same model.
>
> Rick B.
>
>

--
Wills, Harry

[[alternative HTML version deleted]]

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help