Multivariate Analysis of Variance

Two or more response variables are sometimes measured in the same experiment. Of course you can analyse each response variable separately, and that is the typical way to proceed. But there are occasions where you want to treat the group of response variables as one multivariate response. The function for this is manova, the multivariate analysis of variance. Note that manova does not support multi-stratum analysis of variance, so the formula must not include an Error term.

data<-read.table("c:\\temp\\manova.txt",header=T)
attach(data)
names(data)

[1] "tear" "gloss" "opacity" "rate" "additive"

First, create a multivariate response variable, Y, by binding together the three separate response variables (tear, gloss and opacity), like this:

Y <- cbind(tear, gloss, opacity)

Then fit the multivariate analysis of variance using the manova function:

model<-manova(Y~rate*additive)

There are two ways to inspect the output. First, as a multivariate analysis of variance:

summary(model)
              Df       Pillai     approx F    num Df    den Df     Pr(>F)
rate           1       0.6181       7.5543         3        14   0.003034   **
additive       1       0.4770       4.2556         3        14   0.024745    *
rate:additive  1       0.2229       1.3385         3        14   0.301782
Residuals     16

This shows significant main effects for both rate and additive, but no interaction. Note that the F tests are based on 3 and 14 degrees of freedom (not 1 and 16). The default method in summary.manova is the Pillai–Bartlett statistic. Other options include Wilks, Hotelling–Lawley and Roy. Second, ...

Get The R Book now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.