SHAZAM Covariance and Correlation

Covariance and Correlation


The STAT command has options to compute the covariances and correlations between variables. The PCOV option will list the sample covariances and the PCOR option will list the sample correlations.

Example

The business section of newspapers give regular reports on movements in interest rates and foreign exchange rates. For example, the following is from the Vancouver Sun (byline: Norma Greenaway, November 26, 1997).

The Bank of Canada nudged its benchmark rate a quarter point to four per cent on Monday. ... The central bank's modest hike ... set off a round of rate increases by the major commercial banks. Beginning today, the prime lending rate -- available only to their most credit-worthy customers -- will climb to 5.5 per cent from 5.25 per cent. Mortgage rates were not immediately affected. ... The dollar strengthened slightly against its U.S. counterpart in the wake of the announcement, closing at 70.57 cents -- up about one-fifth of a cent from its opening.

The above recognizes the important associations between various economic variables. The strength of these associations can be considered by analyzing a data set. A monthly data set with the Canadian chartered bank prime business loan rate, the 5 year mortgage rate and the Canadian/U.S. $ exchange rate was collected from the Statistics Canada CANSIM data base.

The SHAZAM commands that follow first read the data and assign variable names. The STAT command is then used to obtain the correlations between the variables of interest.

SAMPLE 1 204
READ (MOBS.txt)  DATE PRIME MRATE5 USCAN 
STAT PRIME MRATE5 USCAN / PCOV PCOR
STOP

The SHAZAM output can be viewed. The results show that the estimated correlation between the prime lending rate and the 5-year mortgage rate is 0.93 (for presentation purposes, the numerical results have been rounded to 2 decimal places). The estimated correlation between the prime lending rate and the Canadian/U.S. $ exchange rate is -0.49.


Home [SHAZAM Guide home]

SHAZAM output


|_SAMPLE 1 204
|_READ (MOBS.txt)  DATE PRIME MRATE5 USCAN
UNIT 88 IS NOW ASSIGNED TO: MOBS.txt
   4 VARIABLES AND      204 OBSERVATIONS STARTING AT OBS       1

|_STAT PRIME MRATE5 USCAN / PCOV PCOR
NAME        N   MEAN        ST. DEV      VARIANCE     MINIMUM      MAXIMUM
PRIME      204   10.963       3.6408       13.255       4.7500       22.750
MRATE5     204   12.034       2.9599       8.7610       6.9400       21.460
USCAN      204   1.2669      0.83719E-01  0.70089E-02   1.1279       1.4129

 CORRELATION MATRIX OF VARIABLES -      204 OBSERVATIONS
PRIME      1.0000
MRATE5    0.92975       1.0000
USCAN    -0.49047     -0.42991       1.0000
             PRIME        MRATE5       USCAN

 COVARIANCE MATRIX OF VARIABLES -      204 OBSERVATIONS
PRIME      13.255
MRATE5     10.019       8.7610
USCAN    -0.14950     -0.10653      0.70089E-02
             PRIME        MRATE5       USCAN

|_STOP

Home [SHAZAM Guide home]