3
4

1 回答 1

2

您可以使用drop_unused_labels功能删除未使用的标签。

library(expss)
df1 <- drop_unused_labels(df)
cro(df1$sex, df1$agegroup, weight = df1$weight)
                                                                           
 |     |                  | Age group |       |             |                  |
 |     |                  |      1-29 | 30-49 | 50 and more | Abandoned survey |
 | --- | ---------------- | --------- | ----- | ----------- | ---------------- |
 | Sex |             Male |       100 |   100 |          50 |                  |
 |     |           Female |       100 |   650 |          50 |                  |
 |     | Abandoned survey |           |       |             |              400 |
 |     |     #Total cases |         2 |     5 |           2 |                1 |
于 2020-09-23T03:09:22.017 回答