Greetings,
I am using proc sgplot to model the relationship between bone level and follow up years in two treatment groups (A/B). The issue I have is that the tick marks of the x-axis are not spaced right. In other words, the 1 year and 6 years are spaced equally. I hope someone can show me how to space the marks so that they are correlated with the number of years. I included below a sample of my data, the program I used, and the resulting figure.
Thank you.
subject group followup level
02 A 1.0 4.7
02 A 4.5 4.6
02 A 6.0 4.9
02 A 0.0 1.6
03 A 2.0 2.3
03 A 6.0 1.4
03 A 0.0 1.5
07 B 1.0 1.1
07 B 2.0 1.4
07 B 4.5 1.3
07 B 6.0 1.3
07 B 0.0 1.1
08 A 2.0 1.0
08 A 4.5 1.0
proc sgplot data=p1;
vline followup / response=level group=group
stat=mean limitstat=stderr lineattrs=(thickness=6px);
yaxis label="Bone Level (mm)"
valueattrs=(size=18pt) labelattrs=(size=20pt weight=bold);
xaxis discreteorder=unformatted label="Follow up (years)"
valueattrs=(size=18pt) labelattrs=(size=20pt weight=bold);
keylegend /location=inside valueattrs=(size=18pt)
title="" titleattrs=(size=16pt);
run;
That was a simple solution. Thank you very much.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.