Hello,
I am plotting trends in odds ratio using proc sglot but the x-axis will not display all the years. I used "values" and "displayvalues" but they do not seem to work.
Please, kindly assist.
Thank you.
proc sgplot data=Females ;
format Health_cost_health_insur typeFmt.;
scatter y=Odds_ratio x=Year /group=Health_cost_health_insur yerrorlower=LL yerrorupper=UL markerattrs=(symbol=diamondfilled);
refline 0 / axis=y;
title 'Cherry-Picking Violation by Provider Designation';
xaxis grid
values=(2013 2014 2015 2016 2017 2018 2019)
Valuesdisplay=("2013" "2014" "2015" "2016" "2017" "2018" "2019" );;
yaxis grid discreteorder=data ;
xaxis display=ALL INTERVAL= Year;
keylegend / title="Health Coverage Status" location=outside;
title 'Trend in Health Coverage and Health Cost in Females Compared to Males';
xaxis label="Year";
yaxis label="Adjusted Odds Ratio";
run;
You have two XAXIS statements. When there are multiple axis statements affecting the same axis only the LAST one seems to be applied.
Combine the two into a single XAXIS and I think your problem will be fixed.
You really only the the VALUESDISPLAY to show something quite different than the formatted value. It might make sense if you were doing something like:
xaxis grid values=(2013 2014 2015 2016 2017 2018 2019) Valuesdisplay=("Baseline" "2014" "2015" "Intervention" "2017" "2018" "Evaluation" );
with something simple like year I would normally not bother with Valuesdisplay
You have two XAXIS statements. When there are multiple axis statements affecting the same axis only the LAST one seems to be applied.
Combine the two into a single XAXIS and I think your problem will be fixed.
You really only the the VALUESDISPLAY to show something quite different than the formatted value. It might make sense if you were doing something like:
xaxis grid values=(2013 2014 2015 2016 2017 2018 2019) Valuesdisplay=("Baseline" "2014" "2015" "Intervention" "2017" "2018" "Evaluation" );
with something simple like year I would normally not bother with Valuesdisplay
Thank you so much! I am most grateful.
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.