Statistics: manova1

### Function Reference: `manova1`

statistics: d = manova1 (x, group)
statistics: d = manova1 (x, group, alpha)
statistics: [d, p] = manova1 (…)
statistics: [d, p, stats] = manova1 (…)

One-way multivariate analysis of variance (MANOVA).

`d = manova1 (x, group, alpha)` performs a one-way MANOVA for comparing the mean vectors of two or more groups of multivariate data.

x is a matrix with each row representing a multivariate observation, and each column representing a variable.

group is a numeric vector, string array, or cell array of strings with the same number of rows as x. x values are in the same group if they correspond to the same value of GROUP.

alpha is the scalar significance level and is 0.05 by default.

d is an estimate of the dimension of the group means. It is the smallest dimension such that a test of the hypothesis that the means lie on a space of that dimension is not rejected. If d = 0 for example, we cannot reject the hypothesis that the means are the same. If d = 1, we reject the hypothesis that the means are the same but we cannot reject the hypothesis that they lie on a line.

`[d, p] = manova1 (…)` returns P, a vector of p-values for testing the null hypothesis that the mean vectors of the groups lie on various dimensions. P(1) is the p-value for a test of dimension 0, P(2) for dimension 1, etc.

`[d, p, stats] = manova1 (…)` returns a STATS structure with the following fields:

| "W" | within-group sum of squares and products matrix
| "B" | between-group sum of squares and products matrix
| "T" | total sum of squares and products matrix
| "dfW" | degrees of freedom for WSSP matrix
| "dfB" | degrees of freedom for BSSP matrix
| "dfT" | degrees of freedom for TSSP matrix
| "lambda" | value of Wilk’s lambda (the test statistic)
| "chisq" | transformation of lambda to a chi-square distribution
| "chisqdf" | degrees of freedom for chisq
| "eigenval" | eigenvalues of (WSSP^-1) * BSSP
| "eigenvec" | eigenvectors of (WSSP^-1) * BSSP; these are the coefficients for canonical variables, and they are scaled so the within-group variance of C is 1
| "canon" | canonical variables, equal to XC*eigenvec, where XC is X with columns centered by subtracting their means
| "mdist" | Mahalanobis distance from each point to its group mean
| "gmdist" | Mahalanobis distances between each pair of group means
| "gnames" | Group names

The canonical variables C have the property that C(:,1) is the linear combination of the x columns that has the maximum separation between groups, C(:,2) has the maximum separation subject to it being orthogonal to C(:,1), and so on.

Source Code: manova1

### Example: 1

     load carbig
     [d,p] = manova1([MPG, Acceleration, Weight, Displacement], Origin)

    d = 3
    p =

            0
       0.0000
       0.0075
       0.1934