BookmarkSubscribeRSS Feed
NT
Calcite | Level 5 NT
Calcite | Level 5

Hello,

 

I am trying to add a small heading into the legend ("Health care associated"), between community and non-nosocomial in the figure attached.

 

Does anyone know how to do it using proc template? This is the codes I used to create this figure.

I would truly appreciate your help.

 

 

 

proc template;

define statgraph survival;

begingraph;

 

layout lattice / rows=2 rowweights=(0.85 0.15) rowgutter=10 columndatarange=union;

layout overlay / xaxisopts=(label="Years"  linearopts=(viewmax=5.5 viewmin=0 tickvaluelist=(0 1 2 3 4 5)))

yaxisopts=(label="Actuarial Survival (%)"  linearopts=(viewmin=0 viewmax=100 tickvaluelist=(10 20 30 40 50 60 70 80 90 100)));

stepplot x=time y=survival / group=stratum name='a';

discretelegend 'a' / location=inside halign=right valign=top down=2 across=1 border=true;

layout gridded / columns=1 border=false autoalign=(bottom);

entry halign=left "P<.001";

endlayout;

endlayout;

 

endlayout;

 

endgraph;

end;

run;


survival test.jpg
2 REPLIES 2
Jagadishkatam
Amethyst | Level 16

Please try the title option in discretelegend

 

proc template;
define statgraph survival;
begingraph;

layout lattice / rows=2 rowweights=(0.85 0.15) rowgutter=10 columndatarange=union;

layout overlay / xaxisopts=(label="Years"  linearopts=(viewmax=5.5 viewmin=0 tickvaluelist=(0 1 2 3 4 5)))

yaxisopts=(label="Actuarial Survival (%)"  linearopts=(viewmin=0 viewmax=100 tickvaluelist=(10 20 30 40 50 60 70 80 90 100)));

stepplot x=time y=survival / group=stratum name='a';

discretelegend 'a' / title='legend' location=inside halign=right valign=top down=2 across=1 border=true;

layout gridded / columns=1 border=false autoalign=(bottom);

entry halign=left "P<.001";

endlayout;
endlayout;
endlayout;
endgraph;
end;
run;

 

Thanks,
Jag
NT
Calcite | Level 5 NT
Calcite | Level 5

Dear Jag,

 

Thank you very much.

 

Best,

 

NT

SAS INNOVATE 2024

Innovate_SAS_Blue.png

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. 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 599 views
  • 0 likes
  • 2 in conversation