## Multivariate Analysis of Variance

Multivariate Analysis of Variance (MANOVA) tests whether population means on a set of dependent variables are derived from the same underlying population across categorical levels of one or more independent variables. It is used to see main and interaction effects of categorical variables on multiple dependent interval variables.

With equality of population means for dependent groups also means any linear combinations should be equal for all groups - both of these are evaluated in MANOVA. Correlations between depedent variables indicate partial redundance of information and results obtained will pertain to an overlap of concepts to be explained.

### Examples

• Are there morphological differences (brain size, wing length, lung volume, etc.) between males and females in members of bat species x?

#### Uses

• test hypotheses about the relationship of sets of inter-related dependent variables and one or more nominal/ordinal dependent (grouping) variables.
• compare the means of different groups with respect to a set of different measures
• identify a subset of dependent variables contributing to the difference among groups

### Assumptions

• multivariate normality
• homogeneity of variance/covariances across treatment groups: test assumption with Box's M test
• sensitive to outliers
• Univariate F-tests are based on a ratio of hypothesis MS over error MS. In multivariate designs there is no single term for hypothesis or error mean squares but rather matrices representing these. These matrices are combined into a test statistic using a variety of approaches: Pillai's trace, Wilk's lambda, Hotelling's trace, Roy's largest root - these can be transformed into an aproximate F-distribution
• ANOVA on sums of the variables vs. MANOVA
• Mahalinobis Distance: for univariate scenario: square of the standard normal deviate, in multivariate system measures how far a multivariate point is from the multivariate mean (centroid). Plotted for each case, this allows us to spot outliers in many dimensions concurrently
• Interpretation of MANOVA results - After obtaining a significant multivariate test for a particular main effect or interaction, examine the univariate F tests for each variable to help in interpreting the respective effects
• Equivalent to Discriminant Function Analysis derive a new variate as a linear combinations of the original dependent variables that results in the greatest difference among the group means on the variates.
• Then determine the significance of the difference in the variate group means using one of several multivariate statistics based on λ (i.e., eigenvalues associated with the canonical discriminant functions):
• Pillai's Trace: V = Σ(λi) / (1 + λi )
• Wilks' Lambda: Λ = P (1) / (1 + λi )
• Hotelling's T: Τ = Σλi
• Roy's Greatest Root: Ρ = (λmax)
• Eigenvalue: measures the ability of a canonical axis to discriminate between the experimental groups. The larger the eigenvalue, the larger the group differences on the variate.

### How this is done

Univariate F-Tests obtain the ratio of variance explained by the model over the error variance. In multivariate Analysis of variance these single variance terms are replaced by a Model Variance-Covariance Matrix over an Error Variance Covariance Matrix.

In R you first need to import datafile "BodyMeasures.txt", define n to represent the sample size, and group your response variables into a set using cbind.

> n<-length(bodyMeasures\$Sex)

Perform a MANOVA, report Pillai's trace, and include univariate tests on each measure

> fit_manova <- manova(Ys ~ Sex, data = bodyMeasures)
> summary(fit_manova)
> summary.aov(fit_manova)

Obtain the Matrix of error sums of squares and crossproducts (E) and the Matrix of model sums of squares and crossproducts (H) and report them

> E <- (n-1)*cov(fit_manova\$residuals)
> E
> H <- (n-1)*cov(fit_manova\$fitted.values)
> H

You can obtain for the Eigenvalues after solving H for E and the Eigenvectors via lda (which requires library MASS).

> roots <- eigen(H%*%solve(E))
> roots\$values
> library(MASS)
> fit_lda <- lda(bodyMeasures\$Ys,bodyMeasures\$Sex)
> fit_lda

You can get a canonical centroid plot of this ananlysis using procedure cca (which requires library vegan).

> install.packages("vegan")
> library(vegan)
> cca.1 <- cca(bodyMeasures[,-1] ~ bodyMeasures\$Sex)
> cca1.plot <- plot(cca.1)