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
This is for the benefit of whoever has faced this peculiar problem. I stumbled across the solution after going over the very, very long documentation that Hmisc
has. The solution is to use print()
with exclude1=F
option:
print(summary(ID ~ OCCUPATION, data=df, method="reverse"), exclude1=F)
Descriptive Statistics by ID
+-------------------+--------+--------+
| |HUSBAND |SELF |
| |(N=28) |(N=72) |
+-------------------+--------+--------+
|OCCUPATION : OTHERS| 7% ( 2)|69% (50)|
+-------------------+--------+--------+
| SELF EMPLOYED |93% (26)|31% (22)|
+-------------------+--------+--------+