I need to produce tables using Proc Tabulate with %s which exclude the missing values. Using the MISSING option will shown the number of missing values, but includes these in the denominator for calculating percentages. Removing the MISSING option gives the %s I want, but does not show the number of missing values.
In the example below I would the output to have 25% and 80% for the 'Diabetic' row and no %s in the 'Unknown' row.
In the past I have done 2 proc tabulates, one after the other and then edited the output. However in the brave new world of ODS RTF I need output which does not need editing.
Any suggestions would be appreciated, even if they are not very neat.
data test;
input patient sex $ Diabetes ;
cards;
1 M 1
2 M .
3 M 1
4 M 1
5 M 2
6 M 1
7 F .
8 F 2
9 F 2
10 F 2
11 F 1
12 F .
;
run;
proc format;
value diabetes
1='Diabetic'
2='Non-diabetic'
.='Unknown'
;
proc tabulate FORMCHAR=' ' missing;
class sex diabetes;
format diabetes diabetes.;
table diabetes all,sex*(N*F=5.0 colpctn) ;
run;