Hello,
I ran a PROC ANOVA and my box plot is coming out with the three age groups I used in the analysis, but the age group that should be "first" which includes the youngest patients is in the middle instead of on the far left. So the plots are 3-6 months, ❤️ months, and >6 months. Is there a way to switch the ❤️ months and 3-6 months so looking at the plots you are looking at them by age increasing.
Also, if this helps, the age groups are formatted into the 3 groups, and there is only one age variable in the data set.
I know it might be difficult to determine since I am not giving screenshots but I dont have SAS on my laptop, sorry!
Thank you!
My guess is you have a character variables as your class variable. Use a numeric variable and then apply a format to have it show the description you'd like.
The default for ORDER appears to be FORMATTED, when INTERNAL is probably what you were expecting. You may just need the ORDER depending on what your data/code looked like, which we have no idea.
data class;
set sashelp.class;
if age < 12 then
age_group=1;
else if age < 15 then
age_group=2;
else if age >=16 then
age_group=3;
label age_group='Age Group';
run;
proc format ;
value age_fmt 1='Pre-Teen' 2='Teen' 3='Driver';
run;
proc anova data=class order=internal;
class age_group;
model weight=age_group;
format age_group age_fmt.;
run;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.