I am having problems with my code. I have formatted my data yet when I run my sgplot the correct formats do not show. Is there anyway I can get the yaxis labels on the graph to be formatted correctly?
ODS OUTPUT "ODDS RATIOS"=ORCI;
PROC LOGISTIC DATA= HS DESCENDING;
class heat_stroke (ref='0') LOS (ref='1') AGE_GROUP (ref='2') SEX (ref='1')
installation (ref='1') RACE_CODE (ref='1') branch (ref='1') pay_grade
(ref='1')/ param=ref;
MODEL heat_stroke= SEX AGE_GROUP pay_grade RACE_CODE branch installation LOS;
RUN;
DATA ORCI;
SET ORCI;
EFFECT=UPCASE(EFFECT);
RUN;
TITLE "SGPLOT:FOREST PLOT";
PROC SGPLOT DATA=ORCI;
SCATTER X=ODDSRATIOEST Y=EFFECT / XERRORLOWER=LOWERCL
XERRORUPPER=UPPERCL
MARKERATTRS=OR
(SYMBOL=DIAMONDFILLED SIZE=8);
REFLINE 1 / AXIS=X;
XAXIS LABEL='OR AND 95% CI' MIN=0;
YAXIS LABEL='COVARIATES';
RUN;
From what I can see, the yaxis variable EFFECT is not formatted. How would you like to have the values displayed?
sex
1='Male'
2= 'Female;
pay_grade
1= 'E1-E4'
2 ='E5-E9'
3 ='O1-O4'
4= 'O5-O9'
5= 'W1-W4'
6= 'Cadet'
Also, is there any reason you want to create this graph with PROC SGPLOT?
You can do it directly in PROC LOGISTICS as in the documentation example below
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.