Chapter 19 · Many variables, validation and pitfalls

What if there are many outcomes or many variables?

MANOVA, discriminant analysis, cluster analysis, principal components and factor analysis.

Read first: Correlation and regression

The problem first

You are an MD Anaesthesiology resident. Your thesis compares saline, esmolol and lignocaine given before laryngoscopy, 10 patients in each group. You record the rise in heart rate and the rise in mean arterial pressure (MAP). You run one ANOVA for each outcome: p = 0.23 and p = 0.11. You write that the three drugs do not differ.

Your guide looks at the scatter plot and points out that the lignocaine patients sit apart from the others. At the pre-submission seminar, the statistician asks one question.

“Your two outcomes rise and fall together. Why did you test them one at a time?”

Start here

Multivariate or multivariable: which word describes your analysis?

Strictly, a multivariate analysis has two or more outcome (dependent) variables. A model with one outcome and several predictors is multivariable. Many papers use the first word when they mean the second.

Multivariableseveral predictors, one outcomeAgeDiabetesSmokingBMIWoundinfectionMultivariatetwo or more outcomes, analysed togetherDruggroupHeart rateriseMAPrisecorrelated
Hidalgo and Goodman reviewed one year of the American Journal of Public Health. Of 30 articles that described a “multivariate” analysis, 25 (83%) had in fact used multivariable models, most often logistic regression. The same distinction is discussed in the correlation and regression chapter.

In exam questions and textbooks, “multivariate analysis” is also used as a heading for all methods that handle many variables at once, including those with no outcome variable at all, such as cluster analysis and factor analysis. This chapter covers that whole group. When you write your own methods section, use “multivariable” for one outcome with several predictors, and name the actual method.

Two types of question

Which questions do multivariate methods answer?

Start by asking whether your variables fall into two sets, explanatory and outcome, or form one set in which you look for structure.

