3.2

The epiDisplay command tabpct() also provides both row and column percentages for 2x2 tables. Note that the outcome variable has been put first, with the exposure variable second.

#--- 2x2 table with OR and percentages
bab9 %$% tabpct(ht, lbw, graph = F)
## 
## Original table 
##        lbw
## ht       low  normal  Total
##   no      53     499    552
##   yes     27      62     89
##   Total   80     561    641
## 
## Row percent 
##      lbw
## ht        low  normal  Total
##   no       53     499    552
##         (9.6)  (90.4)  (100)
##   yes      27      62     89
##        (30.3)  (69.7)  (100)
## 
## Column percent 
##        lbw
## ht       low       %  normal       %
##   no      53  (66.2)     499  (88.9)
##   yes     27  (33.8)      62  (11.1)
##   Total   80   (100)     561   (100)
Exercise 10.2: What proportion of babies born to women who were hypertensive were of low birthweight? How does this compare with the proportion of low birthweight babies born to women who were not hypertensive?