The CORR Procedure

Example 1.9 Computing Partial Correlations

A partial correlation measures the strength of the linear relationship between two variables, while adjusting for the effect of other variables.

The following statements request a partial correlation analysis of variables Height and Width while adjusting for the variables Length3 and Weight. The latter variables, which are said to be "partialled out" of the analysis, are specified with the PARTIAL statement.

ods graphics on;
title 'Fish Measurement Data';
proc corr data=fish1 plots=scatter(alpha=.20 .30);
   var Height Width;
   partial Length3 Weight3;
run;

Output 1.9.1 displays descriptive statistics for all the variables. The partial variance and partial standard deviation for the variables in the VAR statement are also displayed.

Output 1.9.1: Descriptive Statistics

Fish Measurement Data

The CORR Procedure

2 Partial Variables:Length3 Weight3
2 Variables:Height Width

Simple Statistics
VariableNMeanStd DevSumMinimumMaximumPartial
Variance
Partial
Std Dev
Length33438.385294.21628130530.0000046.50000  
Weight3348.447510.97574287.215246.2316810.00000  
Height3415.220571.98159517.4995011.5200018.957000.266070.51582
Width345.438050.72967184.893704.020006.749700.073150.27047


When you specify a PARTIAL statement, observations with missing values are excluded from the analysis. Output 1.9.2 displays partial correlations for the variables in the VAR statement.

Output 1.9.2: Pearson Partial Correlation Coefficients

Pearson Partial Correlation Coefficients, N = 34
Prob > |r| under H0: Partial Rho=0
 HeightWidth
Height
1.00000
 
0.25692
0.1558
Width
0.25692
0.1558
1.00000
 


The partial correlation between the variables Height and Width is 0.25692, which is much less than the unpartialled correlation, 0.92632 (in Output 1.9.2). The p-value for the partial correlation is 0.1558.

The PLOTS=SCATTER option displays (in Output 1.9.3) a scatter plot of the residuals for the variables Height and Width after controlling for the effect of variables Length3 and Weight. The ALPHA=.20 .30 suboption requests 80 percent-sign and 70 percent-sign prediction ellipses, respectively.

Output 1.9.3: Partial Residual Scatter Plot

Partial Residual Scatter Plot


In Output 1.9.3, a standard deviation of Height has roughly the same length on the X axis as a standard deviation of Width on the Y axis. The major axis length is not significantly larger than the minor axis length, indicating a weak partial correlation between Height and Width.

Last updated: November 06, 2022