Multivariate statistics
Multivariate statistics is the part of Statistics that analyzes several variables measured on the same subjects at the same time.[1] A clinic might record height, weight, blood pressure, and blood sugar for each of a thousand patients. Multivariate methods study how these measurements relate to one another, instead of looking at each one alone.[2]
The field's tools serve four main goals:[1]
- compare groups on many measurements at once
- reduce many variables to a few summary scores
- find natural groups among cases that are not known in advance
- sort new cases into groups that are already known
Many classical tools rest on one object, the covariance matrix, which records how every pair of variables varies together.
Data with many variables
Multivariate data are usually stored as a table with one row for each subject and one column for each variable.[2] With subjects and variables, the table is an data matrix.[3] Each row is a list of numbers, which is treated as one value of a random vector.
The iris flower data set is a classic example. Ronald Fisher's 1936 paper used 50 flowers from each of three iris species, with four measurements per flower: sepal length, sepal width, petal length, and petal width.[4] Its data matrix has rows and columns.
Data with exactly two variables are the subject of bivariate analysis. The full joint behavior of all the variables is described by their joint probability distribution.
Why analyze the variables together
Variables measured on the same subject are usually related, and testing each variable on its own ignores those relations.[5] A test starts from a null hypothesis, the default claim it tries to reject. A result is statistically significant when it would be unlikely, by a chosen cutoff, if the null hypothesis were true.
A multivariate test and a set of one-variable t-tests can reach different conclusions. Sometimes no single t-test is significant while the multivariate test is, and sometimes the reverse happens.[5]
The disagreement remains even when the separate tests use a Bonferroni correction.[5] This correction lowers the cutoff for each test to account for running many tests, a common fix for the multiple comparisons problem.
The figure below illustrates one way that joint and separate views can differ. A point can sit inside the usual range of each variable and still lie far from the data cloud, because it breaks the pattern that links the variables.
Summary statistics
Three summaries describe the center and spread of multivariate data: the mean vector, the covariance matrix, and the correlation matrix.
Mean vector
The sample mean vector lists the average of each variable. For observations it is
Each holds the values of subject (row of the data matrix), written as a column vector.
Subtracting from every observation is called centering, and it moves the center of the data to the origin.[2] The centering matrix does this as a single matrix product.
Covariance and correlation matrices
The Variance of a variable measures how spread out its values are around their mean.[6] Covariance measures how two variables move together. The sample covariance matrix collects every variance and covariance in one table:
Here means transpose. Each term is a column times a row, so it is a matrix. Equivalently, , where is the centered data matrix.[3]
The diagonal of holds the sample variances and the off-diagonal entries hold the covariances.[7] Because is symmetric, it has variances and distinct covariances, so distinct entries in all. For the four iris measurements that is numbers.
The correlation matrix adjusts each covariance to a value without units between and . The sample correlation between variables and is
where and are the sample means.[8] This equals the covariance divided by the product of the two standard deviations.[9] A standard deviation is the square root of a variance.[6]
The correlation is also the covariance of the standardized variables, which are centered and divided by their standard deviations.[2][3] See covariance and correlation for more.
Total and generalized variance
Two single numbers summarize the overall spread in .[10]
- The total variation is the trace of , the sum of its diagonal entries: .
- The generalized variance is the determinant , a single number computed from the whole matrix. It is large when the variables are nearly uncorrelated and small when they are strongly correlated, positively or negatively.
The multivariate normal model
The multivariate normal distribution is the standard model behind classical multivariate tests.[5] It is described by a mean vector and a covariance matrix .
Mahalanobis distance
The Mahalanobis distance measures how far a point is from the center while taking the covariance into account. Its square is
where is the inverse of the covariance matrix.[11] This expression is a quadratic form, and it requires to have an inverse.
When is multivariate normal, follows a chi-squared distribution with degrees of freedom, a number that sets the shape of that distribution.[12] With estimated means and covariances in large samples, the observed distances are close to chi-squared.[12]
This gives two uses.[12] Distances that are too large flag outliers, observations unusually far from the rest of the data. Comparing all the distances with the chi-squared distribution checks whether the data look multivariate normal.
Density
A probability density describes how probability is spread across possible values. The multivariate normal density for a -entry vector is
where is the determinant of .[11]
The density is highest at and falls off as the squared Mahalanobis distance grows.[11]
When all covariances are zero, the density splits into a product of ordinary one-variable normal densities.[11] The variables are then independent, meaning that knowing one gives no information about the others.
Ellipses and eigenvectors
Points with equal density lie on an ellipse (an ellipsoid when ) centered at .[13] The axes of the ellipse point along the eigenvectors of . An eigenvector is a direction that the matrix only stretches or shrinks, so , and the stretch factor is its eigenvalue.[14]
A prediction ellipse is the ellipse expected to contain a share of the data, and the half-length of its axis is
Here is the matching eigenvalue of , and is the value that a chi-squared variable with degrees of freedom exceeds with probability .[13]
The eigenvalues also link back to the summary statistics. Their sum equals the total variation and their product equals the generalized variance.[14]
Main families of methods
Multivariate methods are often split into two kinds.[1]
| Method kind | How it treats variables | Goal |
|---|---|---|
| Dependence | Some variables are outcomes, explained by others | Explain or predict the outcomes |
| Interdependence | All variables are treated alike | Find structure among the variables |
The main tasks fall into these two kinds as follows.
| Goal | Example methods | Kind |
|---|---|---|
| Compare mean vectors of groups | Hotelling's T-squared test, MANOVA | Dependence |
| Sort cases into groups known in advance | Discriminant analysis | Dependence |
| Reduce many variables to a few | Principal component analysis, factor analysis | Interdependence |
| Find groups not known in advance | Cluster analysis | Interdependence |
A further method, canonical correlation analysis, relates two whole sets of variables and is described in its own subsection below.
Comparing groups
Hotelling's T-squared test is the multivariate version of the t-test.[5] It can test the null hypothesis that a population mean vector equals a given vector . Its test statistic, the value computed from the data to test the claim, is
If the data are multivariate normal and the null hypothesis holds, follows an F-distribution with and degrees of freedom.[5] A two-sample version compares the mean vectors of two groups.
Multivariate analysis of variance (MANOVA) extends this to two or more groups, as ANOVA extends the t-test.[5] It splits the total spread into two matrices of sums of squares and cross products.[15] A cross product here is a sum of products of paired deviations from the mean for two variables.
- (error) measures variation within groups.
- (hypothesis) measures variation of the group means around the overall mean.
The null hypothesis of equal mean vectors is rejected when is large relative to . Four test statistics are in common use:[16]
- Wilks' lambda, , which is small when groups differ (see Wilks's lambda distribution)
- the Hotelling-Lawley trace,
- Pillai's trace,
- Roy's largest root, the largest eigenvalue of
Unlike ANOVA, MANOVA has no single most powerful test.[5]
With two groups, all four statistics are equivalent to Hotelling's .[5] Pillai's trace may be less affected than the others when the data are not normal.[5]
Reducing many variables to a few
Principal component analysis (PCA) replaces the original variables with new, uncorrelated variables (variables whose correlation is zero) that capture as much variation as possible.[3] The first principal component is the combination with the largest variance, subject to . Its variance is , and maximizing it leads to the eigenvalue equation
So the weights are eigenvectors of , and each eigenvalue is the variance of its component.[3]
Component explains the share of the total variation.[3]
PCA can also be computed from the singular value decomposition of the centered data matrix.[3]
PCA on depends on the units of measurement. When units differ, analysts usually standardize the variables first, which amounts to PCA on the correlation matrix .[3]
In one study of nine measurements on 88 fossil teeth, the first two components explained 78.8% and 16.7% of the variation.[3] A flat plot of these two components therefore showed the nine-dimensional data well.
Factor analysis is a related method that reduces many observed variables to a few factors.[1] The factors stand for latent variables, quantities that are not measured directly.
The method is widely used in Psychometrics, social science, and market research.[1]
Factor analysis grew from Charles Spearman's 1904 study of mental tests. He explained their correlations by one factor common to all tests plus a specific factor for each.[17] The idea of rotation, used to make components easier to interpret, also comes from factor analysis.[3]
Other methods for finding simpler views of the data include:
- Correspondence analysis, which, like PCA, breaks a matrix into simpler parts.[3]
- Projection pursuit, which searches for low-dimensional views of the data that show structure.[18]
See dimensionality reduction for the wider topic.
Relating two sets of variables
Canonical correlation analysis studies two sets of variables measured on the same subjects.[19] It finds a weighted sum of each set so that the two sums are as highly correlated as possible. Further pairs are found the same way, each uncorrelated with the earlier ones, giving canonical correlations for sets of and variables.[19]
Classifying and clustering
Discriminant analysis builds rules that assign cases to groups defined in advance, using their measured variables.[1] Fisher introduced the linear discriminant function in his 1936 paper.[4]
Cluster analysis looks for groups when none are known in advance.[1] Hierarchical methods show their results as a tree diagram called a dendrogram. Non-hierarchical methods are often called k-means clustering.[1]
Visual displays
- A scatter plot matrix arranges every pairwise scatter plot in a grid, one panel for each pair of variables.[8][20]
- A Biplot shows subjects as points and variables as arrows on one plot, built from the singular value decomposition.[3]
- Parallel coordinates are another way to draw many variables at once.[20]
Beyond the normal model
A copula is a joint distribution function whose one-variable distributions are all uniform on .[21] A uniform distribution has the same probability density everywhere on its interval.
Sklar's theorem (1959) states that any joint distribution function with one-variable distribution functions can be written as
for some copula , which is unique when every is continuous.[21]
When densities exist, the joint density equals the copula density times the product of the one-variable densities.[21]
This split separates the one-variable distributions from the dependence between variables.[21] Copulas play an important role in pricing securities (financial assets such as stocks and bonds) that depend on many others, and understanding them is important in risk management. Coefficients of tail dependence measure dependence in the extremes of the distributions.[21]
High-dimensional data
Data sets with fewer subjects than variables are becoming common, because variables are often easy to measure while repeat observations can be costly.[3] One example from Genomics, the study of an organism's complete set of genes, had samples and variables. This setting is studied by high-dimensional statistics.
The curse of dimensionality
Richard Bellman coined the phrase "curse of dimensionality" for the way the cost of many numerical methods grows exponentially with dimension, that is, by a fixed factor with each added dimension.[18] A statistical version, the "empty space phenomenon", means data become sparse in high dimensions.
For data spread evenly over a 10-dimensional cube with sides from to , only about 1% fall inside the smaller cube with sides from to .[18] To keep the same number of points in such a neighborhood, the sample size must grow exponentially with the dimension.
This is one reason multivariate density estimation is hard.[18] See curse of dimensionality for more.
More variables than subjects
The rank of a matrix is the number of independent directions its rows span. When there are fewer subjects than variables, the number of subjects limits the rank of the centered data matrix.[3] The sample covariance matrix then has some zero eigenvalues and no inverse.
Hotelling's , which needs , can no longer be used when the dimension exceeds the sample size.[22]
Noisy eigenvalues
Even when is smaller than but of a similar size, the eigenvalues of the sample covariance matrix are poor estimates of the true ones.[23] Random matrix theory describes how they spread out.
Suppose the variables are independent and identically distributed, meaning they are independent of one another and all follow the same distribution, and that distribution meets a mild technical condition.[24] Then the eigenvalues of the sample correlation matrix follow the Marchenko-Pastur distribution as grows with for .
The largest and smallest eigenvalues approach and , even though every true eigenvalue equals 1.[24]
Better covariance estimates
Because the sample covariance matrix does poorly in high dimensions, many alternatives have been built, most based on factor models or shrinkage.[25] Factor models explain the observed variables using a smaller number of underlying factors. Shrinkage pulls the sample matrix toward a simple target.
The Ledoit-Wolf shrinkage estimator uses a multiple of the identity matrix (a matrix with 1s on its diagonal and 0s elsewhere) as its target.[26] It is one of the methods covered under estimation of covariance matrices.
History
| Year | Contribution |
|---|---|
| 1901 | Karl Pearson fits lines and planes of closest fit to points, an early form of PCA[3] |
| 1904 | Spearman explains correlations among mental tests by a general factor[17] |
| 1915 | Fisher finds the exact distribution of the sample correlation coefficient[27] |
| 1928 | John Wishart derives the joint distribution of the sample covariance matrix, now the Wishart distribution[27] |
| 1930 | P. C. Mahalanobis defines a distance between populations[27] |
| 1931 | Harold Hotelling derives the distribution of the generalization of Student's t, [27] |
| 1932 | Samuel S. Wilks introduces the lambda statistic[19] |
| 1933 | Hotelling's paper on principal components[3] |
| 1935 to 1936 | Hotelling introduces canonical correlation analysis[19] |
| 1936 | Fisher's paper on discriminant analysis, using the iris data[4] |
| 1958 | T. W. Anderson publishes An Introduction to Multivariate Statistical Analysis[28] |
| 1971 | K. Ruben Gabriel introduces the biplot[3] |
Computers changed how the field is used. PCA was rarely applied to more than trivially small data sets until electronic computers became widely available.[3] The heavy computation long kept many researchers from using multivariate methods, a barrier that statistical software has lowered.[1]
With more computing power, the emphasis of the field has shifted. Fisher's discriminant analysis now sits within supervised machine learning.[4]
Applications
Multivariate methods are used wherever many measurements are taken on each subject.
- Psychometrics, social science, and market research make heavy use of factor analysis and PCA.[1]
- In atmospheric science, PCA is known as empirical orthogonal function analysis. One analysis of winter sea-level pressure used 1008 grid points as variables.[3]
- In genomics, data often have far more variables than samples.[3]
- In Paleontology, the study of fossils and ancient life, PCA of tooth measurements helped separate a group of fossil teeth that may belong to a different animal.[3]
- In biology and medicine, multivariate data often record several clinical and genetic variables for each patient.[2]
References
- Biostatistics Series Module 10: Brief Overview of Multivariate Methods, Indian Journal of Dermatology, 2017.
- Modern Statistics for Modern Biology, Chapter 7: Multivariate Analysis, Susan Holmes and Wolfgang Huber, Cambridge University Press, 2019.
- Principal component analysis: a review and recent developments, I. T. Jolliffe and J. Cadima, Philosophical Transactions of the Royal Society A, 2016.
- Fisher's Pioneering work on Discriminant Analysis and its Impact on AI, K. V. Mardia, arXiv, 2023.
- Hotelling's T² inference and MANOVA (STAT 530 lecture slides), David Hitchcock, University of South Carolina.
- STAT 505 Lesson 1.2: Measures of Dispersion, Penn State Eberly College of Science.
- STAT 505 Lesson 1.4: Example: Descriptive Statistics, Penn State Eberly College of Science.
- Fundamentals of Data Visualization, Chapter 12: Visualizing associations, Claus O. Wilke, O'Reilly Media, 2019.
- STAT 505 Lesson 4.2: The bivariate normal distribution, Penn State Eberly College of Science.
- STAT 505 Lesson 1.5: Total variation and generalized variance, Penn State Eberly College of Science.
- STAT 505 Lesson 4.1: The multivariate normal distribution, Penn State Eberly College of Science.
- STAT 505 Lesson 4.4: Mahalanobis distance and the chi-square distribution, Penn State Eberly College of Science.
- STAT 505 Lesson 4.6: Geometry of the multivariate normal distribution, Penn State Eberly College of Science.
- STAT 505 Lesson 4.5: Eigenvalues and eigenvectors, Penn State Eberly College of Science.
- STAT 505 Lesson 8.2: The MANOVA table, Penn State Eberly College of Science.
- STAT 505 Lesson 8.3: MANOVA test statistics, Penn State Eberly College of Science.
- Charles E. Spearman, Encyclopaedia Britannica.
- Lifting the curse from high-dimensional data: automated projection pursuit clustering for a variety of biological data modalities, GigaScience, 2025.
- canon: Canonical correlations (Stata Multivariate Statistics Reference Manual), StataCorp, 2013.
- Visualization of Multivariate Data (STAT 730 slides), Timothy Hanson, University of South Carolina.
- An Introduction to Copulas, Martin Haugh, Columbia University course notes, 2016.
- Mean Test with Fewer Observation than Dimension and Ratio Unbiased Estimator for Correlation Matrix, arXiv, 2021.
- Spectrum estimation for large dimensional covariance matrices using random matrix theory, Noureddine El Karoui, arXiv, 2006.
- Almost sure convergence of the largest and smallest eigenvalues of high-dimensional sample correlation matrices, arXiv, 2020.
- Cross-validation based Nonlinear Shrinkage, arXiv, 2016.
- Multi-Target Shrinkage, arXiv, 2014.
- R. A. Fisher and Multivariate Analysis, T. W. Anderson, Statistical Science, 1996.
- An Introduction to Multivariate Statistical Analysis, T. W. Anderson, John Wiley & Sons, 1958.
