## How to change values on Y axis in proc sgplot, Odds ratio graph

Solved
Occasional Contributor
Posts: 7

# How to change values on Y axis in proc sgplot, Odds ratio graph

Hi, everyone

I am making ODDs ratio graph by using SGPLOT. I am a user of SAS university.

Proc sgplot data=Figure4OR noautolegend;

scatter y=Effect x=OddsratioEST / xerrorlower=LowerCL xerrorupper=UpperCL

markerattrs=(symbol=circlefilled);

refline 0 / axis=x;

xaxis grid;

yaxis grid display=(nolabel) discreteorder=data reverse;

Run;

I got a graph as the attached file.

I would like to change the values in Y axis. (ex. RF_HF_Known 1 vs 0 -> Heart Failure)

I could not find the method.

Could you help me?

Accepted Solutions
Solution
‎09-29-2017 02:30 AM
Super User
Posts: 21,596

## Re: How to change values on Y axis in proc sgplot, Odds ratio graph

Create a format and apply the format to the variable, ideally in the PROC LOGISTIC or whatever procedure you're using to generate the ODDSRATIO.

http://www2.sas.com/proceedings/sugi30/001-30.pdf

``````proc format;
value sample_format
1 = 'Heart Attack'
2 = 'No Heart Attack';
run;

``````

All Replies
Solution
‎09-29-2017 02:30 AM
Super User
Posts: 21,596

## Re: How to change values on Y axis in proc sgplot, Odds ratio graph

Create a format and apply the format to the variable, ideally in the PROC LOGISTIC or whatever procedure you're using to generate the ODDSRATIO.

http://www2.sas.com/proceedings/sugi30/001-30.pdf

``````proc format;
value sample_format
1 = 'Heart Attack'
2 = 'No Heart Attack';
run;

``````
Occasional Contributor
Posts: 7

## Re: How to change values on Y axis in proc sgplot, Odds ratio graph

I used the logistic procedure and ODS output. I could find that there was "Effect" variable and the Text that I would like to change were contents of the variable "Effect".

By changing the contents and using format, I could make what I wanted.

Thank you again!

☑ This topic is solved.