#import lme4 package and lmerTest package
library(lmerTest)
#import carrots data from lmerTest package
data(carrots)
#lmer model with correlation between intercept and slopes
#in the random part
m <- lmer(Preference ~ sens2+Homesize+(1+sens2|Consumer), data=carrots)
# table with p-values for the random effects
rand(m)
Run the code above in your browser using DataLab