#import lme4 package and lmerTest package
library(lmerTest)
#import ham data from lmerTest package
data(ham)
m <- lmer(Informed.liking ~ Product*Information*Gender
+ (1|Product:Consumer) , REML=FALSE, data=ham)
#anova table with p-values with Satterthwaite's approximation for denominator
#degrees of freedom
anova(m)
#analysis of random and fixed parts and post hoc
#analysis of Product and Information effects
step(m, reduce.random=FALSE, reduce.fixed=FALSE,
test.effs=c("Product", "Information"))
Run the code above in your browser using DataLab