Two sets of variablesexplanatory variables and outcome variablesMANOVA (and Hotelling's T²)Discriminant analysisCanonical correlationPath analysis and SEMPartial least squares regressionOne set, no outcome variablelooking for structure in the dataCluster analysisPrincipal component analysisFactor analysisCluster analysis works on patients.PCA and factor analysis work on variables.
The left-hand methods relate one set of variables to another. The right-hand methods have no outcome variable: they look for groups of patients or for a smaller number of underlying variables.
Your questionMethodExample in this chapter
Do groups differ on several correlated outcomes?MANOVAHeart rate and MAP rise with three drugs
How closely is one set of measurements related to another set?Canonical correlationBody size and sleep study results
Can measurements sort patients into known groups?Discriminant analysisIron deficiency or thalassaemia trait from MCV and red cell count
Are there patient groups nobody has defined?Cluster analysisSubgroups of type 2 diabetes from BMI and HbA1c
Can many correlated variables be replaced by a few?Principal component analysisWaist and hip replaced by one score
Do hidden factors explain why items correlate?Factor analysisAn 8-item fatigue and mood questionnaire
Does a variable act through another variable?Path analysis, structural equation modellingDepression, adherence and HbA1c
How to predict an outcome from more predictors than patients?Partial least squares regressioneGFR from 60 serum proteins in 30 patients

Sample size

How many patients do you need for the number of variables?

Every multivariate method estimates how each variable relates to every other variable. The number of those relationships grows much faster than the number of variables.

  • The count grows quickly. With p variables, the covariance matrix contains p(p + 1) ÷ 2 separate values to estimate: 36 for 8 variables and 1,830 for 60 variables.
  • Fewer patients than variables makes some methods impossible. With n patients, a sample covariance matrix has rank of at most n − 1. In the PLS teaching example below, 60 protein levels in 30 patients give a covariance matrix of rank 29, so it cannot be inverted. MANOVA, discriminant analysis and ordinary least squares regression all need that inverse. PLS regression and PCA do not.
  • MANOVA and discriminant analysis: the within-group matrix W can be inverted only when the number of patients minus the number of groups is at least the number of variables. Having only just enough patients gives very unstable results.
  • Factor analysis: MacCallum and colleagues showed that the idea of one minimum sample size, or one minimum ratio of patients to variables, is a misconception. The number needed depends on the communalities of the variables and on how many variables measure each factor. Nieser and colleagues, whose paper appears later in this chapter, quote a simulation result that for “moderate loadings (0.50), 2 or 3 factors, and 8 or more indicators, a sample size of 150–200 yields minimal bias”.
  • Logistic and Cox models are limited by the number of events per predictor. See the correlation and regression chapter.

Choose the variables from the clinical question before the study. Selecting them because they were significant one at a time ignores the correlation between them, which is the reason for using a multivariate method.

Several outcomes

Several correlated outcomes in three groups: why not run one ANOVA per outcome?

Two problems. Each separate test has its own 5% false-positive rate, so the chance of at least one false positive rises. And separate tests ignore the correlation between the outcomes, which can hide a real difference.

001010202030304040rise in heart rate (beats/min)rise in MAP (mmHg)lignocaine: lower MAP risefor the same heart rate riseSalineEsmololLignocaine
Teaching data from the problem at the top of this chapter (made-up numbers). In every group, patients with a large heart rate rise also have a large MAP rise (pooled within-group correlation 0.74). Lignocaine patients have a MAP rise that is lower than their heart rate rise would predict. Neither axis on its own shows this clearly.

What MANOVA does

Multivariate analysis of variance (MANOVA) compares the groups on all the outcomes at once. ANOVA splits the total sum of squares into a part between groups and a part within groups. MANOVA does the same with matrices that also hold the sums of cross-products, so the correlation between outcomes is included. With two groups, MANOVA is Hotelling's T², the multivariate form of the t-test.

Wilks' λ = |W| ÷ |T|

W
within-group matrix: sums of squares and cross-products of each patient around the group mean
T
total matrix: the same, around the overall mean
|W|, |T|
determinants, a single number summarising the spread in all the outcomes together
λ
the share of the total spread that is not explained by the groups. 1 = no group difference, towards 0 = large difference

Worked example: rise in heart rate and MAP with three drugs

Group (n = 10 each)Heart rate rise, mean (SD)MAP rise, mean (SD)
Saline23.7 (11.38)21.8 (7.90)
Esmolol18.0 (4.50)19.8 (5.43)
Lignocaine23.1 (6.12)15.1 (7.53)
  1. Separate one-way ANOVAs: heart rate F(2, 27) = 1.57, p = 0.226. MAP F(2, 27) = 2.39, p = 0.111.
  2. Within-group matrix W = [1685.0 1115.3 ; 1115.3 1338.1], determinant 1,010,804.4.
  3. Total matrix T = [1881.2 1086.8 ; 1086.8 1574.7], determinant 1,781,191.4.
  4. Wilks' λ = 1,010,804.4 ÷ 1,781,191.4 = 0.5675.
  5. With two outcomes the conversion to F is exact: F = [(1 − √λ) ÷ √λ] × [(N − g − 1) ÷ (g − 1)] = (0.2467 ÷ 0.7533) × (26 ÷ 2) = 4.26, with 4 and 52 degrees of freedom.
  6. p = 0.0047. Pillai's trace gives the same conclusion: 0.458, F(4, 54) = 4.01, p = 0.0064.

The drugs differ when both outcomes are considered together, although neither ANOVA reached 5%. The chance of at least one false positive in two separate tests at 5% would be 1 − 0.95² = 9.75% if the tests were independent.

The four test statistics and the assumptions

  • IBM SPSS reports Pillai's trace, Wilks' lambda, Hotelling's trace and Roy's largest root, each with an approximate F.
  • R's summary.manova() uses Pillai's trace by default. Its documentation notes that Wilks' statistic is the most popular in the literature and that the Pillai–Bartlett statistic is recommended by Hand and Taylor (1987).
  • In a simulation study by Ateş and colleagues (2019), no statistic was best in every situation, and all four were affected when the covariance matrices differed or the data were not normal, particularly with unequal group sizes.
  • Assumptions listed by IBM SPSS: the data are a random sample of vectors from a multivariate normal population, and the variance-covariance matrices are the same in all cells. Box's M tests the equality of the covariance matrices.
  • After a significant MANOVA, SPSS runs post hoc tests for each outcome separately. Say in advance which follow-up analyses you will do.

Interactive

Change the correlation between two outcomes and watch the MANOVA p-value

The separate t-tests do not use the correlation between the outcomes. MANOVA does, so the same group differences can give very different MANOVA results.

Try this: keep 20 patients per group and a correlation of 0.5, then switch the second difference to "opposite direction". The separate t-tests do not change. Watch the MANOVA p-value fall from 0.211 to 0.013.

Teaching example with made-up groups. Outcome 1 is the rise in heart rate and outcome 2 the rise in mean arterial pressure after laryngoscopy, both in SD units. Group A differs from group B by 0.5 SD on each outcome.

20

More patients → smaller p-values for every test

0.5

Inside each group: do patients with a high heart rate rise also have a high MAP rise?

Difference on outcome 2

Same: group A is higher on both outcomes. Opposite: higher on outcome 1, lower on outcome 2.

0.211MANOVA p-value, both outcomes together (Wilks' λ = 0.919, F(2, 37) = 1.62)
0.122separate t-test p-value for each outcome (t = 1.58, df 38)

Neither the separate tests (p = 0.122 for each) nor the MANOVA (p = 0.211) reach the 5% level. The difference between the groups runs along the direction in which patients already vary together, so the second outcome adds little new information.

-3-3-2-2-1-100112233outcome 1: rise in heart rate (SD units)outcome 2: rise in MAPgroup Agroup Bdifference between the group centresEach ellipse holds about 2 in 3 patientsof that group.separate t-tests: p = 0.122MANOVA: p = 0.211

Two sets of measurements

How strongly is one set of measurements related to another set?

Pearson r relates one measurement to one other. Canonical correlation relates a whole set to a whole set, by first combining each set into a weighted sum.

BMIWaistNeckUweighted sumAHIODILowest SpO₂Vweighted sumr = 0.58Strongest single pair (BMI with ODI): r = 0.54.The first canonical correlation is never smaller than the strongest single pair.
Teaching example with made-up data from 60 adults referred for a sleep study. The weights for U and V are chosen to make their correlation as large as possible. That largest correlation is the first canonical correlation. A second pair of weighted sums, uncorrelated with the first, gives the second canonical correlation, and so on.
  • First canonical correlation: 0.58. The second and third are 0.20 and 0.03.
  • Test that all canonical correlations are zero: Wilks' λ = 0.636, F = 2.99 with 9 numerator degrees of freedom, p = 0.003.
  • Reading it: the combination of body size measurements is moderately related to the combination of sleep study results. The weights show which variables contribute most to each combination, but they can be unstable when the variables within a set are strongly correlated with each other.
  • Use: mainly exploratory, when both sets have several variables and neither is a single outcome. If one set is really a single outcome, the method becomes multiple regression and the canonical correlation becomes the multiple correlation R.

Known groups

Can a set of measurements sort patients into groups that are already known?

Discriminant analysis starts from patients whose group is known. It finds the weighted sum of the measurements that separates the groups best, then uses that score to classify new patients.

556065707580853.54.55.56.5MCV (fL)red cell count (×10¹²/L)D = 0iron deficiencythalassaemia traitDiscriminant score D for each patientcircled: misclassified-4-2024cut-off 0filled dots above the axis: iron deficiency · open dots below: thalassaemia trait
Teaching example: 25 made-up patients with iron deficiency anaemia (IDA) and 25 with beta-thalassaemia trait (BTT), each confirmed by iron studies and HbA2. Each measurement on its own overlaps between the groups. The discriminant function combines them into one score D, and the line D = 0 separates the two clouds.

The discriminant function

D = b₀ + b₁x₁ + b₂x₂ + … + bₚxₚ

The weights make the ratio of between-group to within-group variation in D as large as possible. With g groups there are at most g − 1 functions. With two groups there is one.

D = −1.455 + 0.1613 × MCV − 1.9456 × red cell count

  1. Group means: IDA MCV 72.96 fL, red cell count 4.45 × 10¹²/L. BTT MCV 63.68 fL, red cell count 5.38 × 10¹²/L.
  2. Mean score (centroid): IDA +1.646, BTT −1.646. With equal group sizes and equal prior probabilities the cut-off is halfway, at 0.
  3. A patient with MCV 66 fL and red cell count 5.0 × 10¹²/L: D = −1.455 + 10.646 − 9.728 = −0.54. Below 0, so classified as thalassaemia trait.
  4. Standardised coefficients: MCV 0.75, red cell count −0.81. Both contribute, in opposite directions. Wilks' λ = 0.262.
Classification table
Actual groupClassified IDAClassified BTTCorrect
Iron deficiency (25)23292%
Thalassaemia trait (25)025100%
Overall (50)48 of 50, 96%
  • Classification table: actual group against predicted group. IBM SPSS calls it the summary table and notes it is sometimes called the confusion matrix.
  • Leave-one-out classification: each patient is classified by a function built from all the other patients. Here it also gave 96%. Accuracy in the same patients used to build the function is not a test on new patients.
  • Prior probabilities: SPSS offers “All groups equal” or “Compute from group sizes”. If thalassaemia trait is rarer than iron deficiency in your clinic, equal priors will over-call it.
  • Assumptions listed by IBM SPSS: cases are independent, predictors have a multivariate normal distribution, and the within-group variance-covariance matrices are equal across groups. Box's M tests the last one and is sensitive to departures from multivariate normality.

Comparison

Discriminant analysis or logistic regression?

Both can predict group membership from several measurements. They differ in their assumptions and in what they report.

FeatureLinear discriminant analysisLogistic regression
QuestionWhich known group does this patient belong to?What is the probability of the outcome, and how do the odds change with each predictor?
Assumptions about predictorsMultivariate normal, with equal covariance matrices in the groupsMakes fewer assumptions about the data (Shayan et al., 2015)
Categorical predictorsConflict with the assumption of multivariate normal predictorsEntered as dummy variables
Main outputDiscriminant function, group centroids, classification tableCoefficients as odds ratios with 95% CIs
Three or more groupsUp to g − 1 functions in one analysisMultinomial or ordinal logistic regression
Teaching exampleAccuracy 96%, leave-one-out 96%, AUC 0.992Accuracy 96%, leave-one-out 96%, AUC 0.997

In some clinical comparisons the two methods gave similar accuracy. Ebrahimzadeh and colleagues found similar accuracy for predicting unwanted pregnancy and recommended logistic regression when the interpretability of the results matters. Choose before you see the results, from the type of predictors and the question.

Unknown groups

Can the data find patient groups that nobody defined in advance?

Cluster analysis puts patients who are close to each other in the measured variables into the same group. There is no outcome variable and no known group label.

Step 1: measure how far apart two patients are

distance = √[(z₁ᵢ − z₁ⱼ)² + (z₂ᵢ − z₂ⱼ)² + …]

This is the Euclidean distance between patients i and j. Standardise each variable first (z = (x − mean) ÷ SD). IBM SPSS advises standardising when variables have large differences in scale, because BMI in the 20s and HbA1c in single figures would otherwise count unequally.

Step 2a: hierarchical clustering and the dendrogram

Hierarchical agglomerative clustering starts with every patient as a separate cluster and joins the two closest clusters, step by step, until only one is left. The linkage method decides the distance between two clusters: nearest neighbour (single linkage), furthest neighbour (complete linkage), between-groups average, centroid, or Ward's method, which joins the pair of clusters that increases the within-cluster sum of squares least.

02468height at which clusters joincut here: 3 clusters641911188112717132320314241622151591022Cluster 1: low BMI,high HbA1c (22.9, 11.1)Cluster 2: high BMI(32.6, 8.0)Cluster 3: middle BMI,low HbA1c (26.5, 6.6)
Teaching example: 24 made-up patients with newly diagnosed type 2 diabetes, clustered by Ward's method on standardised BMI and HbA1c. Each vertical line is a patient, and each horizontal bar a join. The last two joins happen far higher than all the others, so the tree is cut below them. Numbers under the cluster names are mean BMI (kg/m²) and HbA1c (%).

Step 2b: k-means

  1. Choose k, the number of clusters.
  2. Pick k starting centres, for example k patients at random.
  3. Assign every patient to the nearest centre.
  4. Move each centre to the mean of its patients.
  5. Repeat steps 3 and 4 until no patient changes cluster.

The result can depend on the starting centres. The documentation of R's kmeans() says that trying several random starts (nstart > 1) is often recommended.

Step 3: how many clusters?

Within-cluster sum of squares02040123456bend at k = 3number of clusters, kAverage silhouette width0.6220.6730.6440.5550.496number of clusters, k
Same 24 patients, k-means with 100 random starts for each k. Left: the within-cluster sum of squares always falls as k rises. Look for the point where it stops falling steeply (the elbow). Right: the average silhouette width compares each patient's distance to its own cluster with its distance to the nearest other cluster. The documentation of R's cluster package advises choosing the k with the largest average silhouette width.
  • Silhouette width of a patient: close to 1, well inside its cluster. Around 0, between two clusters. Negative, probably in the wrong cluster.
  • Cluster profiles: describe each cluster by the means of the variables. The names (“high BMI”) come from the researcher, not from the software.
  • Differences between clusters are built in. IBM SPSS notes that the F tests in its k-means ANOVA table are only descriptive and their probabilities should not be interpreted, because the procedure forms groups that differ.
  • k-means assumes k is right. IBM SPSS warns that if you choose an inappropriate number of clusters or omit important variables, the results may be misleading.
  • Check before you believe the clusters: whether the data have any tendency to form clusters, and whether the clusters are stable when the data are resampled. The INSPIRED study in the “In a real paper” section did both.

Interactive

Step through k-means and watch the clusters and centres change

Each press shows one step: patients join the nearest centre, then the centres move to the mean of their patients.

Try this: with k = 3, press "Next step" until k-means converges. Then press "New random start" a few times and compare the final sum of squares with the lowest value found from 100 starts. Some starts end in a worse split.

Teaching example: 24 made-up patients with newly diagnosed type 2 diabetes. Distances are calculated on standardised BMI and HbA1c (z-scores), so that neither variable dominates because of its units. The plot shows the original units.

Number of clusters, k

You must choose k before k-means starts.

Steps

Random start number 1

Step 0 of 5. Start: 3 patients chosen at random become the first centres. No patient is assigned yet.

n/atotal within-cluster sum of squares (standardised units)

cluster sizes: not assigned yet · lowest value found from 100 random starts for k = 3: 4.568

1822263034385791113BMI (kg/m²)HbA1c (%)centrecluster 1cluster 2cluster 3

Cluster symbols: cluster 1 filled circle, cluster 2 square, cluster 3 triangle. Grey rings: patients not yet assigned.

Comparison

Hierarchical clustering or k-means?

FeatureHierarchical clusteringk-means
Number of clustersNot needed in advance. Decide where to cut the dendrogramMust be specified before the analysis
How it worksStarts with each patient alone and joins the closest clusters until one is leftAssigns patients to the nearest centre and moves the centres, repeatedly
Types of variable (IBM SPSS)Quantitative, binary or count dataInterval or ratio variables. For binary or count data SPSS points to hierarchical clustering
Number of patientsWorks from the distances between every pair of patientsIBM SPSS describes its algorithm as able to handle large numbers of cases
Main outputDendrogram, agglomeration scheduleCluster centres and membership
InstabilityTied distances can make the result depend on the order of casesThe result can depend on the random starting centres

Many correlated variables

Can many correlated measurements be replaced by a few?

If two measurements rise and fall together, one well-chosen weighted sum can keep most of the information in both. Principal component analysis (PCA) finds these sums.

The idea with two variables

Waist and hip circumference in 40 made-up adults: correlation 0.78. Draw any line through the middle of the scatter and project each patient onto it. The spread of the projected positions is the variance kept by that line. The first principal component (PC1) is the line that keeps the most variance. PC2 is at right angles to it and keeps what is left. Jolliffe and Cadima describe PCA as creating new uncorrelated variables that successively maximise variance, found by solving an eigenvalue problem.

The formula and the worked example

Covariance matrix (cm²): variance of waist 105.2, variance of hip 40.9, covariance 51.1. Total variance 146.1.

eigenvalues λ = (s₁₁ + s₂₂) ÷ 2 ± √[((s₁₁ − s₂₂) ÷ 2)² + s₁₂²]

  1. (105.2 + 40.9) ÷ 2 = 73.0, and √[32.2² + 51.1²] = 60.4.
  2. λ₁ = 133.5 cm², λ₂ = 12.6 cm². The eigenvalues add up to the total variance.
  3. Variance explained: PC1 133.5 ÷ 146.1 = 91.4%, PC2 8.6%.
  4. Loadings (eigenvector weights) of PC1: 0.875 for waist, 0.483 for hip. PC1 score = 0.875 × (waist − 92.6) + 0.483 × (hip − 101.05).

With more variables: the scree plot

With p variables there are p components. Plot the eigenvalues in order. Components before the point where the curve flattens carry most of the variance. The scree plot below comes from the 8-item questionnaire used in the factor analysis example: the first two components explain 41.8% and 18.9% of the variance.

012312345678factor numbereigenvalueeigenvalue 1random data (95th percentile)3.341.51the flat tail is the scree
Scree plot of the questionnaire correlation matrix (made-up data, 240 patients). The eigenvalue-greater-than-1 rule keeps components with eigenvalue above 1. Parallel analysis keeps those above the eigenvalues of random data of the same size (dashed red line, 95th percentile of 500 random data sets). Both give 2 here. IBM SPSS describes the scree as the gradual trailing of the small factors after a distinct break.
  • Covariance or correlation matrix: PCA on the covariance matrix lets variables with large variances dominate. IBM SPSS describes the correlation matrix as useful when variables are measured on different scales. In R, prcomp() does not scale by default (scale. = FALSE).
  • Uses: reducing many correlated variables before another analysis, building a single index, showing patients on a two-dimensional plot, dietary patterns.
  • Limits: components are weighted sums chosen for variance, not for clinical meaning, and PCA only captures straight-line relationships.

Interactive

Turn a line through the waist and hip data and watch the variance it keeps

PCA searches all directions for the one along which patients are most spread out. Here you do the search by hand.

Try this: move the line from 0° towards 30° and watch the share of the variance along it rise. Then press "Line along PC1": no other angle gives a larger share.

Teaching example: waist and hip circumference in 40 made-up adults. Each red dot is a patient's position along your line, the score you would keep if you replaced the two measurements with one number.

0.0°

0° follows waist only, 90° follows hip only

Jump to
72.0%of the total variance lies along your line (105.2 of 146.1 cm²)

PC1 lies at 28.9° and keeps 91.4% (133.5 cm²). PC2, at 118.9°, keeps 8.6% (12.6 cm²).

7080901001108090100110120waist (cm)hip (cm)Positions along your line (cm)-30-1501530Variance along the line (cm²)105.2PC1: 133.5PC2: 12.6Total variance 146.1 cm²= waist 105.2 + hip 40.9

Hidden factors

Are the items of a questionnaire driven by a few hidden factors?

Fatigue and low mood cannot be measured directly. A questionnaire measures them through items. Factor analysis asks how many hidden (latent) factors are needed to explain the correlations between the items, and which items belong to each factor.

Exploratory or confirmatory

FeatureExploratory factor analysis (EFA)Confirmatory factor analysis (CFA)
WhenEarly in developing a scale, when the structure is not knownWhen earlier studies have proposed a structure
What you specifyOnly the items. The data suggest the number of factors and which items load on eachThe factors and which items load on which factor, before analysing the data
What it tells youA possible structure to name and refineHow well the data fit the proposed model
Usual softwareSPSS Factor, jamovi Exploratory Factor Analysis, R psych::fa()R lavaan::cfa(), jamovi Confirmatory Factor Analysis

Tavakol and Wetzel describe CFA as a theory-driven approach that tests how well the data fit a proposed model, in which the researcher must identify the factor model before analysing the data.

The steps of an exploratory factor analysis, with the worked example

Teaching example: 8 items scored 0 to 10 by 240 made-up patients after discharge. Items 1–4 describe tiredness, items 5–8 mood.

  1. Are the items correlated enough? The Kaiser-Meyer-Olkin (KMO) measure of sampling adequacy compares the correlations with the partial correlations: KMO = 0.82. The psych package documentation quotes Kaiser's labels: above 0.9 marvelous, 0.80s meritorious, 0.70s middling, 0.60s mediocre, 0.50s miserable, below 0.5 unacceptable. Bartlett's test of sphericity tests whether the correlation matrix is an identity matrix (all correlations zero): χ² = 561.3, df 28, p < 0.001.
  2. How many factors? Two eigenvalues are above 1 (3.34 and 1.51), and parallel analysis also gives 2 (see the scree plot above). jamovi uses parallel analysis as its default rule.
  3. Extract the factors. IBM SPSS offers principal components, unweighted least squares, generalized least squares, maximum likelihood, principal axis factoring, alpha factoring and image factoring. This example uses minimum residual, the default in jamovi and in R's psych package.
  4. Rotate. Turning the factor axes does not change how well the factors explain the correlations, but it can make each item load clearly on one factor. Varimax is an orthogonal rotation (factors stay uncorrelated). Direct oblimin and promax are oblique rotations (factors may correlate). For oblique rotations SPSS displays the pattern, structure and factor correlation matrices.
  5. Name the factors from the items with large loadings, here factor 1 “physical fatigue” and factor 2 “low mood”.
Varimax-rotated loadings
ItemFactor 1 (fatigue)Factor 2 (mood)Communality
1. Tired on waking0.790.120.64
2. Need rest after a short walk0.690.170.50
3. Legs feel heavy0.680.170.50
4. Low energy through the day0.600.260.42
5. Feel sad0.190.710.54
6. Lost interest in usual activities0.170.690.51
7. Feel hopeless0.060.630.40
8. Sleep poorly0.260.530.34
  • Loading: Tavakol and Wetzel describe it as the correlation between the item and the factor. That reading holds for uncorrelated factors such as these.
  • Communality: the sum of an item's squared loadings, the share of its variance explained by the factors. Item 1: 0.79² + 0.12² = 0.64.
  • Variance explained: factor 1 2.06 (25.7%), factor 2 1.79 (22.3%), together 48.0% of the variance of the 8 items. Before rotation the split was 35.4% and 12.6%, with the same total.
  • Oblique solution: with oblimin the two factors correlate 0.43. Tavakol and Wetzel note that most constructs in social science research are assumed to be inter-related and should use an oblique rotation.

Interactive

Rotate the factor axes and watch the loadings table simplify

Rotation does not change the fit. It changes how the same solution is described, so that each item loads mainly on one factor.

Try this: start with the unrotated loadings, where 4 of the 8 items load 0.40 or more on both factors. Press "Varimax" and count again. Then move the angle slider yourself and watch the varimax criterion on the right.

Teaching example: 8 questionnaire items scored 0 to 10 by 240 made-up patients after discharge. Two factors extracted by minimum residual. Bold loadings are 0.40 or more in absolute value.

Solution

Varimax keeps the factors uncorrelated. Oblimin lets them correlate.

0°

An orthogonal rotation: the two axes stay at right angles

4 of 8items load 0.40 or more on exactly one factor (unrotated solution)

4 items load 0.40 or more on both factors and 0 on neither. Varimax criterion at this angle: 0.0254. The largest value, 0.3648, is at -40.7°. The communality of each item does not change with an orthogonal rotation.

Factor loadings for the current solution
ItemFactor 1Factor 2Communality
1. Tired on waking0.67-0.430.64
2. Need rest after a short walk0.63-0.320.50
3. Legs feel heavy0.63-0.320.50
4. Low energy through the day0.62-0.200.42
5. Feel sad0.610.410.54
6. Lost interest in usual activities0.580.420.51
7. Feel hopeless0.460.430.40
8. Sleep poorly0.540.230.34
-1-1-0.5-0.5000.50.511Factor 1 (horizontal)Factor 2 (vertical)shaded: both loadings below 0.4012345678Varimax criterion by angle-90°-45°0°45°90°00.20.4varimax -40.7°angle of the factor axes

Comparison

Principal component analysis or factor analysis: what is the difference?

The two are often run from the same menu and give similar-looking tables, but they answer different questions.

Principal componentsItem 1Item 2Item 3Item 4Componentweighted sumthe items make the componentFactor analysisHiddenfactorItem 1uItem 2uItem 3uItem 4uthe factor causes the items; u = unique part
The direction of the arrows is the difference. A component is built from the items. A factor is a hidden variable assumed to cause the items, and each item also has a unique part that the factor does not explain.
FeaturePrincipal component analysisFactor analysis
AimReduce many variables to a few scoresFind hidden constructs that explain the correlations
ModelComponent = weighted sum of the variablesEach variable = loadings × factors + a unique part
Variance analysedTotal variance of the variablesCommon (shared) variance, separated from unique variance
LoadingsTend to be larger, because unique and error variance are included (Tavakol and Wetzel)Reflect only what the items share
Number of solutionsOne set of components, unless rotatedDepends on extraction and rotation method
Typical useAn index, a dietary pattern score, data reduction before regressionDeveloping and validating questionnaires and scales

Tavakol and Wetzel note that PCA is often applied and described, in error, as exploratory factor analysis. If your aim is to measure a latent construct, use factor analysis with maximum likelihood or principal axis factoring.

Paths and hidden variables

Can you test a diagram of causes that includes hidden variables?

Ordinary regression gives each predictor's effect adjusted for the others. Path analysis goes further: you draw which variable affects which, and the analysis estimates every arrow, including effects that pass through another variable.

DepressionPHQ-9 scoreAdherence% of doses takenHbA1ca = −0.46b = −0.36direct path c′ = 0.13indirect effect a × b = 0.168 · total effect c = c′ + a × b = 0.125 + 0.168 = 0.293
Teaching example with made-up data from 200 patients with type 2 diabetes. All paths are standardised regression coefficients. Depression lowers adherence (a), lower adherence raises HbA1c (b), and a small direct path remains (c′).

Worked example: a simple path analysis

  1. Regress adherence on depression: a = −0.46 (p < 0.001).
  2. Regress HbA1c on adherence and depression together: b = −0.36 (p < 0.001), direct effect c′ = 0.13 (p = 0.084).
  3. Regress HbA1c on depression alone: total effect c = 0.29.
  4. Indirect effect through adherence = a × b = (−0.463) × (−0.363) = 0.168. Check: c = c′ + a × b = 0.125 + 0.168 = 0.293. About 57% of the total effect passes through adherence.
  5. Bootstrap 95% confidence interval for the indirect effect (2,000 resamples): 0.10 to 0.24. It excludes 0.

From path analysis to structural equation modelling (SEM)

  • Beran and Violato describe SEM as a set of techniques that analyse the relationships of observed and latent variables while accounting for measurement error.
  • SEM has two parts. The measurement model links each latent variable to the measured items that reflect it, as in confirmatory factor analysis. The structural model gives the relationships among the latent variables.
  • In path analysis, as in the example above, every variable is measured directly.
  • Fit is judged with indices such as the comparative fit index (CFI), the Tucker-Lewis index (TLI) and the root mean square error of approximation (RMSEA). jamovi's confirmatory factor analysis reports these three by default. Beran and Violato cite CFI of 0.90 or more and RMSEA below 0.05 as adequate. Whichever cut-offs you use, state them and cite their source.
  • A model that fits well is consistent with the data, not proof that the arrows point the right way. Other diagrams can fit equally well. Draw the model from clinical knowledge and the study design before analysing.

More variables than patients

What does partial least squares regression add when predictors outnumber patients?

The correlation and regression chapter introduces PLS regression. Here is how it works, how the number of components is chosen, and why the error in the fitting data cannot be trusted.

PLS regression builds a few components from the predictors, like PCA, but chooses them to predict the outcome. IBM SPSS describes PLS as particularly useful when predictor variables are highly correlated or when the number of predictors exceeds the number of cases, and says it first extracts latent factors that explain as much of the covariance as possible between the independent and dependent variables. See the basic introduction and the PLS diagram in the correlation and regression chapter.

The algorithm, one component at a time (PLS1, one outcome)

  1. Standardise every predictor and centre the outcome.
  2. Give each predictor a weight proportional to its covariance with the outcome. The first component is the weighted sum of the predictors.
  3. Regress the outcome on this component.
  4. Remove from the predictors and from the outcome the part explained by the component.
  5. Repeat on what is left to get the second component, which is uncorrelated with the first, and so on.
  6. Choose the number of components by cross-validation, then predict the outcome from those components.

Worked example: eGFR from 60 serum proteins in 30 patients

Made-up teaching data. The 60 protein levels are strongly correlated. Their covariance matrix has rank 29, so ordinary regression cannot be fitted. PLS models with 1 to 10 components were checked by leave-one-out cross-validation: each patient is predicted by a model built from the other 29.

024612345678910number of PLS componentsprediction error, RMSE (mL/min/1.73 m²)lowest: 3 componentsnew patientspatients used to fit the model
The error in the patients used to fit the model always falls as components are added: with 10 components it is almost zero. The cross-validated error, which estimates the error in new patients, is lowest at 3 components and rises after that. That rise is overfitting.
  • Chosen model: 3 components. Cross-validated RMSE 3.25 mL/min/1.73 m² (SD of eGFR 13.25), cross-validated Q² = 0.94. R² in the fitting data 0.97.
  • Why not PCA first? With one component, principal component regression had a cross-validated RMSE of 7.91, against 3.56 for PLS, because the first principal component was not chosen to predict eGFR.
  • Variable importance in projection (VIP): IBM SPSS produces VIP scores by default, a summary of how much each predictor contributes to the components.
  • PLS-DA: for a yes/no outcome, PLS-discriminant analysis uses PLS regression with a binary dummy outcome. It is commonly used in metabolomics, and Szymańska and colleagues list double cross-validation and permutation testing among the approaches used to validate it.
  • Limits: components mix many predictors, so the model is better for prediction than for explaining the effect of one variable. Cross-validation inside one data set is not external validation.

Decide

Which multivariate method fits your question?

Answer the questions in order. Each answer links to its section.

What do you want to find out?

Which multivariate method: all possible answers
  • MANOVA: Tests all the outcomes together in one test. With two groups it is Hotelling's T². Report Pillai's trace or Wilks' lambda with F and p.
  • Linear discriminant analysis: Builds a weighted score that separates the groups. Report the function, the classification table and a leave-one-out accuracy.
  • Logistic regression: Makes fewer assumptions about the predictors and gives odds ratios. Use multinomial logistic regression for more than two groups.
  • k-means cluster analysis: Standardise the variables, run many random starts, and check k with the silhouette width and the stability of the clusters.
  • Hierarchical cluster analysis: Joins the closest patients step by step. Read the dendrogram to decide where to cut it into clusters.
  • Principal component analysis: Weighted sums of the variables, ordered by the variance they keep. Report the variance explained and the loadings.
  • Exploratory factor analysis: Check KMO and Bartlett's test, decide the number of factors, extract, rotate and name the factors from their loadings.
  • Confirmatory factor analysis: Specify which items load on which factor before you look at the data, then test how well the model fits.
  • Canonical correlation: The correlation between the best weighted sum of one set and the best weighted sum of the other set.
  • Path analysis or structural equation modelling: Path analysis uses measured variables only. SEM adds hidden (latent) variables measured by several items.
  • Partial least squares regression: Builds a few components that predict the outcome. Choose their number by cross-validation.

In a real paper

Cluster analysis and factor analysis in published studies

Open-access paper · CC BY

Anjana RM, Baskar V, Nair ATN, Jebarani S, Siddiqui MK, Pradeepa R, et al. Novel subgroups of type 2 diabetes and their association with microvascular outcomes in an Asian Indian population: a data-driven cluster analysis: the INSPIRED study. BMJ Open Diabetes Res Care. 2020;8(1):e001506.

The study: A clinic-based study from 50 diabetes centres in nine Indian states. The authors wanted to find subgroups of type 2 diabetes without defining them in advance, so they used k-means cluster analysis on clinical variables in 19 084 patients, then repeated the clustering in a national survey sample.

What the authors wrote
“The k-means clustering method was done with k value of 4 using k-means function (max iteration=10 000) in R V.3.6.0.”
In plain words

“k value of 4” means the authors asked k-means for four clusters. “Max iteration=10 000” is the upper limit on assign-and-update cycles. “R V.3.6.0” names the software and version. The sentences that follow say that the number of clusters was chosen by silhouette width, that the clustering was done on scaled and centred (standardised) values, and that stability was checked with a bootstrap Jaccard index.

ReportedValueWhat it means
Patients clustered19 084final sample after exclusions, diabetes duration under 5 years
Variables8age at diagnosis, BMI, waist, HbA1c, triglycerides, HDL cholesterol, fasting and stimulated C peptide
Clusters4SIDD, IROD, CIRDD and MARD, named from the cluster means
Most frequent clusterMARD 35.8%mild age-related diabetes, later age at onset
CIRDD12.1%combined insulin resistant and deficient diabetes
Stability ruleJaccard > 0.75a stable cluster generally yields a Jaccard similarity index greater than 0.75, over 2000 resamples
Validation sample2204individuals analysed from the ICMR-INDIAB survey, clustered on six variables
Check these when you read it
  • Were the variables standardised? Yes: "Cluster analysis was performed on scaled and centered values."
  • How was k chosen? By silhouette width, and the tendency of the data to form clusters was checked with the Hopkins statistic.
  • Were the clusters reproduced? Yes, in a separate population-based sample, with fewer variables because C peptide was not available there.
  • Do the clusters predict outcomes? The Cox models for retinopathy and kidney disease were adjusted for age, gender, HbA1c and blood pressure. Check Table 2 before treating the clusters as separate diseases.
Open-access paper · CC BY-NC-ND

Nieser KJ, Stowe ZN, Newport DJ, Coker JL, Cochran AL. Detection of differential depressive symptom patterns in a cohort of perinatal women: an exploratory factor analysis using a robust statistics approach. EClinicalMedicine. 2023;57:101830.

The study: An observational cohort of 548 women with a history of major depressive disorder, studied in the perinatal period at two US sites. The authors ran an exploratory factor analysis of the 21 items of the Beck Depression Inventory to find which symptoms group together and whether some women's symptoms followed a different pattern.

What the authors wrote
“In the three-factor model, only one item (loss of appetite) had a substantial loading (≥0.40) on the third factor, so we ultimately decided on a two-factor model.”
In plain words

The sentence before it says that three eigenvalues were greater than one, suggesting three factors, while AIC suggested four and BIC two. In the three-factor solution, only one item loaded 0.40 or more on the third factor. A factor defined by a single item is not a usable construct, so the authors kept two factors. The eigenvalue rule was a starting point, and the loadings decided.

ReportedValueWhat it means
Women analysed548426 from one site and 122 from the other
Items21each rated 0 to 3
Eigenvalues greater than onethreesuggested a three-factor model
AIC and BICfour and two factorstwo model-selection criteria that disagreed
Loading threshold≥0.40used to judge a substantial loading
Factors kept2cognitive-affective symptoms, and inhibition or somatic symptoms
Check these when you read it
  • Which rule decided the number of factors? The paper reports eigenvalues, AIC, BIC and the loadings, and explains the final choice.
  • Was the rotation justified? The loadings were rotated by varimax, which keeps factors uncorrelated. Ask whether cognitive and somatic symptoms of depression are likely to be uncorrelated.
  • Were the items treated as continuous? BDI items have only four ordered values. In their factor mixture models the authors treated them as categorical.
  • Was the sample size justified? The authors cite a simulation result for 150–200 participants with moderate loadings.

How to run it

Running multivariate methods in SPSS, R and jamovi

Menu names are from the IBM SPSS Statistics documentation and the jamovi documentation. Function names and defaults are from the R and CRAN reference manuals.

MethodIBM SPSS StatisticsRjamovi
MANOVAAnalyze > General Linear Model > Multivariate. Box's M test of the homogeneity of the covariance matrices is availablemanova(), then summary() (Pillai by default)ANOVA > MANCOVA (Pillai, Wilks, Hotelling, Roy, optional Box's M)
Canonical correlationNot verified for current menuscancor()Not verified
Discriminant analysisAnalyze > Classify > Discriminant. Classify button: prior probabilities, summary table, leave-one-out classificationMASS::lda(), with CV = TRUE for leave-one-outNot available. The jamovi documentation points to R and the MASS package
Hierarchical clusteringAnalyze > Classify > Hierarchical Cluster. Method: Ward's method and others, standardise values. Plots: dendrogramdist(), hclust(), cutree()Not available in the base analyses
k-meansAnalyze > Classify > K-Means Cluster. Specify the number of clusters. Standardise first with Descriptiveskmeans(), cluster::silhouette()Not verified
PCA and EFAAnalyze > Dimension Reduction > Factor. Extraction, Rotation and Descriptives (KMO and Bartlett's test) buttonsprcomp(), psych::fa(), psych::KMO(), psych::cortest.bartlett(), psych::fa.parallel()Factor > Principal Component Analysis, Factor > Exploratory Factor Analysis
CFA and SEMNot covered herelavaan::cfa(), lavaan::sem(), fitMeasures()Confirmatory Factor Analysis (jmv::cfa), CFI, TLI and RMSEA by default
PLS regressionAnalyze > Regression > Partial Least Squares. Needs a separate Python 3.10 with NumPy and SciPypls::plsr() with validation = "LOO" or "CV"Not available

Defaults that change your results

  • prcomp() does not standardise unless you set scale. = TRUE.
  • kmeans() uses one random start by default (nstart = 1) and the Hartigan-Wong algorithm, with iter.max = 10.
  • hclust() uses complete linkage by default. Its documentation states that "ward.D2", not "ward.D", implements Ward's (1963) criterion.
  • MASS::lda() uses the class proportions in your data as prior probabilities unless you give prior.
  • psych::fa() defaults to minimum residual extraction and oblimin rotation. factanal() in base R uses maximum likelihood and varimax.
  • psych::cortest.bartlett() assumes n = 100 if you do not give the sample size.
  • jamovi Exploratory Factor Analysis defaults to parallel analysis, minimum residual extraction and oblimin rotation. Its Principal Component Analysis defaults to varimax.

R code for the teaching examples

# MANOVA
fit <- manova(cbind(hr_rise, map_rise) ~ drug, data = haemo)
summary(fit)                    # Pillai's trace
summary(fit, test = "Wilks")    # Wilks' lambda

# Discriminant analysis with equal priors and leave-one-out classification
library(MASS)
ld  <- lda(group ~ mcv + rbc, data = anaemia, prior = c(0.5, 0.5))
loo <- lda(group ~ mcv + rbc, data = anaemia, prior = c(0.5, 0.5), CV = TRUE)
table(anaemia$group, loo$class)

# Hierarchical clustering and k-means on standardised variables
z  <- scale(dm[, c("bmi", "hba1c")])
hc <- hclust(dist(z), method = "ward.D2")
plot(hc)
cl <- cutree(hc, k = 3)
km <- kmeans(z, centers = 3, nstart = 100)
library(cluster)
mean(silhouette(km$cluster, dist(z))[, "sil_width"])

# PCA
pc <- prcomp(body[, c("waist", "hip")])
pc$sdev^2       # eigenvalues
pc$rotation     # loadings

# Exploratory factor analysis
library(psych)
KMO(items)
cortest.bartlett(cor(items), n = nrow(items))
fa.parallel(items)
efa <- fa(items, nfactors = 2, fm = "minres", rotate = "varimax")
efa$loadings

# Confirmatory factor analysis and a path model with an indirect effect
library(lavaan)
cfa_fit <- cfa(' fatigue =~ i1 + i2 + i3 + i4
                 mood    =~ i5 + i6 + i7 + i8 ', data = items)
fitMeasures(cfa_fit, c("cfi", "rmsea"))
path_fit <- sem(' adherence ~ a*depression
                  hba1c ~ b*adherence + depression
                  indirect := a*b ', data = dm, se = "bootstrap")

# PLS regression with leave-one-out cross-validation
library(pls)
pl <- plsr(egfr ~ ., data = proteins, ncomp = 10, scale = TRUE, validation = "LOO")
RMSEP(pl)

How to report it

What to write in your thesis or paper

Name the method, the software and version, every choice that changes the result, and the numbers a reader needs to check your conclusion.

Worked sentences using this chapter's teaching data

  • MANOVA: “The rise in heart rate and in MAP were compared across the three groups with a one-way MANOVA. The groups differed on the two outcomes considered together (Wilks' λ = 0.57, F(4, 52) = 4.26, p = 0.005; Pillai's trace = 0.46, p = 0.006). One-way ANOVAs for each outcome gave p = 0.23 for heart rate and p = 0.11 for MAP.”
  • Discriminant analysis: “Linear discriminant analysis with MCV and red cell count, using equal prior probabilities, gave D = −1.455 + 0.161 × MCV − 1.946 × red cell count. It correctly classified 48 of 50 patients (96%), and 96% with leave-one-out classification.”
  • Cluster analysis: “BMI and HbA1c were standardised to z-scores. k-means clustering (100 random starts) was run for k = 2 to 6, and k = 3 was chosen because it gave the largest average silhouette width (0.67). Ward's hierarchical clustering gave the same three clusters.”
  • Exploratory factor analysis: “Sampling adequacy was acceptable (KMO = 0.82; Bartlett's test χ²(28) = 561.3, p < 0.001). Two factors were retained by parallel analysis and eigenvalues greater than 1 (3.34 and 1.51). Factors were extracted by minimum residual and rotated by varimax. Loadings of 0.40 or more defined factor membership. The two factors explained 48.0% of the variance.”
  • PLS regression: “PLS regression was fitted to 60 standardised protein levels. The number of components was chosen by leave-one-out cross-validation (3 components, RMSE 3.25 mL/min/1.73 m², Q² = 0.94). The model has not been validated in an external sample.”

Always report

  • Why a multivariate method was needed, and whether it was planned in the protocol.
  • The variables included and how they were chosen, standardisation, and how missing values were handled.
  • For MANOVA and discriminant analysis: the test statistic named, and the check of equal covariance matrices.
  • For cluster analysis: Clatworthy and colleagues found that published cluster analyses most often omitted the similarity measure and the computer program, and that the procedures used to choose the number of clusters and to validate them were often reported in too little detail to repeat.
  • For factor analysis: KMO and Bartlett's test, the rule for the number of factors, extraction and rotation methods, the loading cut-off, the full loading table and the variance explained.
  • For any classification or prediction model: accuracy by cross-validation or in a separate sample, not only in the fitting data.

By specialty

Multivariate problems by specialty

Age at diagnosis, BMI, waist, HbA1c, triglycerides and HDL cholesterol in 2,000 patients with newly diagnosed type 2 diabetes. The plan is to find subgroups.

k-means returns exactly the number of clusters you ask for. Standardise the variables, state how k was chosen, and check that the clusters are stable and differ in later outcomes before calling them subgroups.

Common myths

Common mistaken beliefs

  • Myth: "Multivariate logistic regression" describes a model with one outcome and several predictors.

    That model is multivariable. Multivariate means two or more outcome variables. In one review, 25 of 30 articles that said "multivariate" had used multivariable models (Hidalgo and Goodman, 2013).

  • Myth: One ANOVA per outcome is as good as a MANOVA.

    Separate tests each carry their own false-positive rate and ignore the correlation between outcomes. In this chapter's example, two ANOVAs gave p = 0.23 and 0.11, and MANOVA gave p = 0.005.

  • Myth: PCA is a type of factor analysis.

    PCA builds weighted sums that keep total variance. Factor analysis models hidden factors and separates common from unique variance. Tavakol and Wetzel note that PCA is often described, in error, as exploratory factor analysis.

  • Myth: Eigenvalues greater than 1 fix the number of factors.

    It is one guide among several. Nieser and colleagues found three eigenvalues above 1 but kept two factors, because only one item loaded on the third.

  • Myth: Cluster analysis discovers real disease subtypes.

    k-means always returns the number of clusters you ask for. Clusters need checks of cluster tendency, stability and outcomes, and replication in another sample.

  • Myth: Ten patients per variable always makes a factor analysis stable.

    MacCallum and colleagues showed that no single ratio works. The sample needed depends on the communalities and on how many items measure each factor.

Why this matters to you

Five consequences of choosing the wrong multivariate method

  1. Protocol sent back

    "Multivariate analysis will be done" does not name a method or an outcome. ICH E9 expects one primary variable and the handling of multiplicity to be stated in the protocol.

  2. A wrong conclusion in the thesis

    Separate tests on correlated outcomes can report "no difference" when the outcomes together differ, or a false difference when many outcomes are tested.

  3. Questions you cannot answer at the viva

    "Why PCA and not factor analysis?", "How did you choose k?" and "Which rotation, and why?" need answers written into your methods.

  4. Misreading papers

    Clusters named by the authors can look like new diseases. Factor names are the authors' interpretation of the loadings. Check how both were chosen and validated.

  5. Harm to patients

    A classification rule with 96% accuracy in the patients used to build it may do worse in new patients. Using it without validation can send patients down the wrong diagnostic path.

History

History of multivariate methods

  1. 1901

    Karl Pearson

    Published "On lines and planes of closest fit to systems of points in space". Jolliffe and Cadima date the earliest literature on principal component analysis to Pearson and Hotelling.

  2. 1904

    Charles Spearman

    Published "General intelligence, objectively determined and measured", the start of factor analysis.

  3. 1921

    Sewall Wright

    Developed the method of path coefficients (path analysis) between 1914 and 1921.

  4. 1933

    Harold Hotelling

    Published "Analysis of a complex of statistical variables into principal components" in two parts in the Journal of Educational Psychology.

  5. 1936

    Ronald A. Fisher

    Published "The use of multiple measurements in taxonomic problems", the paper behind Fisher's linear discriminant.

  6. 1936

    Harold Hotelling

    Published "Relations between two sets of variates", the reference R gives for canonical correlation.

  7. 1958

    Henry Kaiser

    Defined the varimax criterion for analytic rotation in factor analysis.

  8. 1960s

    Herman Wold

    First proposed partial least squares. Interest in chemistry expanded in the 1980s.

  9. 1966

    Raymond Cattell

    Published "The scree test for the number of factors".

  10. 1969

    Karl Jöreskog

    Published "A general approach to confirmatory maximum likelihood factor analysis".

  11. 1987

    Peter Rousseeuw

    Published silhouettes as a graphical aid to the interpretation and validation of cluster analysis.

Guidelines

Several outcomes in guidelines

ICH E9 (1998), section 2.2.2

“There should generally be only one primary variable.”

ICH E9 (1998), section 2.2.3, composite variables

“If a single primary variable cannot be selected from multiple measurements associated with the primary objective, another useful strategy is to integrate or combine the multiple measurements into a single or 'composite' variable, using a pre-defined algorithm.”

ICH E9 (1998), section 5.6

Multiplicity “may arise, for example, from multiple primary variables”. Aspects of multiplicity that remain should be identified in the protocol, and “adjustment should always be considered”.

CONSORT 2025, items 14 and 21a

Trial reports give “prespecified primary and secondary outcomes, including the specific measurement variable”, and the “statistical methods used to compare groups for primary and secondary outcomes, including harms”.

Reading a paper

Six checks on a multivariate analysis in any paper

  • Does "multivariate" really mean two or more outcomes, or is it a multivariable model with one outcome?
  • Were correlated outcomes analysed together, or with a correction for multiple testing, and is the test statistic named?
  • For cluster analysis: were the variables standardised, the distance and algorithm named, the choice of k explained and the clusters checked for stability?
  • For PCA or factor analysis: are KMO, Bartlett's test, the rule for the number of factors, the extraction and rotation methods and the full loading table reported?
  • For discriminant analysis, PLS or any classification: is accuracy shown by cross-validation or in a separate sample, not only in the patients used to build the model?
  • For path analysis or SEM: was the diagram specified before the analysis, are fit indices given, and do indirect effects have confidence intervals?

Why is it called that?

Word surgery

“Factor”

In everyday speech

Something that contributes to a result, as in "risk factor".

In research

In factor analysis, a hidden variable that explains why several items correlate. In ANOVA, a grouping variable such as drug. The same word, two different meanings.

“Loading”

In everyday speech

Putting goods on a vehicle.

In research

The weight linking an item to a factor or component. For uncorrelated factors it is the correlation between the item and the factor.

“Cluster”

In everyday speech

Cases bunched in time or place, as in an outbreak cluster.

In research

A group of patients who are close to each other in the measured variables, formed by an algorithm.

“Rotation”

In everyday speech

Turning something around.

In research

Turning the factor axes so that each item loads mainly on one factor. The fit of the model does not change.

Memory trick

Variate: several outcomes. Variable: several predictors. PCA adds the items up. Factor analysis asks what lies behind them.

Variate

Latin variatus, from variare, "to vary". Used in statistics from 1899

Multivariate: several varying outcome variables analysed together.

Canonical

Late Latin canonicus: "according to rule"

Canonical correlation: the correlation between the best weighted sum of one set of variables and the best weighted sum of another set.

Discriminant

Latin discriminare: "to divide, separate"

The discriminant function separates patients into groups.

Cluster

Old English clyster: "a number of things growing naturally together"

A group of patients close together in the measured variables.

Latent

Latin latens: "lying hid, concealed"

A latent factor cannot be measured directly. It is inferred from the items it affects.

Component

Latin componere: "to put together"

A principal component puts the variables together as a weighted sum.

Principal

Latin principalis: "first in importance"

The first principal component keeps the largest share of the variance.

Orthogonal

Greek orthogonios: "right-angled"

An orthogonal rotation keeps the factor axes at right angles, so the factors stay uncorrelated.

Dendrogram

Greek dendron: "tree" (dendro-)

The tree diagram of hierarchical clustering.

Scree

Old Norse skriða: "landslide". A pile of debris at the base of a cliff

On a scree plot, the flat tail of small eigenvalues after the steep drop.

Exam answers

Model answer outlines

Multivariate analysis

Ph.D. RM 2014, 2022 · DM Cardiology 1998
  1. Definition: strictly, analysis of two or more outcome (dependent) variables together. Broadly, the group of methods that analyse many variables at once. A model with one outcome and several predictors is multivariable (Hidalgo and Goodman, 2013).
  2. Why it is needed: separate tests on many outcomes raise the chance of a false positive and ignore the correlation between outcomes. Many correlated variables need to be reduced. Patients may need to be classified or grouped on several measurements together.
  3. Methods with two sets of variables: MANOVA and Hotelling's T² (group differences on several outcomes), canonical correlation (set with set), discriminant analysis (classifying into known groups), path analysis and SEM (chains of effects and latent variables), PLS regression (many correlated predictors).
  4. Methods with one set of variables: cluster analysis (groups of patients), principal component analysis (combining variables), factor analysis (hidden factors).
  5. Requirements: enough patients for the number of variables, variables chosen before the analysis, checks of assumptions (for MANOVA and discriminant analysis, multivariate normality and equal covariance matrices), standardisation for clustering and PCA of variables on different scales, and validation of any classification or cluster solution.
  6. Example in cardiology: left ventricular ejection fraction and end-diastolic diameter compared across three treatment groups with MANOVA, because the two measurements are correlated.
  7. Worked point: heart rate and MAP rise with three drugs. Separate ANOVAs p = 0.23 and 0.11. MANOVA Wilks' λ = 0.57, F(4, 52) = 4.26, p = 0.005.
  8. Reporting: name the method, software and version, the test statistic, how the number of clusters or factors was chosen, and how the solution was validated.

Principal component analysis

DM Clinical Immunology and Rheumatology 2023
  1. Aim: replace many correlated variables by a few uncorrelated weighted sums (principal components) that keep as much of the total variance as possible.
  2. Steps: choose the variables, standardise them if their scales differ (correlation matrix), calculate the eigenvalues and eigenvectors, order the components by eigenvalue, decide how many to keep (scree plot, eigenvalue above 1, parallel analysis, variance explained), interpret the loadings, and save component scores if needed.
  3. Key terms: eigenvalue = variance kept by a component. Variance explained = eigenvalue ÷ total variance. Loadings = weights of each variable in the component. Scree plot = eigenvalues in order.
  4. Worked example: waist and hip in 40 adults, variances 105.2 and 40.9 cm², covariance 51.1. Eigenvalues 133.5 and 12.6. PC1 explains 91.4% and has loadings 0.875 (waist) and 0.483 (hip).
  5. Uses: reducing correlated laboratory or clinical measures to a few scores before regression, building an index, visualising patients in two dimensions, dietary patterns.
  6. PCA and factor analysis: PCA analyses total variance and builds components from the variables. Factor analysis models latent factors that cause the variables and separates common from unique variance. PCA is often described, in error, as exploratory factor analysis.
  7. Limits: components are chosen for variance, not clinical meaning. PCA captures linear relationships only. Results depend on standardisation. Components from one sample need confirmation in another.
  8. History: Pearson (1901) and Hotelling (1933).

(a) Explain what is meant by 'Multivariate Analysis'. (b) Explain in detail Partial Least Square Regression. (c) Explain what is Meta Analysis, the steps of Meta Analysis, the methods and assumptions of Meta Analysis

Ph.D. RM 2013

(a) Multivariate analysis

Analysis of two or more outcome variables together, and more broadly the methods that handle many variables at once: MANOVA, canonical correlation, discriminant analysis, cluster analysis, PCA, factor analysis, path analysis and SEM, and PLS regression. See the first outline above.

(b) Partial least squares (PLS) regression

  1. Problem it solves: predictors that are strongly correlated, or more predictors than patients. Ordinary least squares then gives unstable coefficients or cannot be fitted, because the covariance matrix cannot be inverted.
  2. Idea: build a few components (latent variables), each a weighted sum of the standardised predictors, with weights chosen from their covariance with the outcome. Regress the outcome on these components.
  3. Algorithm: weights proportional to the covariance of each predictor with the outcome, first component = weighted sum, regress the outcome on it, remove what it explains from predictors and outcome, repeat for the next component, which is uncorrelated with the first.
  4. Number of components: by cross-validation. Error in the fitting data always falls as components are added. Cross-validated error has a minimum.
  5. Worked example: eGFR from 60 serum proteins in 30 patients (covariance matrix rank 29). Cross-validated RMSE 3.56, 3.33 and 3.25 for 1, 2 and 3 components, rising to 5.74 at 10. Chosen: 3 components, Q² 0.94.
  6. Compared with PCA-based regression: PCA chooses components from the predictors alone. PLS uses the outcome, so fewer components are usually needed. With one component: RMSE 7.91 for PCA regression against 3.56 for PLS in the example.
  7. Outputs: variance explained by each latent factor, weights, loadings, VIP scores, regression coefficients (IBM SPSS).
  8. Variants and uses: PLS-DA for classification (metabolomics), spectra in chemistry, imaging, “omics” panels. First proposed by Herman Wold in the 1960s.
  9. Limits: components mix many predictors, so it is better for prediction than explanation. Cross-validation within one data set is not external validation.

(c) Meta-analysis, covered in detail in the systematic review and meta-analysis chapter

  • Definition: the statistical combination of the results of several studies of the same question, usually within a systematic review.
  • Steps: question and protocol, comprehensive search, study selection, data extraction, risk-of-bias assessment, pooling of effect sizes, assessment of heterogeneity and publication bias, and reporting.
  • Methods: inverse-variance weighting, fixed-effect or random-effects models, forest plot, I² for heterogeneity, funnel plot for small-study effects.
  • Assumptions: the studies address a similar question and outcome and are independent. A fixed-effect model assumes one true effect. A random-effects model assumes that the true effects vary around an average.

The one thing to remember

Decide from the question whether your variables form two sets or one, name the actual method, and check any groups, factors or predictions in data that were not used to find them.

All worked examples and interactive elements use made-up data for teaching. Every number was computed in Python (NumPy, SciPy 1.15, statsmodels 0.14, scikit-learn 1.7, factor_analyzer 0.5.1), and the interactive elements were checked against the same calculations.

Sources: Hidalgo B, Goodman M. Multivariate or multivariable regression? Am J Public Health 2013;103(1):39–40 (PMID 23153131). Anjana RM et al. BMJ Open Diabetes Res Care 2020;8(1):e001506 (doi:10.1136/bmjdrc-2020-001506, PMID 32816869). Nieser KJ et al. EClinicalMedicine 2023;57:101830 (doi:10.1016/j.eclinm.2023.101830, PMID 36798754). MacCallum RC, Widaman KF, Zhang S, Hong S. Sample size in factor analysis. Psychol Methods 1999;4(1):84–99 (doi:10.1037/1082-989X.4.1.84). Ateş C et al. Comput Math Methods Med 2019;2019:2173638 (PMID 31396289). Shayan Z et al. Glob J Health Sci 2015;8(7):41–6 (PMID 26925900). Ebrahimzadeh F et al. Med J Islam Repub Iran 2015;29:264 (PMID 26793655). Clatworthy J et al. Br J Health Psychol 2005;10(Pt 3):329–58 (PMID 16238852). Jolliffe IT, Cadima J. Philos Trans A Math Phys Eng Sci 2016;374(2065):20150202 (PMID 26953178). Tavakol M, Wetzel A. Int J Med Educ 2020;11:245–7 (PMID 33170146). Beran TN, Violato C. BMC Res Notes 2010;3:267 (PMID 20969789). Szymańska E et al. Metabolomics 2012;8(Suppl 1):3–16 (PMID 22593721). Steffes DM. J Hist Biol 2007;40(2):327–61 (PMID 18175605). Liu C, Wechsler H. IEEE Trans Image Process 2002;11(4):467–76 (PMID 18244647). Brereton RG. Partial least squares. J Chemom 2025;39(12) (doi:10.1002/cem.70069). Pearson K. Phil Mag 1901;2(11):559–72 (doi:10.1080/14786440109462720). Spearman C. Am J Psychol 1904;15(2):201 (doi:10.2307/1412107). Hotelling H. J Educ Psychol 1933;24:417–41, 498–520 (doi:10.1037/h0071325). Fisher RA. Ann Eugen 1936;7(2):179–88 (doi:10.1111/j.1469-1809.1936.tb02137.x). Hotelling H. Biometrika 1936;28(3–4):321–77 (doi:10.1093/biomet/28.3-4.321). Kaiser HF. Psychometrika 1958;23(3):187–200 (doi:10.1007/BF02289233). Cattell RB. Multivariate Behav Res 1966;1(2):245–76 (doi:10.1207/s15327906mbr0102_10). Jöreskog KG. Psychometrika 1969;34(2):183–202 (doi:10.1007/BF02289343). Rousseeuw PJ. J Comput Appl Math 1987;20:53–65 (doi:10.1016/0377-0427(87)90125-7). ICH E9 Statistical Principles for Clinical Trials, 5 February 1998. Hopewell S et al. CONSORT 2025 statement. BMJ 2025;389:e081123 (PMID 40228833). IBM SPSS Statistics documentation (GLM Multivariate, Discriminant Analysis, Hierarchical Cluster, K-Means Cluster, Factor Analysis, Partial Least Squares Regression). R stats, MASS, cluster, psych, lavaan, pls and jmv reference manuals. jamovi documentation. All accessed 15 September 2026.

Past papers

TNMGRMU questions on multivariate methods

Questions from MD, MS, DM, MCh and Ph.D. papers that this chapter helps you answer. Tap a sitting to open the university's own question paper.

  1. ×3Multivariate analysisPh.D. RM · Jul 2022Ph.D. RM · Jul 2014DM Cardiology · Oct 1998
  2. ×1Principal component analysisDM Clinical Immunology and Rheumatology · Aug 2023
  3. ×1(a) Explain what is meant by ‘Multivariate Analysis’. (b) Explain in detail Partial Least Square Regression. (c) Explain what is Meta Analysis, the steps of Meta Analysis, the methods and assumptions of Meta AnalysisPh.D. RM · Jul 2013