我正在尝试使用. Hmisc
但是为什么summary()
要从变量 OCCUPATION 中删除一个类别(“其他”)?
library(Hmisc)
summary(ID ~ OCCUPATION, data=df, method="reverse")
输出:ID 的描述性统计
+--------------------------+--------+--------+
| |HUSBAND |SELF |
| |(N=28) |(N=72) |
+--------------------------+--------+--------+
|OCCUPATION : SELF EMPLOYED|93% (26)|31% (22)|
+--------------------------+--------+--------+
将此与简单的比较table()
OCCUPATION
ID OTHERS SELF EMPLOYED
HUSBAND 2 26
SELF 50 22