## Lab Exercise for R: Multivariate Analysis of Variance

### Exercise 1: Bind a set of dependent variables into a matrix

In a dataset with multiple continuous variables we calculate the multivariate distance of individuals. The original axes are used to derive new linear combinations based on the correlational structure of variables.

 Use file "BodyMeasures.txt", and group the dependent variables in columns 2:12 into a dataframe and convert into a matrix. > bodyMeasures <- read.table("http://caspar.bgsu.edu/~courses/stats/Labs/Datasets/BodyMeasures.txt", header=T) > Ys <- as.matrix(bodyMeasures[2:12])

### Exercise 2: Run a one-way MANOVA

Run a MANOVA model and report the results

 Now run a MANOVA on the dependent matrix and sex as indedenpent variable and report the results from the fit > manFit <- manova(Ys ~ bodyMeasures\$Sex) > manFit > summary.aov(manFit) # to report all the univariate results > summary(manFit) # to report the multivariate results > summary(manFit, test="Wilks") # ANOVA table of Wilks' lambda > summary(manFit, test="Roy") > summary(manFit, test="Pillai") > summary(manFit, test="Hotelling-Lawley")