If I graph daily stock prices following this example http://support.sas.com/kb/35/169.html (which is monthly data, despite the title on the chart), there are gaps caused by weekend days and other days with no data. Can I tell PROC SGPLOT to ignore the missing data while still using SERIES plots with XAXIS TYPE=TIME? (I'm at 9.3).
Thanks!
When you say, "ignore", do you want the series line to be connected through the missing days or do you want the line to break at the missing days? If you want the line to break, you can use the BREAK option on the SERIES plot.
As an aside, because you have SAS 9.3, you can now do that stock example using a true HighLow plot.
Hope this helps,
Dan
I don't want gaps between the bars. I figure I could set TYPE=DISCRETE, but then I lose some of the niceties that go along with a defined time axis.
P.S. I noticed HighLow in the doc yesterday, actually. Will give it a try.
If the x values are real sas date values, data is plotted in its correct scaled location, so you will get the gaps when stock exchange is closed. If you make the X axis discrete, each value will be plotted individually with equal spacing. But you will lose the date formatting for the x axis, and each tick value will be shown. This is true for HighLow plot too.
If the missing values are to be "compressed" out of the x-axis, the x-axis is no longer on a continuous linear scale. It is not clear how this should be done. Maybe you could use a COLUMNLATTICE where the days are classified by their week name to get what you need. You can suppress the cell borders, etc.
If available to you, PROC GPLOT using a creative AXIS statement listing values of the days with data might work. You would get a warning in the log about non-uniform values on your ticks but might accomplish what you want.
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!
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.