Hello,
I want to execute a proc boxplot to get information on the dispersion of a continuous variable TI_NUM for each category of a variable "Groupe_villes_2". I ran this code :
proc boxplot data=PACIFICA.Pacifica_04_v3;
plot TI_NUM*groupe_villes_2 / maxpanels=15;
run;
But when I do so I get this output for the first plot :
when the variables "groupe_villes_non_estimated" and "groupe_villes_0_2nd" are two (and only two) levels of the variable "groupe_villes_2".
You will find attached the output of the proc summary confirming the number of level of the categorical variable "groupe_villes_2". You will also find the output of the proc boxplot.
Thank you for your help !
NB : I don't have this error with this code :
PROC SGPLOT DATA= HAVE;
VBOX TI_NUM / category = groupe_villes_2;
RUN;
But there are so many levels that I can't see anything on the plot. I tried :
ods graphics / DATASKINMAX=10;
PROC SGPLOT DATA=PACIFICA.Pacifica_04_v3;
VBOX TI_NUM / category = groupe_villes_2 ;
RUN;
but it doesn't work, I think I don't know how ods graphics works...
PROC BOXPLOT requires the data to be sorted by the x-axis variable. PROC SGPLOT does not require this.
PROC BOXPLOT requires the data to be sorted by the x-axis variable. PROC SGPLOT does not require this.
Another thing to do would be to partition the data set with an indexing variable, and then use a BY statement. This would produce a set of boxplots for each partition, so that the overlap and readability are not a problem. The issue then becomes being able to compare results in different sets. For this dataset, where the dependent variable is a count, the Y axis should be roughly the same for all of the plots. If not, you can use SGPLOT to set the Y axis range. I don't see an option for this in PROC BOXPLOT.
SteveDenham
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.