Hello,
How to get scatter plot for all my variables using proc corr in sas 9.4?
I am applying proc corr to find correlation between response variable(y) and independent variables, It gives me scatter plot for only 9 of my variables. Appreciate for any help.
The documentation states "If the resulting maximum number of variables in the VAR or WITH list is greater than 10, only the first 10 variables in the list are displayed in the scatter plots."
An easy way to circumvent this restriction is to call PROC CORR several times, as follows:
proc corr data=mydata rank plots=scatter(nvar=all);
var T0-T8;
with y;
run;
proc corr data=mydata rank plots=scatter(nvar=all);
var B0-B8;
with y;
run;
proc corr data=mydata rank plots=scatter(nvar=all);
var G0-G8;
with y;
run;
...
So, you want one Scatter Plot for each of your variables?
Proc CORR only deals with numeric variables. How many of your variables are numeric?
And if any specific variable is missing for all values of another there is nothing to plot or calculate correlations with.
What does the LOG look like when you run the code? Best is to show the Log of any procedure you have questions about. Copy the entire code with any notes or messages from the Log and paste into a text box opened on the forum with the </> icon to preserve formatting.
Instead of attachments for code it is better to just copy the code or other text and paste into a text box such as:
proc corr data=mydata rank plots=scatter(nvar=all); var T0-T8 b0-b8 g0-g8 h0-h8 d0-d8 f0-f8 j0-j8 k0-k8; with y; run;
The documentation states "If the resulting maximum number of variables in the VAR or WITH list is greater than 10, only the first 10 variables in the list are displayed in the scatter plots."
An easy way to circumvent this restriction is to call PROC CORR several times, as follows:
proc corr data=mydata rank plots=scatter(nvar=all);
var T0-T8;
with y;
run;
proc corr data=mydata rank plots=scatter(nvar=all);
var B0-B8;
with y;
run;
proc corr data=mydata rank plots=scatter(nvar=all);
var G0-G8;
with y;
run;
...
Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.
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.