BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
altadata1
Obsidian | Level 7

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

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

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

View solution in original post

2 REPLIES 2
ballardw
Super User

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

altadata1
Obsidian | Level 7

Thank you so much. 

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 793 views
  • 0 likes
  • 2 in conversation