BookmarkSubscribeRSS Feed
markpick
Calcite | Level 5

I am working on a program that is incorporating both PROC CORR and PROC REG to verify certain results.  I am running these procedures with the exact same data set and the exact same (standardized) variables. It was my understanding that the output of PROC CORR was specifically using Pearson's correlation coefficient and that the output of PROC REG was the regression coefficient estimate. However, I also was under the impression that, given just two variables, these procedures should give the same output. However, PROC CORR is giving me an estimate of .65 while PROC REG is giving an estimate of .63. 

 
This is with using a data set with roughly 5000 observations. I had done an earlier example with around 20 or so and PROC REG and PROC CORR returned identical outputs. Does the discrepancy above have to do with the increased sample size or is there something else that could potentially explain the discrepancy?
1 REPLY 1
JackieJ_SAS
SAS Employee

I would guess that your issue has to do with the two variables under consideration having different amounts of missing data. 

If neither has any missing data, and both are standardized to have mean zero and standard deviation one, then it is true that the regression coefficient should be equal to the pearson correlation.

 

BUT- if they have different amounts of missing data, the standardization could be throwing things off. The standardization is done with all available non-missing observations for a variable, but this may not be the same set of observations available for another variable. PROC CORR and PROG REG then analyze only those observations that are non-missing for BOTH variables, which could be a different set of observations used for the standardization of each variable.

I suggest you turn on the STD option on the MODEL statement on PROC REG to print standardized betas in the output. In a model with one predictor, the standardized beta should always equal the pearson correlation from PROC CORR.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 138 views
  • 0 likes
  • 2 in conversation