t=  "D:\\van anh\\DU LIEU PT\\thong ke so lieu truoc ghep.csv"
dt=read.csv(t)
head(dt)
##   STT ID Sex year.of.transplatation year.of.birth Age Height Weight
## 1   1  1   1                   2014          1977  37   1.72     54
## 2   2  2   1                   2014          1977  37   1.67     57
## 3   3  3   0                   2014          1990  24   1.50     39
## 4   4  4   1                   2014          1984  30   1.65     52
## 5   5  5   1                   2014          1970  44   1.68     68
## 6   6  6   1                   2014          1973  41   1.67     62
##   Relationship Cross.match PRA Hypertension mellitus.diabetes Virus
## 1            4           0   0            0                 0     0
## 2            1           0   0            1                 0     0
## 3            1           0   0            1                 0     0
## 4            1           0   0            1                 0     2
## 5            2           0   0            1                 0     0
## 6            3           0   0            1                 0     0
##   Induction days.after.transplatation
## 1         1                      1436
## 2         0                      1448
## 3         0                      1367
## 4         0                      1221
## 5         1                      1228
## 6         1                      1190
# Tạo biến mới BMI
dt$BMI=dt$Weight*dt$Height^-1*dt$Height^-1
dt$DAT= dt$days.after.transplatation/30
head(dt)
##   STT ID Sex year.of.transplatation year.of.birth Age Height Weight
## 1   1  1   1                   2014          1977  37   1.72     54
## 2   2  2   1                   2014          1977  37   1.67     57
## 3   3  3   0                   2014          1990  24   1.50     39
## 4   4  4   1                   2014          1984  30   1.65     52
## 5   5  5   1                   2014          1970  44   1.68     68
## 6   6  6   1                   2014          1973  41   1.67     62
##   Relationship Cross.match PRA Hypertension mellitus.diabetes Virus
## 1            4           0   0            0                 0     0
## 2            1           0   0            1                 0     0
## 3            1           0   0            1                 0     0
## 4            1           0   0            1                 0     2
## 5            2           0   0            1                 0     0
## 6            3           0   0            1                 0     0
##   Induction days.after.transplatation      BMI      DAT
## 1         1                      1436 18.25311 47.86667
## 2         0                      1448 20.43817 48.26667
## 3         0                      1367 17.33333 45.56667
## 4         0                      1221 19.10009 40.70000
## 5         1                      1228 24.09297 40.93333
## 6         1                      1190 22.23099 39.66667
library(DescTools)
Desc(dt$DAT)
## ------------------------------------------------------------------------- 
## dt$DAT (numeric)
## 
##       length           n        NAs      unique          0s        mean
##          114         114          0         108           0  17.9000000
##                   100.0%       0.0%                    0.0%            
##                                                                        
##          .05         .10        .25      median         .75         .90
##    1.1866667   1.9366667  5.4333333  15.4166667  25.8250000  39.1833333
##                                                                        
##        range          sd      vcoef         mad         IQR        skew
##   68.1666667  14.2485632  0.7960091  14.9989700  20.3916667   0.9353910
##                                                                        
##       meanCI
##   15.2561144
##   20.5438856
##             
##          .95
##   42.5550000
##             
##         kurt
##    0.6173580
##             
## lowest : 0.2333333, 0.3, 0.7333333, 0.9333333 (2), 1.1
## highest: 47.8666667, 48.2666667, 50.3333333, 60.0, 68.4

library(table1)
## Warning: package 'table1' was built under R version 3.5.3
## 
## Attaching package: 'table1'
## The following objects are masked from 'package:base':
## 
##     units, units<-
table1(~Age + Height + Weight + DAT + BMI| Sex, data = dt )
## Warning in table1.formula(~Age + Height + Weight + DAT + BMI | Sex, data =
## dt): Terms to the right of '|' in formula 'x' define table columns and are
## expected to be factors with meaningful labels.
0
(n=25)
1
(n=89)
Overall
(n=114)
Age
Mean (SD) 33.7 (8.89) 35.8 (9.01) 35.4 (8.98)
Median [Min, Max] 32.0 [20.0, 49.0] 36.0 [20.0, 65.0] 34.5 [20.0, 65.0]
Height
Mean (SD) 8.02 (32.3) 1.66 (0.0507) 3.05 (15.1)
Median [Min, Max] 1.57 [1.50, 163] 1.65 [1.52, 1.77] 1.65 [1.50, 163]
Weight
Mean (SD) 44.8 (6.26) 56.8 (7.45) 54.2 (8.74)
Median [Min, Max] 43.0 [35.0, 65.0] 55.0 [41.5, 77.0] 54.0 [35.0, 77.0]
DAT
Mean (SD) 17.0 (10.2) 18.2 (15.2) 17.9 (14.2)
Median [Min, Max] 18.1 [3.67, 45.6] 14.5 [0.233, 68.4] 15.4 [0.233, 68.4]
BMI
Mean (SD) 17.7 (4.13) 20.6 (2.66) 20.0 (3.26)
Median [Min, Max] 18.2 [0.00156, 23.3] 20.3 [15.4, 30.3] 19.8 [0.00156, 30.3]