library(readr)
obesity_data <- read_csv("C:/Users/DELL/Desktop/TAP HUAN PT SO LIEU/obesity data.csv")
## Rows: 1217 Columns: 13
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (1): gender
## dbl (12): id, height, weight, bmi, age, WBBMC, wbbmd, fat, lean, pcfat, hype...
##
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
library(compareGroups)
createTable(compareGroups(gender ~ age + bmi + WBBMC + wbbmd + fat + lean + hypertension + diabetes, data = obesity_data))
##
## --------Summary descriptives table by 'gender'---------
##
## ________________________________________________
## F M p.overall
## N=862 N=355
## ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
## age 48.6 (16.4) 43.7 (18.8) <0.001
## bmi 22.3 (3.05) 22.7 (3.04) 0.013
## WBBMC 1599 (293) 2030 (336) <0.001
## wbbmd 0.99 (0.11) 1.06 (0.10) <0.001
## fat 18240 (4954) 14978 (5113) <0.001
## lean 32045 (3966) 43762 (5819) <0.001
## hypertension 0.50 (0.50) 0.52 (0.50) 0.527
## diabetes 0.12 (0.32) 0.09 (0.29) 0.181
## ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