07-17-2017 05:53 AM
I have a dataset contains some character variables and other categorical variables but displaying with numbers. I would like to generate a table the following:
I did this using PROC FREQ DATA= ; TABLES _CHARACTER_; RUN;
However, this is only works for thsoe variables which contain chararcter values. For those variables have numeric values, how could I get the similar result? I gave a sample table here as well.
Hope anybody can help me. Many appreciation.
07-17-2017 06:17 AM
Well the obvious answer here is to have character values for those variables which need to have frequency counts performed on them. For instance in my CDISC standards would have:
That way you can do both freq and sums.
You could also format the numeric variables:
proc format; value gr 1="1"; run; proc freq...; ... format grade gr.; run;
07-17-2017 06:33 AM
PROC FREQ runs on numeric variables as well. Just add any you want, as part of the TABLES statement.
And be a little bit careful. If you add a numeric variable that is really continuous rather than categorical, you can generate an extremely long table.