[R] lmer: how to lmer with no intercept

2009-12-29 Thread Julia7

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)

Thanks,
Julia


-- 
View this message in context: 
http://n4.nabble.com/lmer-how-to-lmer-with-no-intercept-tp990493p990493.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] lmer: how to lmer with no intercept

2009-12-29 Thread Douglas Bates
On Tue, Dec 29, 2009 at 11:46 AM, Julia7 liujul...@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)

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.