Closed PCK1992 closed 3 years ago
Hi @PCK1992, below is a reference on multilevel models for ego-networks, and you can contact me via email for the code used in the article's examples (which we've been using for some recent workshops). We're trying to incorporate all this in a vignette as soon as possible.
Vacca, R. (2018). Multilevel models for personal networks: Methods and applications. Statistica Applicata - Italian Journal of Applied Statistics, 1, 59–97. https://doi.org/10.26398/IJAS.0030-003
This should work for your example.
alters_egos <- as_alters_df(e1, include.ego.vars = TRUE)
fitintensity <- lmer(income ~ (1 | .egoID), data = alters_egos)
Currently egor
does not provide a method for lme4::lmer()
, but I can look into adding a method for that.
Thank you, this is super helpful! I think in my use case it's really the only functionality that I wish was there. Thank you for your quick responses!
Thank you very much for the feedback @PCK1992 !
My thoughts on adding an lmer.egor()
and glmer.egor()
methods:
That's true, especially if you want to interface it with any package outside of lme4
. I think a vignette should be enough for the most common use cases and this could be then easily extended to other packages (e.g. brms
, etc.).
The package has a lot of great features but I can't quite wrap my head around how to do MLM using the data structure and I couldn't find a reference in the documentation.
This doesn't work and I tried different variations of this formula but perhaps a short example of how to get this to work (or how to work with this package for MLM in general) would be highly appreciated!