DATA Step, Macro, Functions and more

PROC FREQ or PROC TABULATE for complex table

Reply
Regular Contributor
Posts: 214

PROC FREQ or PROC TABULATE for complex table

[ Edited ]

Hi all,

 

Could you please say how to implement Proc Freq for the following case. I have the table below:

 

and I need to build the following statistics (frequencies):

 

 

What shoult be the format of PROC FREQ? Or should it be PROC TABULATE? I am looking for a decision in several steps but can it be sorted out in one?

 

Thank you. 

Super User
Posts: 6,788

Re: PROC FREQ or PROC TABULATE for complex table

Posted in reply to DmytroYermak

How does Visit2Finding get utilized in constructing the table?

 

PROC FREQ can give you something quick and dirty, not at all fancy and only similar to what you asked for:

 

proc freq data=have;

tables examination * visit1Finding * cohort / missing list;

run;

 

You might add Visit2Finding in there somewhere, depending on what it is supposed to be used for.

 

For anything fancier, you probably need to switch to PROC TABULATE.

Regular Contributor
Posts: 214

Re: PROC FREQ or PROC TABULATE for complex table

[ Edited ]
Posted in reply to Astounding

I have received the following table:

 

but badly need exactly the one below (. Is it possible to use Proc Report and what is the algorythm for it?

 

Super User
Posts: 13,584

Re: PROC FREQ or PROC TABULATE for complex table

Posted in reply to DmytroYermak

It is best to post example data in a form that can be used for demonstrating code. Instructions here: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat... will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the {i} icon or attached as text to show exactly what you have and that we can test code against.

Ask a Question
Discussion stats
  • 3 replies
  • 193 views
  • 0 likes
  • 3 in conversation