Skip to content
Prev 14523 / 20628 Next

lmer() fit

This doesn't seem like a big deal.  The following fit takes about 4.5
seconds on my Macbook Pro.

library(lme4)
set.seed(101)
nRE <- 20000
nobs <- 250000
dd <- data.frame(f=sample(1:nRE,size=nobs,replace=TRUE),
                 x=rnorm(nobs))
dd$y <- simulate(~x+(1|f),
         newparams=list(beta=c(1,2),theta=1,sigma=1),
         newdata=dd,
         family=gaussian,
         seed=102)[[1]]
system.time(fit <- lmer(y~x+(1|f),
              data=dd))
fixef(fit)
VarCorr(fit)


   If you have lots of fixed effects or very complex random effects,
things could get a bit slower.  If you have a *much* bigger problem than
this -- or if you're going to want to this sort of thing thousands of
times in a row and 4.5 seconds is too slow -- you might want to talk to
Doug Bates about the MixedModels package for Julia ...
On 16-05-17 02:23 PM, Chaitanya Acharya wrote: