4
$\begingroup$

Just chasing a text/resource for learning hierarchical modelling in (and) R. I have extensive experience using Matlab and Stata but very limited R experience.

Any recommendations? Happy to purchase material if necessary.

Thanks.

$\endgroup$
4
$\begingroup$

If you just want a practical guide to fitting mixed models / multilevel models, then the link provided by Mark White is a very good one:

https://rpsychologist.com/r-guide-longitudinal-lme-lmer

However, if you seek to understand the theory, then I would highly recommend looking at mixed models - of which multilevel models can be thought of as a sub-type, then I would suggest the following:

Demidenko, E. (2013). Mixed models: theory and applications with R. John Wiley & Sons.

Bates, D. M. (2010). lme4: Mixed-effects modeling with R.

Bates, D., Mächler, M., Bolker, B., & Walker, S. (2014). Fitting linear mixed-effects models using lme4. arXiv preprint arXiv:1406.5823.

The latter two are both available for free on the internet.

| cite | improve this answer | |
$\endgroup$
1
$\begingroup$

My favorite is: https://rpsychologist.com/r-guide-longitudinal-lme-lmer. He shows both commonly-used packages, and he includes the equations alongside the code—so you can easily reference back to books from there.

| cite | improve this answer | |
$\endgroup$
0
$\begingroup$

Take a look at these:

GLMM FAQ Ben Bolker and others: https://bbolker.github.io/mixedmodels-misc/glmmFAQ.html

nlme package: https://cran.r-project.org/web/packages/nlme/nlme.pdf, which allows non- linear mixed models and correlations structures

glmmTMB: https://cran.r-project.org/web/packages/glmmTMB/glmmTMB.pdf

Enjoy!

| cite | improve this answer | |
$\endgroup$
0
$\begingroup$

I built R a package recently on Bayesian network modeling.

In the package description page you'll find varies examples of hierarchical models, their CPDs, graphical models structures, learning/inference algorithms and the corresponding R code.

| cite | improve this answer | |
$\endgroup$
  • $\begingroup$ could you give the name of the package in case your link dies in the future? Thanks! $\endgroup$ – Antoine Apr 14 at 19:27
  • $\begingroup$ the name is bbricks, you can install it by install.packages("bbricks") $\endgroup$ – A Random Guy Apr 22 at 8:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.