Statistics Glossary → Canonical Correlation
Canonical Correlationanalysis
A multivariate analysis that summarises the relationship between two sets of numeric variables by finding a weighted combination from each set that correlates as strongly as possible with the other.
Concept
Sometimes the question is not about two variables but about two sets of variables: how are soil properties (pH, nitrogen, organic matter) related to crop properties (yield, protein, plant height)? Relating each soil variable to each crop variable one by one produces many correlations and does not reveal the shared structure. Canonical correlation analysis handles the two sets together.
The analysis chooses a weighted sum of the variables in set X (U) and a weighted sum of those in set Y (V) so that the correlation between U and V is as large as possible; this is the first canonical correlation. A second pair, uncorrelated with the first, is then sought, and so on up to the number of variables in the smaller set. The loadings (each variable's correlation with its own canonical variate) show what each pair means; the redundancy index gives how much of the total variation in one set is explained by the canonical variates of the other. Multivariate tests such as Wilks' Λ test whether the canonical correlations differ from zero.
Because canonical correlations are chosen to be as large as possible, they are optimistic in the sample; especially with small samples relative to the number of variables, results are unstable and may not replicate in new data. A high canonical correlation does not mean that most of the variation in the sets is explained; redundancy should be checked for that. The tests assume multivariate normality, and strong multicollinearity within a set makes the coefficients unstable, so interpretation should rely on loadings rather than coefficients.
When to use it
- To study the shared relationship structure between two sets each made up of several numeric variables (e.g. psychological scales and achievement measures, environmental variables and species abundances).
- With only two variables use simple correlation; when one set explains a single outcome, use multiple linear regression.
- If one set is clearly an outcome set and groups are compared, use MANOVA; if the variables are to be linked through latent constructs, structural equation modelling or partial least squares (PLS) may be more suitable.
An everyday example
An agricultural research station measures three soil properties (pH, nitrogen, organic matter) and three crop properties (yield per hectare, grain protein, plant height) in 120 fields. Canonical correlation analysis might find r = 0.72 for the first pair: a 'soil fertility' combination dominated by nitrogen and organic matter is strongly related to a 'plant growth' combination dominated by yield and plant height. A second, weaker pair might reflect a separate link between pH and grain protein.
Parameters in MerQur
X set and Y set
Concept: The two sets of numeric variables whose relationship is examined; each set has at least two variables and no variable can be in both. The number of canonical pairs obtainable equals the number of variables in the smaller set. Swapping the sets does not change the canonical correlations.
Everyday example: In the station example set X is the soil properties (pH, nitrogen, organic matter) and set Y the crop properties (yield, protein, plant height). With three variables in each, there are at most three canonical pairs.
What it does: The two variable sets from which the canonical pairs are built (each with at least 2 numeric variables; the sets do not intersect).
Effect on the result: K = min(p, q) canonical pairs are formed. If X and Y are swapped, r, Wilks Λ, the tests and redundancy do not change; the statistics of X pass to Y (Var(X) ↔ Var(Y), Red(X|Y) ↔ Red(Y|X)).
On the validation data: In mmreg K = 3; r = 0.4641, 0.1675, 0.1040. Missing values are deleted listwise: when rep78 is added to Y in auto, n goes 74 -> 69.
Number of components (0 = automatic)
Concept: Limits how many canonical pairs are reported in detail. Usually only significant, interpretable pairs are reported; the tests are always computed over all pairs.
Everyday example: If the station's third pair has a correlation of 0.08 and is not significant, restricting the report to the first two pairs focuses the reader on the important relationships.
What it does: Limits how many canonical pairs are reported; for reporting only the significant pairs.
Effect on the result: Only the number of displayed pairs (r, coefficient, loading, redundancy, eigenvalue rows, saved scores) changes. The sequential Wilks Λ, Bartlett χ², full-model tests and eigenvalue proportions use all K roots. A value greater than K is reduced to K.
On the validation data: With 1 only CC1 is printed; Λ₁ = 0.75436 (product of all roots), eigenvalue proportion 0.8734. Selecting 3 and 20 equals automatic (K = 3).
Confidence Level (%90, %95, %99, Other (custom))
Concept: Sets the level of the approximate confidence interval and significance marker given for each canonical correlation. Because the canonical correlation is chosen to be as large as possible, this interval is optimistic and should be read as a rough guide.
Everyday example: For the first pair's r = 0.72, the 95% interval might appear as about 0.62 to 0.80. But since this correlation was chosen as the best combination in the data, it can be expected to come out somewhat lower in new fields.
What it does: Sets the Fisher z confidence interval for each canonical r, tanh(atanh r ± z/√(n - 3)), and the significance mark (p < alpha). For the maximized r this interval is optimistic (Anderson, 2003, chapter 12); it is an approximate display.
Effect on the result: Only the interval limits, asterisk mark and chart color change; r and the tests do not change. The interval is clipped to [0, 1] and an "approximate" note is written under the row.
On the validation data: CC1 (r = 0.4641): 90% [0.410, 0.515]; 95% [0.399, 0.525]; 99% [0.378, 0.543]. For CC3 (r = 0.1040) the 99% lower limit is clipped to 0.000.
Additional output: Cross-loadings
Concept: The correlation of each variable in one set with the canonical variate of the other set. Unlike loadings within a variable's own set, it shows directly how individual variables are linked to the opposite set.
Everyday example: If nitrogen's cross-loading on the 'plant growth' combination is 0.65, nitrogen alone is strongly related to the shared growth pattern on the crop side. If pH's cross-loading is 0.10, pH is only weakly linked to that pattern.
What it does: The correlation of each X variable with the Y canonical variates (V) and of each Y variable with U.
Effect on the result: Two additional tables; other outputs do not change.
On the validation data: locus_of_control x V1 = 0.4196, read x U1 = 0.3900 (structure coefficients; the sign convention is applied).
Additional output: Multivariate tests
Concept: Tests the hypothesis that all canonical correlations are zero at once with four different multivariate criteria: Pillai's trace, Wilks' Λ, the Hotelling-Lawley trace and Roy's largest root. In most situations they reach the same conclusion; Pillai's is regarded as the most robust to violations of assumptions.
Everyday example: The station first asks 'is there any relationship at all between the soil set and the crop set?'. If all four tests give p < 0.001, there is clearly a strong shared structure between the two sets.
What it does: For H₀: all canonical correlations are 0, gives the Pillai trace, Wilks Λ (Rao F), Hotelling-Lawley trace and Roy's largest root (λ₁, F upper bound) tests.
Effect on the result: An additional table.
On the validation data: mmreg: Pillai 0.2542, F(15, 1782) = 11.001; Wilks 0.7544, F(15, 1634.65) = 11.716; Hotelling-Lawley 0.3143, F(15, 1772) = 12.376; Roy 0.2745, F(5, 594) = 32.610.
→ Multivariate test statistics (Wilks' Λ, Pillai's trace, Hotelling-Lawley, Roy)
Additional output: Eigenvalues
Concept: Each canonical pair's eigenvalue expresses the strength of its correlation as r²/(1 − r²). The share of each eigenvalue in the total shows how much of the shared relationship between the sets is concentrated in each pair.
Everyday example: If the first pair's eigenvalue makes up 85% of the total, most of the soil-crop relationship is concentrated in a single 'fertility-growth' dimension; the other pairs are secondary details.
What it does: Gives λᵢ = rᵢ²/(1 - rᵢ²), the proportion explained and the cumulative proportion.
Effect on the result: An additional table.
On the validation data: 0.2745 / 0.0289 / 0.0109; proportion 0.8734 / 0.0919 / 0.0348.
Additional output: Assumption diagnostics
Concept: Checks the multivariate normality assumption behind the tests and multicollinearity within each set. If the variables in a set are very highly correlated, the canonical coefficients become unstable and may even flip sign.
Everyday example: If nitrogen and organic matter are very strongly related (e.g. r = 0.95), the VIF is high; results such as 'nitrogen has a negative coefficient' cannot then be trusted, and interpretation should rest on the loadings.
What it does: The Mardia multivariate skewness (χ²) and kurtosis (z) test for X ∪ Y and the within-set VIF; checks multivariate normality and within-set multicollinearity.
Effect on the result: An additional table and warnings.
On the validation data: mmreg skewness χ²(120) = 314.413, p < .0001; kurtosis z = -1.351, p = 0.1767 (Mardia). VIF: X 1.08-1.14, Y 1.24-2.51. In auto the length VIF is 11.11 (a > 10 warning is printed).
Additional output: Save scores
Concept: Adds each observation's canonical variate values (U and V scores) to the dataset as new columns. The scores are scaled to mean 0 and variance 1 and can be used in later analyses or charts.
Everyday example: If the station saves each field's 'soil fertility' score and maps it, it can show with a single variable which areas have fertile soils and which have poor ones.
What it does: Adds the canonical variate scores (CCA_U1..., CCA_V1...; mean 0, variance 1) to the dataset as new columns.
Effect on the result: Columns are added to the dataset.
On the validation data: In mmreg 6 columns x 600 rows of canonical scores are written (with the sign convention). In auto + rep78, 69 rows are filled and 5 rows are blank.
Example on real data
Data: UCLA OARC mmreg
Variables: X set locus_of_control, self_concept, motivation (psychological scales); Y set read, write, math, science, female (academic measures and sex)
- Question: Are there shared dimensions between the psychological set (locus of control, self-concept, motivation) and the academic set (reading, writing, math, science, sex)? (N = 600)
- Result: Three canonical correlations: r1 = 0.464, r2 = 0.168, r3 = 0.104. In the Bartlett sequential Wilks tests the first two dimensions are significant (Λ1 = 0.754, χ²(15) = 167.58, p < .001; Λ2 = 0.961, χ²(8) = 23.38, p = .003), the third is not (χ²(3) = 6.46, p = .091).
- Effect size: r1² = 0.215; the first pair of canonical variates shares 21.5% of the variance. Although significant, the second dimension is weak in practice with r2² = 0.028.
- Interpretation (dimension 1): On the X side locus of control (standardized coefficient 0.84) and motivation (0.43), on the Y side reading (0.45), writing (0.35) and sex (0.32) dominate: students with an internal locus of control and high motivation also have high reading and writing scores.
- Redundancy: 11.30% of the variance in the Y set is explained by the first X canonical variate (Red(Y|X)).
- APA: CC1: r = .46, Wilks' Λ = 0.754, χ²(15, N = 600) = 167.58, p < .001.
Related concepts
Multivariate test statistics (Wilks' Λ, Pillai's trace, Hotelling-Lawley, Roy)Redundancy indexCross-loadingsEigenvalue and eigenvectorMardia's test of multivariate normalityFactor (component) loadingsBartlett's test of equal variancesProportion of explained variance
The numbers in the examples are MerQur's output on independent, publicly available validation data; see the MerQur Technical Note for details.