Thanks for responding, Joshua.

I did not specify a distribution since I want to use a default distribution
(normal).

To describe my study, I conducted an experiment with randomized complete
block design and twice (trial).  I would like to investigate treatment
effect (trt) and use correct error term for that.  In SAS, the code seems
working and correct, although I am not quite sure.  Also, I want to see how
I can run the SAS code in R and compare it with SAS resutls.

Thanks again,

Steve Hong

On Mon, Jun 25, 2012 at 10:04 AM, Joshua Wiley <jwiley.psych@gmail.com>wrote:

> Hi Steve,
>
> That SAS code looks a little strange to me (I feel like it is missing
> a distribution and some options on the random line).  It would
> probably help if you could also describe in words what you are doing
> or trying to do.
>
> a rough pass at it would be:
>
> glmer(y ~ trt + (trt | block) + (trt | trial), data = df, family =
> "binomial")
>
> That will fit a logistic model, with a random intercept and trt effect
> by block and by trial.  If they are nested, that is fine.  If they are
> cross classified, that is fine too.  The random intercept and trt
> effect will be correlated by default.
>
> Cheers,
>
> Josh
>
> On Mon, Jun 25, 2012 at 7:50 AM, Steve Hong <emptican@gmail.com> wrote:
> > Dear all,
> >
> > Can anyone help me convert SAS code to R in lme or lmer, especially in
> > random statement part?
> >
> > Here is SAS code:
> > proc glimmix data=df;
> > class trial block trt;
> > model y=trt;
> > random trial block(trial) trt(block*trial);
> >
> > Thanks in advance,
> >
> > Steve
> >
> >        [[alternative HTML version deleted]]
> >
> > _______________________________________________
> > R-sig-mixed-models@r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>
>
>
> --
> Joshua Wiley
> Ph.D. Student, Health Psychology
> Programmer Analyst II, Statistical Consulting Group
> University of California, Los Angeles
> https://joshuawiley.com/
>

	[[alternative HTML version deleted]]

