BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
ChristosK
Quartz | Level 8

ods graphics on;
proc logistic data=HEERDT.VPICU_label plots(only)=effect(x=Ind_SBP1 connect yrange=(0,1) cl );
model VP24_VasoNE_012(ref='0') = Ind_SBP1 |Ind_SBP1 / nooddsratio link=glogit ct covb clodds=wald;
where VP24_VasoNE_012 NE 1;
title '';
run;

 

 

Above is the code I used to contruct a graph  in an ordinal logistic regression, with a quadratic transformation of a continuous independent variable.

I didn't seem to have many choices here in terms of changing the title, getting rid of gridlines, adjusting the axes etc.

 

Is there a better way using proc sgplot or otherwise?

 

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

You can get the data for that graph using ODS and then use PROC SGPLOT to customize it as desired.

View solution in original post

6 REPLIES 6
Reeza
Super User

You can get the data for that graph using ODS and then use PROC SGPLOT to customize it as desired.

ChristosK
Quartz | Level 8

Thanks for that Reeza.

Its working beautifully although the graphs from the logistic output and sgplot look a little different.

 

If I needed to choose specific colors for the estimate and boundary lines as well as shading, how would one do that?

Reeza
Super User

Depending on how complex your SG procedure is, most statements have options for specifying line colors and such. 

Or you can use Attribute Maps:

https://blogs.sas.com/content/iml/2017/01/30/auto-discrete-attr-map.html

 

 

ChristosK
Quartz | Level 8

Ok, so I am playing about with some choices I found.

 

 

proc sgplot data = QuadSBPVp ;
Title "Severe Vasolegia up to 24h by Induction SBP";
band x=Ind_SBP1 lower=l upper=u;
YAXIS label = "Estimated probably of Severe Vasoplegia in 1st 24 hours";
series x = Ind_SBP1 y = fit/ curvelabel = "Predicted value" lineattrs=(color= Blue pattern=dash);;
series x = Ind_SBP1 y = u/ curvelabel = "95% Upper CI" lineattrs= (color=purple pattern=dash);
series x = Ind_SBP1 y = l/ curvelabel = "95% Lower CI"lineattrs = (color = yellow pattern = solid thickness =5);
run;

 

How do I assign a specific colour to the band (the shaded area between the CI's?

Besides standard colours, how to I specify an exact colour, eg:

Colour 1 (blue): c100 m57 y0 k2
Colour 2 (green): c71 m26 y100 k25
Colour 3 (Pink): c10 m70 y0 k0
Colour 4 (gold): c0 m50 y100 k0
Colour 5 (light blue): c80 m0 y0 k0
Colour 6 (orange): c0 m80 y100 k0

 

These are critical to get right as they are the only colours the journal I am aiming for will accept.

Reeza
Super User

Use Hex coding with CX in front of it when specifying colours. 

 

Color = CXffffff

 

You can consider a BAND statement for your confidence limits, then you can specify a shading to be filled in between the lines. 

ChristosK
Quartz | Level 8

@Reeza wrote:

Depending on how complex your SG procedure is, most statements have options for specifying line colors and such. 

Or you can use Attribute Maps:

https://blogs.sas.com/content/iml/2017/01/30/auto-discrete-attr-map.html

 

 


 

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

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

View all other training opportunities.

Discussion stats
  • 6 replies
  • 2494 views
  • 1 like
  • 2 in conversation