Hello,
I'm using proc surveymeans to estimate mean of incomes of people with different disabilities. I need to subgroup them by several demographic indicators like gender (2 categories), age groups (3 categories), education (3 categories), and estimate incomes by different combinations of subgroups. for example:
I want to estimate the income for different categories of disability groups when gender=1 (male), age_group=2 (35-45), and education= 1 (bachelor+). I don't know how to do it using the syntax below.
proc surveymeans data=mydata varmethod=BRR mean clm median;
domain disability;
weight myweight;
repweights bsw1-bsw500;
var income;
run;
Thank you,
Altadata
What do you think that DOMAIN statement does in your code? Domains are "subgroups" for analysis. You can place multiple variables on the domain and get analysis for each. Or if you need nested combinations of categories use the * between variable names.
Domain disability*gender; will do the genders within each disability level.
or
Domain disability*gender*age_group; age within gender within disability
You can use () to group variables:
Domain disability*(gender age_group); gender within disability and age_group within disability.
You may find it convenient to send the output to a data set to select subsets of the results for reporting.
Use results you want
What do you think that DOMAIN statement does in your code? Domains are "subgroups" for analysis. You can place multiple variables on the domain and get analysis for each. Or if you need nested combinations of categories use the * between variable names.
Domain disability*gender; will do the genders within each disability level.
or
Domain disability*gender*age_group; age within gender within disability
You can use () to group variables:
Domain disability*(gender age_group); gender within disability and age_group within disability.
You may find it convenient to send the output to a data set to select subsets of the results for reporting.
Use results you want
Thank you so much.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.