Hi I forgot to mention that I tried both statement which were listed for YAXISTABLE, and got error message like below:
ERROR 22-322: Syntax error, expecting one of the following: ;, ATTRID, CLASS, CLASSDISPLAY, CLASSORDER, COLORGROUP, DROPONMISSING, INDENT, INDENTWEIGHT, LABEL, LABELATTRS,
LABELPOS, LOCATION, NAME, NOLABEL, NOMISSINGCHAR, NOMISSINGCLASS, NOSTATLABEL, PAD, POSITION, SEPARATOR, STAT, STATLABEL, TEXTGROUP, TEXTGROUPID, TITLE,
TITLEATTRS, VALUEATTRS, X, X2AXIS.
ERROR 76-322: Syntax error, statement will be ignored.
The syntax I used is like this:
proc sgplot data=su;
step x=time y=survival /group=stratum name='survival' lineattrs=(thickness=2) ;
scatter x=time y=surv /GROUP=stratum markerattrs=(symbol=circlefilled size=2);
xaxistable atrisk /class=stratum x=tatrisk colorgroup=stratum labelpos=left ValuesHAlign=right
VALUEATTRS=(size=9 weight=bold) LABELATTRS=(size=9 weight=bold);
keylegend 'survival' /location=inside position=bottomleft across=1;
xaxis min=0 max=24 offsetmax=0.05 values=(0 to 24 by 6) valueshint label='Time'
labelattrs=( size=9pt weight=bold) valueattrs=( size=9pt weight=bold);
yaxis offsetmin=0.02 min=0 offsetmax=0.02 max=1.0
labelattrs=( size=9pt weight=bold ) valueattrs=( size=9pt weight=bold);
I also tried to convert variable 'tatrisk' to character type to see the alignment can be set, however xaxistable function only accept numeric variable.
Any other suggestions- Thank you!
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.