Can I add the ending numbers of time series data in GPLOT? For example,
data _;
do t=1 to 100;
x+rannor(1);
output;
end;
run;
symbol i=join;
proc gplot;
plot x*t;
run;
quit;
SAS generates the left one without the ending number of "x," while the right one is from MS Excel with the ending number 4.5 added manually.
Thanks for your consideration.
For example
data _;
do X=1 to 100;
Y+rannor(1);
output;
end;
run;
data ANNO;
retain XSYS '1' YSYS '2' FUNCTION 'label' POSITION '6';
set _ end=LASTOBS;
if LASTOBS;
X=100;
TEXT=catt(Y,4.1 -l);
run;
symbol i=join;
proc gplot data=_ anno=ANNO;
plot Y*X;
run;
quit;
For example
data _;
do X=1 to 100;
Y+rannor(1);
output;
end;
run;
data ANNO;
retain XSYS '1' YSYS '2' FUNCTION 'label' POSITION '6';
set _ end=LASTOBS;
if LASTOBS;
X=100;
TEXT=catt(Y,4.1 -l);
run;
symbol i=join;
proc gplot data=_ anno=ANNO;
plot Y*X;
run;
quit;
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.