UCLA Academic Technology Services HomeServicesClassesContactJobs
Search

SAS Textbook Examples
Computer-Aided Multivariate Analysis by Afifi and Clark
Chapter 10: Canonical correlation analysis

Page 229 Table 10.1  Means and standard deviations for depression data set.
data depress;
set "c:\cama3\depress";
sex1 = sex - 1;
run;
NOTE:  The output from the proc corr used for the next table includes the information in this table.
Page 229 Table 10.2  Correlation matrix for depression data set.
proc corr data = depress;
var cesd health sex1 age educat income;
run;
The CORR Procedure

   6  Variables:    CESD     HEALTH   sex1     AGE      EDUCAT   INCOME


                                    Simple Statistics

Variable           N          Mean       Std Dev           Sum       Minimum       Maximum

CESD             294       8.88435       8.82365          2612             0      47.00000
HEALTH           294       1.77211       0.83795     521.00000       1.00000       4.00000
sex1             294       0.62245       0.48560     183.00000             0       1.00000
AGE              294      44.41497      18.08544         13058      18.00000      89.00000
EDUCAT           294       3.47959       1.31073          1023       1.00000       7.00000
INCOME           294      20.57483      15.29012          6049       2.00000      65.00000


                        Pearson Correlation Coefficients, N = 294
                                Prob > |r| under H0: Rho=0

                CESD        HEALTH          sex1           AGE        EDUCAT        INCOME

CESD         1.00000       0.21199       0.12359      -0.16414      -0.10142      -0.15804
                            0.0003        0.0342        0.0048        0.0825        0.0066

HEALTH       0.21199       1.00000       0.09817       0.30421      -0.26994      -0.18340
              0.0003                      0.0929        <.0001        <.0001        0.0016

sex1         0.12359       0.09817       1.00000       0.04355      -0.10598      -0.18028
              0.0342        0.0929                      0.4569        0.0696        0.0019

AGE         -0.16414       0.30421       0.04355       1.00000      -0.20841      -0.19169
              0.0048        <.0001        0.4569                      0.0003        0.0010

EDUCAT      -0.10142      -0.26994      -0.10598      -0.20841       1.00000       0.42897
              0.0825        <.0001        0.0696        0.0003                      <.0001

INCOME      -0.15804      -0.18340      -0.18028      -0.19169       0.42897       1.00000
              0.0066        0.0016        0.0019        0.0010        <.0001
Page 230 Table 10.3  Canonical correlation coefficients for first correlation (depression data set).
proc cancorr data = depress out=can;
var cesd health;
with sex age educat income;
run; 
The CANCORR Procedure

Canonical Correlation Analysis

Raw Canonical Coefficients for the VAR Variables

                      V1                V2

CESD        -0.055489054      0.1018303601
HEALTH      1.1717792764      0.3437096752

Raw Canonical Coefficients for the WITH Variables

                      W1                W2

SEX         0.0512337805      0.8164422692
AGE         0.0481483703      -0.024468017
EDUCAT      -0.292121349      -0.341960344
INCOME      0.0053689321         -0.036287

The CANCORR Procedure

Canonical Correlation Analysis

Standardized Canonical Coefficients for the VAR Variables

                  V1            V2

CESD         -0.4896        0.8985
HEALTH        0.9819        0.2880

Standardized Canonical Coefficients for the WITH Variables

                  W1            W2

SEX           0.0249        0.3965
AGE           0.8708       -0.4425
EDUCAT       -0.3829       -0.4482
INCOME        0.0821       -0.5548
Page 231 Table 10.4  Computation of correlation between U(1) and V(1).
These computations are based on the previous two tables.
Page 233 The second canonical correlations give at the top of the page.
NOTE:  This output is part of the output given by the code above.
The CANCORR Procedure

Canonical Correlation Analysis

Standardized Canonical Coefficients for the VAR Variables

                  V1            V2

CESD         -0.4896        0.8985
HEALTH        0.9819        0.2880

Standardized Canonical Coefficients for the WITH Variables

                  W1            W2

SEX           0.0249        0.3965
AGE           0.8708       -0.4425
EDUCAT       -0.3829       -0.4482
INCOME        0.0821       -0.5548
Page 235 Figure 10.1  Plot of 294 pairs of the canonical variables U(1) and V(1) for the depression data set (canonical correlation = 0.405).
NOTE:  We were unable to reproduce this graph.
Page 236 Table 10.5  Correlations between canonical variables and corresponding variables (depression data set).
NOTE:  This output is part of that produced by the proc cancorr above.
Correlations Between the VAR Variables and Their Canonical Variables

                  V1            V2

CESD         -0.2815        0.9596
HEALTH        0.8781        0.4785

Correlations Between the WITH Variables and Their Canonical Variables

                  W1            W2

SEX           0.0886        0.5247
AGE           0.9359       -0.2255
EDUCAT       -0.5318       -0.6360
INCOME       -0.2536       -0.7338

How to cite this page

Report an error on this page

UCLA Researchers are invited to our Statistical Consulting Services
We recommend others to our list of Other Resources for Statistical Computing Help
These pages are Copyrighted (c) by UCLA Academic Technology Services


The content of this web site should not be construed as an endorsement of any particular web site, book, or software product by the University of California