Here is the sgplot SAS code
/*------------------------------------------------------------
6) CIF plot + at-risk table BELOW
------------------------------------------------------------*/
proc sgplot data=cif_plot noborder;
step x=stop y=cuminc / group=Cat lineattrs=(thickness=2);
xaxistable n_at_risk /
x=stop
class=Cat
location=outside
title="Number at Risk"
/* separator=none*/
valueattrs=(size=9)
labelattrs=(size=9);
xaxis label="Time (Days)" values=(0 365 730 1095);
yaxis label="Cumulative Incidence ";
keylegend / title=" ";
title "Cumulative Incidence ";
format Cat DiseaseGroup.;
run;
Here is the CIF curves
XAXISTABLE does not do that when I run the example from the documentation.
proc sgplot data=sashelp.class (where=(age < 13));
scatter x=name y=height;
xaxistable age / class=age title="Student Age" location=inside
valueattrs=(color=red)
labelattrs=(color=red)
titleattrs=(color=red);
xaxistable weight height / valueattrs=(color=blue);
run;
Are you using some nonstandard template or style?
Can you share an actual reproducible example? We don't have your CIF_PLOT dataset.
@SeaMoon_168 wrote:
Thanks but I cannot release the data. I used R to fix the issue.
No need to share the actual data. Just some combination of data and code that can be used to replicate the issue.
Nearly 200 sessions are now available on demand in the Innovate Hub.
Watch Now →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.