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,
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.
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.
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!
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.
THANKS SO MUCH
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.
Ready to level-up your skills? Choose your own adventure.