I want to plot two time series and interpolate those points that show together. The two time series are part of one original series. The difficulty here is that the two time series shows up alternatively. For example, the first series may be from 8:30 to 9:30 then the second series show up from 9:30 to 10:30 and so on so forth. I only want to interpolate the points that belong to the same series and show up consecutively. Simply using symbol statement is problematic because it will interpolate all data points that belong to the same series altogether. I hope I make myself clear. Thank you for your help.
Your time series already have missing values. Is this what you need?
infile "&sasforum\datasets\example.txt" firstobs=2;
input Obs time :time10. price1 price2;
format time time10.;
proc sgplot data=ex;
series x=time y=price1 / markers break lineattrs=(pattern=solid) markerattrs=(symbol=circle);
series x=time y=price2 / markers break lineattrs=(pattern=solid) markerattrs=(symbol=circle);
Thank you Robert. I tried your code. It works. But I want to use interpol=steplj to link those points. Then it does not work. As you can see these are stock price series. The market is a limit order market where price lasts as long as it is not replaced with better ones.
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.
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.