library(gmodels)
a <- data.frame(sex=c(1,1,2,2,1,1), bq=c(1,2,1,2,2,2))
CrossTable(a$sex, a$bq, digits=2,prop.r=T,prop.c=F,prop.t=F,prop.chisq=F,format="SPSS")
结果:
Cell Contents
|-------------------------|
| Count |
| Row Percent |
|-------------------------|
Total Observations in Table: 6
| a$bq
a$sex | 1 | 2 | Row Total |
-------------|-----------|-----------|-----------|
1 | 1 | 3 | 4 |
| 25.00% | 75.00% | 66.67% |
-------------|-----------|-----------|-----------|
2 | 1 | 1 | 2 |
| 50.00% | 50.00% | 33.33% |
-------------|-----------|-----------|-----------|
Column Total | 2 | 4 | 6 |
-------------|-----------|-----------|-----------|


雷达卡
京公网安备 11010802022788号







