Hi...I a new to using the Proc Genmod procedure and I am using a model with the Class Variables Area and AgeGroup. After running the program, the output revealled that some of the AgeGroups can be combined. Is there a simple way of combining these AgeGroups together similiar to adding ref=<value> to the Class statement without having to this in the dataset before re-running the program. Thanks in Advance.
One generic approach for this type of issue is to not create specific variables for age but assign a format that creates the groups needed. Then you make a custom format with the desired groupings and assign that format during the procedure execution.
Example format code:
proc format;
value age5groups
10 - 25 = '10 to 25'
26 - 35 = '26 to 35'
36 - 45 = '36 to 45'
46 - 55 = '46 to 55'
55 - high='56+';
value age3groups
10 - 25 = '10 to 25'
26 - 45 = '26 to 45'
46 - high = '46+';
run;
Assuming you age is integer years. Use the different format in the procedure by adding:
format age age5groups. ;
or
format age age3groups. ;
One generic approach for this type of issue is to not create specific variables for age but assign a format that creates the groups needed. Then you make a custom format with the desired groupings and assign that format during the procedure execution.
Example format code:
proc format;
value age5groups
10 - 25 = '10 to 25'
26 - 35 = '26 to 35'
36 - 45 = '36 to 45'
46 - 55 = '46 to 55'
55 - high='56+';
value age3groups
10 - 25 = '10 to 25'
26 - 45 = '26 to 45'
46 - high = '46+';
run;
Assuming you age is integer years. Use the different format in the procedure by adding:
format age age5groups. ;
or
format age age3groups. ;
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!
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.