BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Maha-Albqoor
Fluorite | Level 6

Hello!

I'm new here and trying to learn SAS!

i have to do a domain analysis because I'm interested in a sub-population in a big file.

the problem I'm facing is that this sub-population needs to be defined using two domain variables. Since the statement of this procedure is TABLES DOMAIN * A * B

how can I do it with two domain variables in the same statement?!

 

Thanks,

 

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

With proc freq I would normally use the LIST option to avoid the groupings of two dimensional tables.

 

If you use a tables statement like:

 

tables a*b*c*d /list missing;

which assumes your domain is defined by a and b variables you will get a listing with the values on one line per each level of all of the variables used. Missing will include a missing row for any levels of missing data. If you do not want that then drop it but if you have multiple variables with missing values it may be hard to reconcile why your different tables have diffent n totals.

if you want to make multiple tables for different

 

Tables (a*b)*(c d e f g) /list ;

will create 5 tables with the domain levels of a*b with each of the levels of each variable.

 

How you use the groups is up to you.

View solution in original post

4 REPLIES 4
ballardw
Super User

It may help to provide the entire procedure. There are a number of different procedures that could do "domain" analyis but the syntax and/or how to interpret the results may require a little explanation.

 

Many of the procedures that support table a*b*c syntax will support more levels such as table a*b*c*d. So it may just require adding your other variable to the Tables statement. How to read the result may be a little tricky but knowing which procedure and other options used will help us answer your questions better.

Maha-Albqoor
Fluorite | Level 6

Thank you,

unfortunately, I'm only allowed to do the domain analysis using proc freq procedure (data access restricted by CDC).

Do you mean I still can have the sub-population defined using two domain variables.

Here is more explanation of the sitaution:

I have a sub-population defined by the two variables (place of birth) and (ethnicity), I want to make some frequency tables for this population, such as gae categories, gender, education etc.

How can (place of birth) and (ethnicity) be domain variables in one table statement so I can see the table gives the descriptive statistics of this population?!

 

your help is appreciated!

 

 

ballardw
Super User

With proc freq I would normally use the LIST option to avoid the groupings of two dimensional tables.

 

If you use a tables statement like:

 

tables a*b*c*d /list missing;

which assumes your domain is defined by a and b variables you will get a listing with the values on one line per each level of all of the variables used. Missing will include a missing row for any levels of missing data. If you do not want that then drop it but if you have multiple variables with missing values it may be hard to reconcile why your different tables have diffent n totals.

if you want to make multiple tables for different

 

Tables (a*b)*(c d e f g) /list ;

will create 5 tables with the domain levels of a*b with each of the levels of each variable.

 

How you use the groups is up to you.

Maha-Albqoor
Fluorite | Level 6

THANKS SO MUCHSmiley Very Happy

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 1014 views
  • 4 likes
  • 2 in conversation