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!
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.
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.
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 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.