Help using Base SAS procedures

domain analysis question please!

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 16
Accepted Solution

domain analysis question please!

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,

 


Accepted Solutions
Solution
‎06-12-2017 04:42 PM
Super User
Posts: 11,343

Re: domain analysis question please!

Posted in reply to Maha-Albqoor

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


All Replies
Super User
Posts: 11,343

Re: domain analysis question please!

Posted in reply to Maha-Albqoor

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.

Occasional Contributor
Posts: 16

Re: domain analysis question please!

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!

 

 

Solution
‎06-12-2017 04:42 PM
Super User
Posts: 11,343

Re: domain analysis question please!

Posted in reply to Maha-Albqoor

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.

Occasional Contributor
Posts: 16

Re: domain analysis question please!

THANKS SO MUCHSmiley Very Happy

☑ This topic is solved.

Need further help from the community? Please ask a new question.

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