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

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;

 

Jason2020_0-1625148317385.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
JeffMeyers
Barite | Level 11
You x axis is discrete instead of linear. Add TYPE=linear to your x axis statement.

View solution in original post

2 REPLIES 2
JeffMeyers
Barite | Level 11
You x axis is discrete instead of linear. Add TYPE=linear to your x axis statement.
Jason2020
Obsidian | Level 7

That was a simple solution. Thank you very much.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 936 views
  • 4 likes
  • 2 in conversation