I want to create an AE table (pref in TABULATE) that shows the # with each AE and (here's the part I'm having problems with...) %'s of all subjects - even those who have any AE.
If you are, then you would need a Picture format to add a percent sign to the created number. Even those this example was for a SAS/Graph procedure, the picture format is what you would use: http://support.sas.com/kb/24/877.html
/* Create a format for the values of PERCENT. The PCTFMT. */
/* format rounds the percentage to no decimal places and */
/* adds a percent sign to the value. */
Thanks for the response,
The picture format is a good idea - I will use that (when I get the %'s working). I think specifying a denominator would work, but the var I would want as a denominator isn't (directly) included in the summary table. Here's an example of the type of data I have...
So the table should look like this...
Total N 4 (100%)
Text1 2 (50%)
Text2 2 (50%)
Text3 1 (25%)
When I use PCTN I get %'s based on total number of TextX instead of total ID.
Do you know how I could achieve this
The only way (that I can think of) is to calculate the percentages in a data step prior to reporting. I really don't like proc tabulate and would rather use proc report but that's a personal preference.
The n (%) variable can be created as a character type (i.e. 2 (50%)) using whatever method you want and then just use proc report to print out the results.
a denominator can be an analysis variable.
You need an analysis variable that provides the required denominator at the crossing level where you report. The analysis var used as denominator does not need to appear anywhere else in the table (just in the data).
If you show a sample of data with the denominator value required, we'll be more help.