Skip to content

Instantly share code, notes, and snippets.

@jrosen48
Created September 20, 2017 21:25
Show Gist options
  • Save jrosen48/393fa04def3d88274a1773a33dcf2c44 to your computer and use it in GitHub Desktop.
Save jrosen48/393fa04def3d88274a1773a33dcf2c44 to your computer and use it in GitHub Desktop.
extract predicted random effects from a lme4 model
library(magrittr)
library(lme4)
lmer(challenge ~ (1|program_ID) + (1|participant_ID) + (1|beep_ID_new), data = df) %>%
ranef() %>%
extract2("participant_ID") %>%
rownames_to_column(var = "participant_ID") %>%
rename()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment