BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
rselukar
SAS Employee

By the way, as I mentioned earlier, the turning points are for the underlying smooth signal (s_level).   You can slightly alter @jacksharp's code to get the plot of turning points of s_level as follows:

 

data all;
    set change turns(keep=n s_level rename=(n=_n s_level=_v));
run;

proc sgplot data=all;
   title Plot of smoothed_value with identified turning points;
   series x=n y=s_level;
   scatter x=_n y=_v/markerattrs=(symbol=starfilled color=red);
run;

Which results in the following plot:

rselukar_0-1669131640845.png

Of course, @jacksharp's way of showing the turning points is much better than my earlier plots.  Thanks!

hhchenfx
Rhodochrosite | Level 12

Thank you all for helping.

It is great code.

HHC