BookmarkSubscribeRSS Feed
DerylHollick
SAS Employee

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!

4 REPLIES 4
DanH_sas
SAS Super FREQ

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

DerylHollick
SAS Employee

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.   

Jay54
Meteorite | Level 14

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.

ballardw
Super User

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.

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 2598 views
  • 0 likes
  • 4 in conversation