I am trying to get a crosstab with percentages from this file using Hmisc
. But why is summary()
dropping a category ("OTHERS") from the variable OCCUPATION?
library(Hmisc)
summary(ID ~ OCCUPATION, data=df, method="reverse")
Output: Descriptive Statistics by ID
+--------------------------+--------+--------+
| |HUSBAND |SELF |
| |(N=28) |(N=72) |
+--------------------------+--------+--------+
|OCCUPATION : SELF EMPLOYED|93% (26)|31% (22)|
+--------------------------+--------+--------+
Compare this to the simple table()
OCCUPATION
ID OTHERS SELF EMPLOYED
HUSBAND 2 26
SELF 50 22