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: Call for Content

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!

Submit your idea!

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
  • 4 replies
  • 2488 views
  • 0 likes
  • 4 in conversation