- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Is there a way to create a table displaying the frequencies of multiple variables compared to one variable using PROC FREQ? I'm using SAS 9.4.
Best,
Brittany Coote
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
The following code uses a data set you should have available. It does something similar to what you show but with out example input data it isn't obvious whether we need to sum something or are using counts. Run this and see if the results are at all like what you want.
proc tabulate data=sashelp.cars; class make ; class type; class origin; tables type origin, (all='All makes' make)*( colpctn n) ; run;
There are options and things that can change things like row or column headings, formats of values shown. ODS style choices or overrides in the code can remove cell boundaries, change background/foreground colors, fonts and lots of stuff.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Can you demostrate in a table what do you mean?
Please post a sample data and the frequency table you want to achive.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Do you mean?
proc freq data=have;
tables x*y;
run;
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
That is the format I am using, but I am trying to avoid having to do it for multiple variables. Is there a way to just compare multiple variables to one variable via frequencies?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Are you looking for something like?:
proc freq data=sashelp.class; tables sex*(age height weight); run;
Art, CEO, AnalystFinder.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Is there a way to have an statement similar to this one come up with only one table rather than multiple tables? kind of like a demographics table comparing 2 different population (i.e. Smokers and Non Smokers).
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Yes there is, but post your question in a new thread as this one is already closed. Plus, in the new thread you post, include some sample data (in the form of a datastep), as well as what you want the output to look like.
Art, CEO, AnalystFinder.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
This table illustrates what I would like to display.
Thank you for your assistance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
The following code uses a data set you should have available. It does something similar to what you show but with out example input data it isn't obvious whether we need to sum something or are using counts. Run this and see if the results are at all like what you want.
proc tabulate data=sashelp.cars; class make ; class type; class origin; tables type origin, (all='All makes' make)*( colpctn n) ; run;
There are options and things that can change things like row or column headings, formats of values shown. ODS style choices or overrides in the code can remove cell boundaries, change background/foreground colors, fonts and lots of stuff.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
How do I get 2 variables and 1 column of frequency (called number of subjects) into a table? Right now, I have the variables ID and site and I need number of patients without the frequency heading.
So the table would be
ID Site number of patients (given by freqency)?