I'm using PROC SGPLOT VLINE statement to make a series plot that plots the frequency of an event over time (by month). Events are sparse, so some months have no events
Given data like below (two failures in January, one failure in February, three failures in March, one failure in June).
data have ;
input FailDate mmddyy10.;
I'm plotting like:
proc sgplot data=have;
xaxis type=time interval=month ;
vline FailDate / stat=freq markers;
format FailDate yymon. ;
The resulting plot shows four points (Jan, Feb, Mar, Jun). I would like it to show zeroes for April and May, because there were no events.
It feels like there should an easy way to do this? SAS knows that it has a time axis, and it knows it's counting FailDate by month.
If there isn't an easy way I know I can calculate the counts myself, and then force in rows with count=0 and then user a series plot to plot the line. But I'd be happy if there were some option like how PROC TABULATE can use preloadfmt order=data missing=0 to force in zeroes for empty categories.
In reality I'll have a spaghetti plot, with one line for each group.
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.