## Stata 15 help for mvtest

```
[MV] mvtest -- Multivariate tests

Syntax

mvtest subcommand ... [, ...]

subcommand      Description
-------------------------------------------------------------------------
means           test means
covariances     test covariances
correlations    test correlations
normality       test multivariate normality
-------------------------------------------------------------------------

Description

mvtest performs multivariate tests on means, covariances, and
correlations and tests of univariate, bivariate, and multivariate
normality.  The tests of means, covariances, and correlations assume
multivariate normality (Mardia, Kent, and Bibby 1979).  Both one-sample
and multiple-sample tests are provided.  All multiple-sample tests
provided by mvtest assume independent samples.

Structural equation modeling provides a more general framework for
estimating means, covariances, and correlations and testing for
differences across groups; see [SEM] intro 5 and [SEM] example 16.

Examples

---------------------------------------------------------------------------
Setup
. webuse iris
. keep if iris==1

Show univariate, bivariate, and multivariate tests for normality
. mvtest normality pet* sep*, bivariate univariate stats(all)

---------------------------------------------------------------------------
Setup
. webuse milktruck, clear

Test that the means of the variables are equal
. mvtest means fuel repair capital, equal

Test that the covariance matrix is diagonal
. mvtest covariances fuel repair capital, diagonal

Test that the covariance matrix is block diagonal
. mvtest covariances fuel repair capital, block(fuel repair ||
capital)

Test that the covariance matrix is spherical
. mvtest covariances fuel repair capital, spherical

Test that the covariance matrix is compound symmetric
. mvtest covariances fuel repair capital, compound

Test that the correlation matrix is compound symmetric (that is, that all
correlations are equal)
. mvtest correlations fuel repair capital, compound

---------------------------------------------------------------------------
Setup
. webuse metabolic

Test that the means are equal for the groups, assuming equality of
covariance matrices
. mvtest means y1 y2, by(group)

Test that the means are equal for the first 3 groups, allowing for
heteroskedasticity
. mvtest means y1 y2 if group<4, by(group) heterogeneous

---------------------------------------------------------------------------
Setup
. webuse genderpsych

Test that the covariance matrices are equal for the groups
. mvtest covariances y1 y2 y3 y4, by(gender)

Test that the correlation matrices are equal for the groups
. mvtest correlations y1 y2 y3 y4, by(gender)
---------------------------------------------------------------------------

Reference

Mardia, K. V., J. T. Kent, and J. M. Bibby. 1979.  Multivariate Analysis.