Skip to main content
added 249 characters in body; edited tags
Source Link

I am trying to learn brms package for multilevel modeling. A reproducible code is as below:

library(MCMCglmm)
library(nlme)
library(lme4)
library(brms) 

data(MathAchieve,package='nlme')
data(MathAchSchool,package='nlme')
dat=merge(MathAchSchool,MathAchieve,by='School')
str(dat)

set.seed(23429989)
m1=brm(MathAch~1+(1|School),dat)
m2=lmer(MathAch~1+(1|School),dat)

system.time(lmer(MathAch~1+(1|School),dat))
   user  system elapsed 
  0.054   0.002   0.056 

system.time(brm(MathAch~1+(1|School),dat))
   user  system elapsed 
124.646   5.787 143.627 

While the model seems run properly, it runs much slower than a frequentist MLM model (e.g., using lmer()) even for an intercept-only model. What did I miss? Thank you very much.

I am trying to learn brms package for multilevel modeling. A reproducible code is as below:

library(MCMCglmm)
library(nlme)
library(brms)
data(MathAchieve,package='nlme')
data(MathAchSchool,package='nlme')
dat=merge(MathAchSchool,MathAchieve,by='School')
str(dat)

set.seed(23429989)
m1=brm(MathAch~1+(1|School),dat)

While the model seems run properly, it runs much slower than a frequentist MLM model (e.g., using lmer()) even for an intercept-only model. What did I miss? Thank you very much.

I am trying to learn brms package for multilevel modeling. A reproducible code is as below:

library(MCMCglmm)
library(nlme)
library(lme4)
library(brms) 

data(MathAchieve,package='nlme')
data(MathAchSchool,package='nlme')
dat=merge(MathAchSchool,MathAchieve,by='School')
str(dat)

set.seed(23429989)
m1=brm(MathAch~1+(1|School),dat)
m2=lmer(MathAch~1+(1|School),dat)

system.time(lmer(MathAch~1+(1|School),dat))
   user  system elapsed 
  0.054   0.002   0.056 

system.time(brm(MathAch~1+(1|School),dat))
   user  system elapsed 
124.646   5.787 143.627 

While the model seems run properly, it runs much slower than a frequentist MLM model (e.g., using lmer()) even for an intercept-only model. What did I miss? Thank you very much.

edited title
Link

brms intercept only model runruns very slow

Source Link

brms intercept only model run very slow

I am trying to learn brms package for multilevel modeling. A reproducible code is as below:

library(MCMCglmm)
library(nlme)
library(brms)
data(MathAchieve,package='nlme')
data(MathAchSchool,package='nlme')
dat=merge(MathAchSchool,MathAchieve,by='School')
str(dat)

set.seed(23429989)
m1=brm(MathAch~1+(1|School),dat)

While the model seems run properly, it runs much slower than a frequentist MLM model (e.g., using lmer()) even for an intercept-only model. What did I miss? Thank you very much.