summary {Hmisc} drops category?

后端 未结 1 737
一生所求
一生所求 2021-01-13 21:24

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

相关标签:
1条回答
  • 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)|
    +-------------------+--------+--------+
    
    0 讨论(0)
提交回复
热议问题