Hello, I have a doubt.
I wanna do a Scatter Plot Matrix. I have 13 variables, but in the results just apper 5 variables in the Scatter Plot Matrix. What can I do for the results appear all variables?
My line program that I'm using is:
proc corr data=phd plots=matrix(histogram);
var P MO pH K Ca Mg Na HAl Al SB CTC V m;
run;
The online help for the Proc Corr plots statement has this bit :
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 plot matrix.
The available scatter-options are as follows:
That means the maximum default is a 5 by 5 matrix (5 VAR and 5 With variables) If you don't provide a WITH then the first 5 Var variables repeat in both roles.
You can override that specifying a number or the value ALL with the NVAR= option for the plot.
proc corr data=phd plots=matrix(histogram nvar=all); var P MO pH K Ca Mg Na HAl Al SB CTC V m; run;
there are separate NVAR and NWITH options. Too many variables may not fit and would require multiple calls to Proc Corr with different variables.
Consider your use as well. You may want to consider use of WITH so the variables on the VAR statement are compared with the WITH . I might guess from your variable names that K Ca mg na al and sb have something in common (elements IIRC). So perhaps your research question wants to compar P Mo ph CTC V and m with those?
adding to the answer above by @ballardw
A 13x13 scatterplot matrix will have cells so small that it will be difficult to read. That is a good reason for SAS to set the default at 5. You might want to re-think what the desired output should be.
Try adding PLOTS=MATRIX(NVARS=ALL) to your proc statement.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!