[R] lmer() with no intercept

Gabor Grothendieck ggrothendieck at gmail.com
Sat Jun 12 02:34:20 CEST 2010


Try a different example:


set.seed(123)
N <- 24
k <- 6
x <- 1:N
f <- rep(rnorm(k, 0, 4), each = N/k)
e <- rnorm(N)
y <- x + f + e

fac <- gl(k, N/k)
library(lme4)
fm1 <- lmer(y ~ x + (1|fac)); fm1
fm0 <- lmer(y ~ x -1 + (1|fac)); fm0

plot(y, fitted(fm0))
abline(a = 0, b = 1, lty = 2, col = "blue")



More information about the R-help mailing list