BookmarkSubscribeRSS Feed
tigfem
Calcite | Level 5
I have a question using Proc CORR. I used the following codes (the following is just an example) to find the Spearman correlations between variables:

Proc CORR data=use Spearman;
Var A B C D E ... L /*12 variables in total*/;
With F G H;
Run;

However, the result I got for correlations between A and F, or G, or H are slightly different from what I got if I use only:

Proc CORR data=use Spearman;
Var A;
With F G H;
Run;

From the SAS manual, I couldn’t tell why as the calculation formula would be the same for these correlations in both cases. Could anyone please shed some light?

Thank you!
3 REPLIES 3
Doc_Duke
Rhodochrosite | Level 12
This shouldn't happen. Seems like something to take to tech support.

If your data set is really large, you could be running into memory problems in the first example. However, I would expect a message in the log if that happened.

If you can reproduce the problem with some of the sample datasets that are provided with the SAS install, that will speed up the tech support resolution.
tigfem
Calcite | Level 5
Hi Doc,

Thanks for the reply. I did work with large datasets. I didn't notice warning of memory in the log though - which might very well be the case. I will try smaller datasets and ask again if this problem persists.

Thanks again.
Dale
Pyrite | Level 9
Doc is right if the code which was submitted is as shown in the initial post. However, if the NOMISS option was specified on either or both invocations of PROC CORR, then if there are any observations with missing values on {B,C,D,E,I,J,K,L} that do not have missing values in the set {A,F,G,H}, you would expect different results. So, the OP should confirm that (s)he did not include the NOMISS option in any of the invocations of PROC CORR.

If the NOMISS option was not employed, then the results are not expected and the problem should be reported to SAS tech support.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 1141 views
  • 0 likes
  • 3 in conversation