if (FALSE) {
#Perform a MANOVA of the AbaloneIdt data set, comparing the Abalone variable means
# according to their age
# Create an Interval-Data object containing the Length, Diameter, Height, Whole weight,
# Shucked weight, Viscera weight (VW), and Shell weight (SeW) of 4177 Abalones,
# aggregated by sex and age.
# Note: The original micro-data (imported UCI Machine Learning Repository Abalone dataset)
# is given in the AbaDF data frame, and the corresponding values of the sex by age combinations
# is represented by the AbUnits factor.
AbaloneIdt <- AgrMcDt(AbaDF,AbUnits)
# Create a factor with three levels (Young, Adult and Old) for Abalones with respectively
# less than 10 rings, between 11 and 18 rings, and more than 18 rings.
Agestrg <- substring(rownames(AbaloneIdt),first=3)
AbalClass <- factor(ifelse(Agestrg=="1-3"|Agestrg=="4-6"| Agestrg=="7-9","Young",
ifelse(Agestrg=="10-12"|Agestrg=="13-15"| Agestrg=="16-18","Adult","Old") ) )
#Perform a classical MANOVA, computing the p-value from the asymptotic Chi-squared distribution
# of the Wilk's lambda statistic
MANOVAres <- MANOVA(AbaloneIdt,AbalClass)
summary(MANOVAres)
#Find a finite sample p-value of the test statistic, using a permutation test.
MANOVAPermTest(MANOVAres,AbaloneIdt,AbalClass)
}
Run the code above in your browser using DataLab