data(peng)
# Covariance ellipses, centered, first two variables
covEllipses(cbind(bill_length, bill_depth) ~ species, data=peng,
center=TRUE,
fill=c(rep(FALSE,3), TRUE),
fill.alpha=.1, label.pos=c(1:3,0))
# All pairs when more than two variables are specified. They look pretty similar
covEllipses(peng[,3:6], peng$species,
variables=1:4,
fill=c(rep(FALSE,3), TRUE),
fill.alpha=.1)
# Box's M test
peng.boxm <- boxM(cbind(bill_length, bill_depth, flipper_length, body_mass) ~ species, data=peng)
peng.boxm
plot(peng.boxm, gplabel="Species")
# Fit MANOVA model, predicting species
peng.mod0 <-lm(cbind(bill_length, bill_depth, flipper_length, body_mass) ~
species, data=peng)
car::Anova(peng.mod0)
# HE plot
heplot(peng.mod0, fill=TRUE, fill.alpha=0.1,
size="effect",
xlim=c(35,52), ylim=c(14,20))
Run the code above in your browser using DataLab