turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- SAS Programming
- /
- SAS Procedures
- /
- domain analysis question please!

Topic Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

06-12-2017 04:04 PM

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

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Maha-Albqoor

06-12-2017 04:39 PM

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.

All Replies

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Maha-Albqoor

06-12-2017 04:19 PM

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.

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to ballardw

06-12-2017 04:29 PM

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

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Maha-Albqoor

06-12-2017 04:39 PM

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.

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to ballardw

06-12-2017 04:43 PM

THANKS SO MUCH