I'm trying to write SAS code that outputs grouped frequency tables for a number of related variables. I have about 70 variables in about 7 groups and each group should have its own table. These vars are named for their group and number, so group one is f1q1 to f1q10, group two is f2q1 to f2q8, and so on. Each var has numeric values 1-5, labeled Strongly Disagree, Disagree, etc. I would like the tables to look like the following, with var labels in the leftmost rows and values as columns, including hiding responses with n<=6, if possible (though this last step could be done manually after table export): I'm using the colon operator and proc tabulate (rather than proc freq) to try to speed up this process. proc tabulate data = survey;
class f1q: ;
table (f1q:), (n pctn = "&") ;
run; As you can see below, this creates the labels and counts successfully but puts both as rows. I would like the values (Agree, Disagree, etc) as columns each with their own N and % (there is a typo in the screenshot and & should be %). Is this possible with proc tabulate? Is there another procedure that would let me automate this process more easily? I have a number of surveys, each with many question groups, that I need to process this way. Thanks!
... View more