The goal of boots.lmer
is to first, generate bootstrap samples for longitudinal data, and second, to fit linear mixed effects model on the bootstrap samples to make inference about the estimated effects of covariates.
You can install the development version of boots.lmer from GitHub with:
# install.packages("devtools")
devtools::install_github("UofUEpiBio/PHS7045-midterm")
This is a basic example which shows you how to solve a common problem:
library(boots.lmer)
#> Loading required package: data.table
## basic example code
data(example.dat) #read in the data
output<-boots_samples(dat=example.dat,sub.id = "subjects",B=4) #create 4 bootstrap samples
lmer.out<-boots_lmer(y="Y", X=c("X1","X2","X3"), dat=example.dat, boots.samples.list = output) #fit LMER models
##Print the summary
summary(lmer.out)
##Boxplot of the estimated coefficients
plot(lmer.out)
The slurmR example Rmd file can be found in the inst/slurmR folder, titled "slurmR_example.html"