An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-mixed-models/attachments/20080117/82c12897/attachment.pl>
Random slopes without random intercepts
3 messages · Nick Isaac, Nathaniel Smith, Ken Beath
On Thu, Jan 17, 2008 at 11:11:31AM +0000, Nick Isaac wrote:
Basically, I want to explore the full volume of parameter space for my dataset. There's only one fixed effect, but several levels of random variation. I can fit all combinations of random intercept and random slope models as: 1) lmer( y ~ x + (1|A) ...) 2) lmer(y ~ x + (x|A) ...) The logical way to remove the random intercept is to remove "A" from formula 2. But then lmer wouldn't know which level at which to fit the random slopes. I tried "A-1" and "(A-1)" but both returned errors.
You want (x-1|A), or (x+0|A) -- the two are identical to each other. (The trick is that in R, formulas are generally assumed to contain an intercept term by default. The intercept term is named "1", so if you write y ~ x, it's assumed you mean y ~ 1 + x. You can override this by explicitly subtracting the 1 off again, or by explicitly putting in a 0, either way. The same applies to the specification of random effect terms.) -- Nathaniel
Electrons find their paths in subtle ways.
On 17/01/2008, at 10:25 PM, Nathaniel Smith wrote:
On Thu, Jan 17, 2008 at 11:11:31AM +0000, Nick Isaac wrote:
Basically, I want to explore the full volume of parameter space for my dataset. There's only one fixed effect, but several levels of random variation. I can fit all combinations of random intercept and random slope models as: 1) lmer( y ~ x + (1|A) ...) 2) lmer(y ~ x + (x|A) ...) The logical way to remove the random intercept is to remove "A" from formula 2. But then lmer wouldn't know which level at which to fit the random slopes. I tried "A-1" and "(A-1)" but both returned errors.
You want (x-1|A), or (x+0|A) -- the two are identical to each other.
It is very unusual to find data requiring a random slope but no random intercept, as it requires that all lines pass through the same point on the y axis. Ken