Created
August 11, 2014 12:38
-
-
Save JoFrhwld/e4c71e4c145db9acab47 to your computer and use it in GitHub Desktop.
my bootMer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(lme4) | |
mod <- lmer(F1_n ~ plt_vclass * Decade_c * freq_c + (plt_vclass + freq_c| File) + (Decade_c|word), | |
data = ays_to_test) | |
boot_fun <- function(mod){ | |
# x is a named vector | |
x <- fixef(mod) | |
#out is a longer named vector | |
out <- c(x, | |
ay0_freq = x["freq_c"] + x["plt_vclassay0:freq_c"], | |
ay0_freq_slope = x["Decade_c:freq_c"] + x["plt_vclassay0:Decade_c:freq_c"]) | |
return(out) | |
} | |
mod_boot <- bootMer(mod, boot_fun, use.u = T, | |
type = "semiparametric", | |
verbose = T, | |
nsim = 1000) | |
# Saving the results so I don't need to do it all over again, | |
# every time I recompile my paper | |
saveRDS(mod_boot, "mod_boot.rds") | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment