(fmLarge <- lmer(Reaction ~ Days + (Days|Subject), sleepstudy))
## removing Day
(fmSmall <- lmer(Reaction ~ 1 + (Days|Subject), sleepstudy))
(KRmodcomp(fmLarge,fmSmall))
## The same test using a restriction matrix
L<-cbind(0,1)
(KRmodcomp(fmLarge,L))
Run the code above in your browser using DataCamp Workspace