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.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.