# Load candies data
data(candies)
# Basic PC-ANOVA model with two factors, cross-validated opt. of #components
mod <- pcanova(assessment ~ candy + assessor, data = candies)
print(mod)
# PC-ANOVA model with interaction, minimum 90% explained variance
mod <- pcanova(assessment ~ candy * assessor, data = candies, ncomp = 0.9)
print(mod)
summary(mod)
# Tukey group letters for 'candy' per component
lapply(mod$models, function(x)
mixlm::cld(mixlm::simple.glht(x,
effect = "candy")))
# Result plotting
loadingplot(mod, scatter=TRUE, labels="names")
scoreplot(mod)
# Mixed Model PC-ANOVA, random assessor
mod.mix <- pcanova(assessment ~ candy + r(assessor), data=candies, ncomp = 0.9)
scoreplot(mod.mix)
# Fixed effects
summary(mod.mix)
Run the code above in your browser using DataLab