Does canonical correlation analysis (P.G.N. Digby).
Option
PRINT = string tokens |
Printed output from the analysis (correlations , pcoeff , qcoeff , pscores , qscores ); default * i.e. no output |
---|
Parameters
PVARIATES = pointers |
Pointer to P-set of variates to be analysed |
---|---|
QVARIATES = pointers |
Pointer to Q-set of variates to be analysed |
CORRELATIONS = diagonal matrices |
Stores the canonical correlations from each analysis |
PCOEFF = matrices |
Stores the coefficients for the P-set of variates |
QCOEFF = matrices |
Stores the coefficients for the Q-set of variates |
PSCORES = matrices |
Stores the unit scores from the P-set of variates |
QSCORES = matrices |
Stores the unit scores from the Q-set of variates |
Description
CANCORRELATION
does canonical correlation analysis; see, for example, Mardia, Kent & Bibby (1979) or Digby & Kempton (1987).
The data for the procedure are two pointers specified by the PVARIATES
and QVARIATES
parameters; these must point directly to two sets of variates. The variates may have missing values, or be restricted: any units with any values missing will be excluded from the analysis; any restrictions on the variates must be consistent (the rules here are exactly as used by the FSSPM
directive).
Printed output is controlled by the option PRINT
with settings: correlations
to print the canonical correlations (also expressed as percentages, and cumulative percentages, of their total); pcoeff
to print the canonical correlation coefficients for the P-set of variates; qcoeff
to print the canonical correlation coefficients for the Q-set of variates; pscores
to print the canonical correlation scores for the units calculated from the P-set of variates; qscores
to print the canonical correlation scores for the units calculated from the Q-set of variates.
Results from the analysis can be saved using the parameters CORRELATIONS
, PCOEFF
, QCOEFF
, PSCORES
and QSCORES
. The structures specified for these parameters need not be declared in advance.
Option: PRINT
.
Parameters: PVARIATES
, QVARIATES
, CORRELATIONS
, PCOEFF
, QCOEFF
, PSCORES
, QSCORES
.
Method
The method used is as described in Digby & Kempton (1987). Spectral decompositions (LRL′) of the SSPMs for the P-set and Q-set are used to form the inverse square root matrices, F and G (as L R-½) ). The singular value decomposition ( U S V ′ ) of ( F ′ C G )is then formed, where C is the matrix of sums of products between the two sets of variates. The diagonal matrix S contains the canonical correlations; the canonical correlation coefficients for the two sets of variates are ( F U ) and ( G V ). The scores for the units from the two sets of variates are formed by subtracting the variate means and applying the matrices of coefficients as loadings.
References
Digby, P.G.N. & Kempton, R.A. (1987). Multivariate Analysis of Ecological Communities. Chapman & Hall, London.
Mardia, K.V., Kent, J.T. & Bibby, J.M. (1979). Multivariate Analysis. Academic Press, London.
See also
Commands for: Multivariate and cluster analysis.
Example
CAPTION 'CANCORRELATION example',\ 'Data from Table 3.7 of Digby & Kempton (1987).';\ STYLE=meta,plain TEXT Plot; !T('1d','3a','3d','4a','4d','7a','7d','8a','8d','9a','9d',\ '10a','10d','11/1a','11/1d','11/2a','11/2d','14a','14d','16a','16d',\ '17a','17d','18d') POINTER Treats; !P(N,Nstar,P,K,Lime) & Species; !P(Axis_1,Axis_2,Axis_3,Axis_4) VARIATE [NVALUES=Plot] Treats[],Species[] READ Treats[] 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 2 0 1 0 1 2 0 1 0 0 0 0 1 1 1 0 0 1 1 0 0 0 1 0 1 0 0 1 0 0 2 0 1 1 1 2 0 1 1 0 2 0 1 0 1 2 0 1 0 0 3 0 1 1 1 3 0 1 1 0 3 0 1 1 1 3 0 1 1 0 0 2 1 1 1 0 2 1 1 0 0 1 1 1 1 0 1 1 1 0 0 1 0 0 1 0 1 0 0 0 2 0 0 1 0 : READ Species[] 354 177 -173 85 211 -406 2 -170 299 -294 -11 -46 191 11 246 209 331 226 -262 28 -333 -145 -212 36 200 -149 -11 -6 136 -347 -7 -100 162 -302 29 -194 -416 59 -27 19 281 257 -130 -154 9 -28 166 182 333 228 -251 33 -386 111 86 -92 52 242 52 -349 -387 98 42 -50 36 252 72 -346 -391 -127 -170 196 -419 30 -137 118 -333 -143 -171 149 -254 -89 -121 12 102 -388 11 -140 135 -260 -68 -60 331 238 -245 38 : CALCULATE Species[] = Species[] / 100 PRINT Plot,Treats[],Species[]; FIELDWIDTH=7; DECIMALS=(0)6,(2)4 & 'Use CANCORRELATION, printing all results, saving SCORES only.' MATRIX [ROWS=Plot; COLUMNS=4] Specs_Sc,Treat_Sc CANCORRELATION [PRINT=correlations,pcoeff,qcoeff,pscores,qscores]\ Treats; Species; PSCORES=Treat_Sc; QSCORES=Specs_Sc PRINT Specs_Sc