Dear Wolfgang,

Thanks for your response.

This was an agonizing ordeal to say the least, but the inclusion of a
"consecutive" integer time value seemed to have made the difference in my
case, the results are replicating.  The only reasoning that I can come up
with now is due to missing repeated measurement for some of the subjects,
had we left it to just ... correlation = corSymm(form = ~ 1 | SUBJECT)...,
the package risks mixing up the order in the covariance matrix in different
subjects, the specification of weights= varIdent(form = ~ 1 | TIME) is not
enough.   (e.g. assign TIME 5 measurements to TIME 1 if TIME 5 is the very
first recording of the Subject j).   Correct me if you think I am wrong
because I would assume that the package would handle this.

I will make some test on this later on.

Thank you for your help,

Tony


On Thu, Jan 16, 2014 at 12:14 AM, Viechtbauer Wolfgang (STAT) <
wolfgang.viechtbauer@maastrichtuniversity.nl> wrote:

> It's been a while since I used SAS for mixed-effects model, but I think
> the model:
>
> PROC MIXED data=Comb method=reml;
>   CLASS FAC1 TIME SUBJECT FAC2;
>   MODEL RESPONSE = BIAS FAC2 FAC1 TIME TIME*FAC1 / ddfm=Residual solution;
>   REPEATED TIME / subject=SUBJECT type=un;
> RUN;
>
> can be fit with gls() using:
>
> gls(RESPONSE ~ BIAS + factor(FAC2) + factor(TIME)* factor(FAC1),
> correlation = corSymm(form = ~ TIME | SUBJECT), weights = varIdent(form = ~
> 1 | TIME), data=Comb)
>
> TIME needs to be integer valued. SUBJECT should be a factor. ddfm=Residual
> implies that the fixed effects are tested with t-tests using df = n-rank(X)
> (where X is the model matrix), while gls() uses the normal distribution to
> compute those p-values. But this is a minor issue, except in those pesky
> borderline cases, but then again neither that t-distribution nor that
> normal distribution is exactly right and one should withhold judgement
> anyway.
>
> It would be nice if you could provide feedback whether the syntax above
> did the trick.
>
> Best,
> Wolfgang
>
> --
> Wolfgang Viechtbauer, Ph.D., Statistician
> Department of Psychiatry and Psychology
> School for Mental Health and Neuroscience
> Faculty of Health, Medicine, and Life Sciences
> Maastricht University, P.O. Box 616 (VIJV1)
> 6200 MD Maastricht, The Netherlands
> +31 (43) 388-4170 | http://www.wvbauer.com
>
>
> > -----Original Message-----
> > From: r-sig-mixed-models-bounces@r-project.org [mailto:
> r-sig-mixed-models-
> > bounces@r-project.org] On Behalf Of Charles Determan Jr
> > Sent: Wednesday, January 15, 2014 21:27
> > To: Tony K.-T.
> > Cc: r-sig-mixed-models@r-project.org
> > Subject: Re: [R-sig-ME] Replicating SAS results in R with unstructured
> > covariance matrix
> >
> > Hi Tony,
> >
> > Unfortunately I never did solve this problem.  I experimented endlessly
> > with all sorts of combinations of correlation structures available with
> > lme.  Unless someone reads this will a wonderful solution to replicate
> the
> > unstructure structure analysis from SAS I can't help.  The compound
> > symmetry correlation structure was the only that really matched up well.
> > I'm sorry I couldn't be more help.  I ended up moving on to using other
> > multivariate analyses like PLSDA and Random Forest because of the
> > seemingly
> > incompatible analyses.  I wanted to make sure anyone could replicate my
> > analysis independent of the statistical program.  I poke at it
> > occasionally
> > but still nothing for the unstructured analysis.  If I ever do I will be
> > sure to post it.
> >
> > Wish you the best in you analysis,
> > Charles
> >
> >
> > On Wed, Jan 15, 2014 at 1:44 PM, Tony K.-T. <tkamth@gmail.com> wrote:
> >
> > > Dear Charles,
> > >
> > > I have seen your post regarding replicating the results of SAS (Proc
> > > Mixed) using unstructured covariance matrix using R nlme package (gls).
> > >  Have you been able to solve this problem?
> > >
> > > I am also in the process of doing so on a repeated measures dataset to
> > no
> > > success (not converging identically, estimates are off), if you can
> > spare
> > > some thoughts on this it'll be really great.
> > >
> > > The model that I am trying to replicate from SAS to R.
> > >
> > > PROC MIXED data=Comb method=reml;
> > >   CLASS FAC1 TIME SUBJECT FAC2;
> > >   MODEL RESPONSE = BIAS FAC2 FAC1 TIME TIME*FAC1 / ddfm=Residual
> > solution;
> > >   REPEATED  TIME/ subject=SUBJECT type=un;
> > > RUN;
> > >
> > > Cheers,
> > >
> > > --
> > > Tony Kam-Thong, Dr.-Ing.
> > > tel.:+41 78 604 5172
> > > e-mail:tkamth@gmail.com
> > >
> >
> >
> >
> > --
> > Charles Determan
> > Integrated Biosciences PhD Candidate
> > University of Minnesota
> >
> >       [[alternative HTML version deleted]]
> >
> > _______________________________________________
> > R-sig-mixed-models@r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>



-- 
Tony Kam-Thong, Dr.-Ing.
tel.:+41 78 604 5172
e-mail:tkamth@gmail.com

	[[alternative HTML version deleted]]

