[R] lmer: how to lmer with no intercept

Douglas Bates bates at stat.wisc.edu
Wed Dec 30 00:31:57 CET 2009


On Tue, Dec 29, 2009 at 11:46 AM, Julia7 <liujulia7 at yahoo.com> wrote:
>
> Hello,
>
> How do I fit a mixed effect model with no intercept using lmer()?
> Is the following syntax correct?

> lmer(y ~ -1+x1+x2+(-1+x1+x2|id), data=dt)

Yes.  An alternative, which I prefer, is

lmer(y ~ 0 + x1 + x2 + (0 + x1 + x2|id), dt)




More information about the R-help mailing list