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

Hi!  I have this logistic regression code w/ Odd Ratio Plot.

 

I need to  output/ print just the Odds Ratio Plot in a jpg, tiff, or psd w/  300 dpi for use in a manuscript.

I am really unclear how to use ODS...  I use ods rtf  a lot for just writing in word...but the resolution is low.  What are my other options?

 

proc logistic data=asthma.edip_vitals simple
plots(only)=oddsratio (cldisplay=line
                        order=ascending
                        type=horizontalstat
                        range=(0.5,1.5));title 'Family Structure Effects on ED/Inpatient Utilization';
class household(ref='MM') structure (ref='Married Male')marital_status1 (ref='Married') sponsex1 (ref='Male')
mult_dependents (ref='No') new_race1 (ref='White')pay_grade1 (ref='Enlisted: E1-E5')branch (ref='Army')
agegroup (ref='0') education (ref='HS or less')sex_d (ref='0')/ param=ref;
model utilization (event='1')=structure agegroup mult_dependents new_race1 pay_grade1 education;
oddsratio structure;
run;

 

 

Help is appreciated!!

 

1 ACCEPTED SOLUTION

Accepted Solutions
PGStats
Opal | Level 21

This is where I would start :

 

ods listing gpath="c:\myGraphs" image_dpi=300 style=Journal;
ods graphics / imagename="FamilyStructureEffectsOnED_InpatientUtilization" width=10cm height=8cm reset=index border=off;
title; /* Journals usually don't need figure titles */
proc logistic data=asthma.edip_vitals simple
plots(only)=oddsratio (cldisplay=line
                        order=ascending
                        type=horizontalstat
                        range=(0.5,1.5));
class household(ref='MM') structure (ref='Married Male')marital_status1 (ref='Married') sponsex1 (ref='Male')
mult_dependents (ref='No') new_race1 (ref='White')pay_grade1 (ref='Enlisted: E1-E5')branch (ref='Army')
agegroup (ref='0') education (ref='HS or less')sex_d (ref='0')/ param=ref;
model utilization (event='1')=structure agegroup mult_dependents new_race1 pay_grade1 education;
oddsratio structure;
run;

With a bit of luck, you will get an acceptable Figure. Most often, I end up having to generate the figure with SGPLOT in a subsequent step. So far I have managed to stay away from the complexity of custom templates, except for heat maps.

PG

View solution in original post

5 REPLIES 5
Reeza
Super User

In my experience it's unlikely the SAS plot will be suitable for publication. 

 

You'll need to customize the plot, including the title, legend, axis. You can do this via proc template, or develop your own code. There are a lot of samples out there to help get you started. 

PGStats
Opal | Level 21

I beg to differ on that statement. My SAS SG graphs are always accepted for publication. I often have to adjust font sizes, resolution, line thickness, aspect ratio, etc. to meet journal requirements, but, in the end, the graphs are accepted.

PG
Reeza
Super User

@PGStats wrote:

I beg to differ on that statement. My SAS SG graphs are always accepted for publication. I often have to adjust font sizes, resolution, line thickness, aspect ratio, etc. to meet journal requirements, but, in the end, the graphs are accepted.


 

 

I agree - you need to adjust the fonts, line thickness, resolution etc. I usually use proc template to make these modifications on the procedure template so I can run PROC PHREG and get a survival curve I can include in a journal publication. 

Given the code the OP provided, those plots wouldn't be accepted in my experience. 

PGStats
Opal | Level 21

This is where I would start :

 

ods listing gpath="c:\myGraphs" image_dpi=300 style=Journal;
ods graphics / imagename="FamilyStructureEffectsOnED_InpatientUtilization" width=10cm height=8cm reset=index border=off;
title; /* Journals usually don't need figure titles */
proc logistic data=asthma.edip_vitals simple
plots(only)=oddsratio (cldisplay=line
                        order=ascending
                        type=horizontalstat
                        range=(0.5,1.5));
class household(ref='MM') structure (ref='Married Male')marital_status1 (ref='Married') sponsex1 (ref='Male')
mult_dependents (ref='No') new_race1 (ref='White')pay_grade1 (ref='Enlisted: E1-E5')branch (ref='Army')
agegroup (ref='0') education (ref='HS or less')sex_d (ref='0')/ param=ref;
model utilization (event='1')=structure agegroup mult_dependents new_race1 pay_grade1 education;
oddsratio structure;
run;

With a bit of luck, you will get an acceptable Figure. Most often, I end up having to generate the figure with SGPLOT in a subsequent step. So far I have managed to stay away from the complexity of custom templates, except for heat maps.

PG
Reeza
Super User

It's really common with survival plots - which is why SAS has a bunch of macros that show users how to customize the template. It's actually easier than I thought to customize. Writing SGTemplate code from scratch - not my cup of tea for sure. 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 5 replies
  • 1889 views
  • 3 likes
  • 3 in conversation