BookmarkSubscribeRSS Feed
Unsaf
Calcite | Level 5

Hello, new to SAS here. 

 

Currently I have a dataset as follows:

 

               centre          Variable1        Variable2        Variable3 ... VariableN

Subject1   1-15             0 or 1             0 or 1             0 or 1          0 or 1

Subject2   1-15             0 or 1             0 or 1             0 or 1          0 or 1

.

.

.

Subjectn

 

My goal is to report the frequency of each variable by centre to generate a table where:

 

                  centre 1    centre 2 ... centre 15

Variable1    Freq 0       Freq 0        Freq 0

                   Freq 1       Freq 1        Freq 1

 

Variable 2   Freq 0       Freq 0        Freq 0

                   Freq 1       Freq 1        Freq 1

.

.

.

Variable n   Freq 0       Freq 0        Freq 0

                   Freq 1       Freq 1        Freq 1

 

 

Thanks for any help or support. Cheers. 

1 REPLY 1
Astounding
PROC Star

Here's an approach that should at least be in the ballpark:

 

proc tabulate data=have missing;
   class variable: centre;
   tables variable: , centre;
run;

There are lots of ways to customize the format of the output in PROC TABULATE.

sas-innovate-wordmark-2025-midnight.png

Register Today!

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.


Register now!

What is Bayesian Analysis?

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 454 views
  • 2 likes
  • 2 in conversation