Help using Base SAS procedures

PROC FREQ Question

Accepted Solution Solved
Reply
New Contributor
Posts: 4
Accepted Solution

PROC FREQ Question

HI everyone,

I am trying to create a report using proc freq:

PROC FREQ DATA=WORK.PICKSTA ORDER=FREQ FORMCHAR (1,2,7)='   ';

TABLE PART*WBC / OUT=WORK.FREQWBC NOPCT NOROW NOCOL;     

Output:                                                                                                                       

PART          WBC                                                                                                                                                                                                                                  

Frequency     I        P        S        A        J        K        D        H        C        F        E          Total                                                                                                                          

RE539279           48        1        7        0        0        0        0        0        0        0        0       56                                                                                                                          

AM106627           52        0        0        0        0        0        0        0        0        0        0       52                                                                                                                          

AL213212           35        0        1        0        0        0        0        0        0        0        0       36                                                                                                                          

AL172780           16        0        2        0       12        0        0        0        0        0        0       30

   

Is it possible to create a similar output but additionally use subgroups? The output should be:

´

PART         Subgoup    WBC                                                                                                                                                                                                                                  

Frequency               I     P     S        A        J        K        D        H        C        F        E      Total                                                                                                                          

RE539279     A         48     1     7        0        0        0        0        0        0        0        0       56

             B          0     1     0        0        0        0        0        0        0        0        0       1                                                                                  

AM106627     A         52     0     0        0        0        0        0        0        0        0        0       52   

             C          0     1     0        0        0        0        0        0        0        0        0       1   

             D          0     1     0        0        0        0        0        0        0        0        0       1     

I tried to use the option LIST but this is not what I want. I need a table like above, where I have data displayed in a matrix form.

Is there a possibility to create such a table?   

Thanks!!                                                                                     


Accepted Solutions
Solution
‎11-28-2013 08:50 AM
Super Contributor
Posts: 339

Re: PROC FREQ Question

Posted in reply to Vince28_Statcan

Here's the link to my original question with Ballardw's responses

https://communities.sas.com/thread/48565

View solution in original post


All Replies
Super Contributor
Posts: 339

Re: PROC FREQ Question

As far as I am aware, or at least this is how I've done it for my projects,

the only alternative when you dislike the output layout of proc freq LIST for nway contingency tables is to use proc tabulate.

I will try to find a link to it. I had posted a similar question and Ballardw had provided a very helpful response as to how to write proc tabulate to generate the nway effect. Otherwise, I simply recommend you start by reading the sas documentation about it and come back with additionnal questions on how to code the proc tabulate to achieve your output.

Vincent

Solution
‎11-28-2013 08:50 AM
Super Contributor
Posts: 339

Re: PROC FREQ Question

Posted in reply to Vince28_Statcan

Here's the link to my original question with Ballardw's responses

https://communities.sas.com/thread/48565

New Contributor
Posts: 4

Re: PROC FREQ Question

Posted in reply to Vince28_Statcan

Thank you, that's what I was looking for!

🔒 This topic is solved and locked.

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

Discussion stats
  • 3 replies
  • 377 views
  • 0 likes
  • 2 in conversation