BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
pearson101
Calcite | Level 5

Hello,

           I have a dataset with a few missing dates. I am trying to plot time(year/month) vs rates. When I plot my graph using sgplot grouping by year, it produces icons of all the relevant years as well as the missing dates (in grey) in the legend. There is no grey line plot. Is there a way of fixing this if I am not able to correct the missing dates? How can I remove the grey icon that shows missing dates? is it the proper way to solve it?

1 ACCEPTED SOLUTION

Accepted Solutions
Rick_SAS
SAS Super FREQ

On the SERIES statement, include the NOMISSINGGROUP option, which specifies that missing values of the group variable are not included in the plot.

View solution in original post

5 REPLIES 5
pearson101
Calcite | Level 5

Here is the code I use

```

proc sgplot data=mean_kola_num;
styleattrs datacontrastcolors=(blue red green brown);
series x=month_name y=mean_t_b / group=annee markers
legendlabel="original" ;
xaxis label='Month';
yaxis label='Average';
run;

```

Reeza
Super User
You can add a WHERE statement to filter out missing values?
Fill in the variable name as needed.

Where not missing(variable) and not missing(variable) and not missing(variable);

pearson101
Calcite | Level 5

Thank you, would that go in the sgplot section?

Reeza
Super User
Yes, WHERE statements generally go after the PROC statement (good practice) and can go in almost every PROC/DATA STEP in SAS.
Rick_SAS
SAS Super FREQ

On the SERIES statement, include the NOMISSINGGROUP option, which specifies that missing values of the group variable are not included in the plot.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 2306 views
  • 0 likes
  • 3 in conversation