12-08-2011 08:32 AM
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).
12-08-2011 08:54 AM
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,
12-08-2011 10:10 AM
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.
12-08-2011 11:12 AM
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.
12-08-2011 05:33 PM
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.