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

Hi all,

I am trying to create two kernel density curves comparing month counts between men and women. Basically I've created two month count variables (monthmale and monthfemale) such that the former only populates for male subjects and the latter for female subjects. I used the following code:

proc sgplot data=monthcount;

xaxis label="Months" min=0 max=24;

yaxis label="Relative Probability of Occurrence";

density monthmale /type=kernel ;

density monthfemale/type=kernel ;

run;

The curves generate with no problem. The issue is that the maximum number of months a person can have is 24, so I'd like the axis to go from 0-24. However, even with the option I used above for xaxis, the axis goes from 0 to 25.

Any help is much appreciated.

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

Does your axis show all values from 0 to 25 or just 0, 5, 10, 15, 20 and 25? If the later it is because the algorithm for fitting in the space you have available and rounding has picked 25 as an upper bound. You may need to provide more controls on the axis such as values= 0 to 24 by 1.

View solution in original post

1 REPLY 1
ballardw
Super User

Does your axis show all values from 0 to 25 or just 0, 5, 10, 15, 20 and 25? If the later it is because the algorithm for fitting in the space you have available and rounding has picked 25 as an upper bound. You may need to provide more controls on the axis such as values= 0 to 24 by 1.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 627 views
  • 0 likes
  • 2 in conversation