Programming the statistical procedures from SAS

How to get sum of frequencies of non numeric variables?

Reply
Occasional Contributor
Posts: 14

How to get sum of frequencies of non numeric variables?

I useddonor_relationFrequency Count
related18
spousal23
unrelat

23

I created this file using the following code

proc freq data=b  ;

table donor_relation/nocum nopercent out=how2;

run;

the question is how can I get the total sum of all frequencies at the bottom.Is there any other methodwhich I can use?

non

Trusted Advisor
Posts: 1,218

Re: How to get sum of frequencies of non numeric variables?

Proc tabulate can provide total of all frequencies at the bottom in addition to frequency of each level. Try this.

proc tabulate data=b;

class donor_relation;

table donor_relation all='Total',n='Frequency Count';

run;

Frequent Contributor
Posts: 144

Re: How to get sum of frequencies of non numeric variables?

I think that if you export the dataset adding the option out=nameoftheoutput it will create a table that have totals, something likev

VAR1          VAR2          Freq

                                      ...

lev1                                  ....

                    lev1              ....

lev1               lev1             ....

...                    ...              ...

where rows without levels is the total, rows with only a level in one of the variables is the sum of the row or column

Ask a Question
Discussion stats
  • 2 replies
  • 291 views
  • 0 likes
  • 3 in conversation