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.
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.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.