I am sorry I thought I put the code but it seems disappeared after I put the picture... I am not sure how to use this page well. Anyway, this is the code:
proc sgpanel data = graph2; panelby natvty / columns=1; bubble x= foreign y = unemploy size = count /group = educa datalabel = peio1ocd ; ROWAXIS min=0 max=30; refline mforeign / axis=x; refline munemploy; format peio1ocd peio1ocd.; run;
I am not sure what you mean... I know my interpretation is not right...?
5010 5011 * merge file; 5012 data graph2; 5013 merge educa(in=x) graph1; 5014 by peio1ocd; 5015 if x; 5016 if educa = "high school" then do; 5017 format peio1ocd ""; __ 85 200 76 ERROR 85-322: Expecting a format name. ERROR 200-322: The symbol is not recognized and will be ignored. ERROR 76-322: Syntax error, statement will be ignored. 5018 end; 5019 5020 run; NOTE: The SAS System stopped processing this step because of errors. WARNING: The data set WORK.GRAPH2 may be incomplete. When this step was stopped there were 0 observations and 10 variables. WARNING: Data set WORK.GRAPH2 was not replaced because this step was stopped. NOTE: DATA statement used (Total process time): real time 0.00 seconds cpu time 0.00 seconds
No, don't format the value to "", as that will not do what you want. Literally, set the peio1ocd value in the data step to "" if the previous peio1ocd value is the same. This data step should create a temporary data set that you can use with your SGPLOT to drop the labels.
The reason that the missing value did not affect your plot is that the column was used only for the data labels. The X, Y, SIZE, and GROUP roles control the actual plotting for the BUBBLE plot. In general, missing values in a DATALABEL column are not drawn. That is how you can control what labels are drawn in your plot.
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.