library ( tableone )
interest <- names ( data ) [ c ( 2 ,3 ,4 ,5 ,14 ,23 ,24 ,26 ) ]
interest
#> [1] "sex" "age"
#> [3] "bmi" "preoperative_pfirmann_level"
#> [5] "delta_H" "r_asd"
#> [7] "delta_SL" "delta_LL"
categories <- interest [ c ( 1 ,4 ,6 ) ]
tbl1 <- CreateTableOne ( vars = names ( data ) [ - c ( 1 ,17 : 19 ,21 : 26 ) ] ,
data = data ,strata = "group" ,
addOverall = T ,includeNA = TRUE ,
)
print ( tbl1 , showAllLevels = T ,
nonnormal = c ( # 非正态分布
"bmi" ,
"preoperative_segmented_lordosis" ,
"postoperative_segmented_lordosis" ,
"preoperative_ll" ,
"postoperative_ll" ,
"postoperative_segmented_lordosis_cranial" ,
"delta_H"
) ,
exact = c ( # fisher 精确检验
"preoperative_pfirmann_level" ,
"preoperative_pfirmann_cranial" ,
"preoperative_pfirmann_caudal" ,
"postoperative_pfirmann_cranial" ,
"postoperative_pfirmann_caudal"
) )
#> Stratified by group
#> level
#> n
#> sex (%) F
#> M
#> age (mean (SD))
#> bmi (median [IQR])
#> preoperative_pfirmann_level (%) Ⅰ
#> Ⅱ
#> Ⅲ
#> Ⅳ
#> Ⅴ
#> preoperative_pfirmann_cranial (%) 1
#> 2
#> 3
#> 4
#> 5
#> preoperative_pfirmann_caudal (%) 1
#> 2
#> 3
#> 4
#> 5
#> postoperative_pfirmann_cranial (%) 1
#> 2
#> 3
#> 4
#> 5
#> postoperative_pfirmann_caudal (%) 1
#> 2
#> 3
#> 4
#> 5
#> preoperative_segmented_lordosis (median [IQR])
#> postoperative_segmented_lordosis (median [IQR])
#> preoperative_segmented_lordosis_cranial (mean (SD))
#> postoperative_segmented_lordosis_cranial (median [IQR])
#> delta_H (median [IQR])
#> preoperative_ll (median [IQR])
#> postoperative_ll (median [IQR])
#> group (%) TLIF
#> Mis-LLIF
#> Stratified by group
#> Overall
#> n 140
#> sex (%) 64 (45.7)
#> 76 (54.3)
#> age (mean (SD)) 62.72 (5.90)
#> bmi (median [IQR]) 25.20 [24.28, 26.10]
#> preoperative_pfirmann_level (%) 0 ( 0.0)
#> 0 ( 0.0)
#> 103 (73.6)
#> 34 (24.3)
#> 3 ( 2.1)
#> preoperative_pfirmann_cranial (%) 0 ( 0.0)
#> 1 ( 0.7)
#> 129 (92.1)
#> 10 ( 7.1)
#> 0 ( 0.0)
#> preoperative_pfirmann_caudal (%) 0 ( 0.0)
#> 1 ( 0.7)
#> 114 (81.4)
#> 25 (17.9)
#> 0 ( 0.0)
#> postoperative_pfirmann_cranial (%) 0 ( 0.0)
#> 0 ( 0.0)
#> 94 (67.1)
#> 39 (27.9)
#> 7 ( 5.0)
#> postoperative_pfirmann_caudal (%) 0 ( 0.0)
#> 0 ( 0.0)
#> 103 (73.6)
#> 33 (23.6)
#> 4 ( 2.9)
#> preoperative_segmented_lordosis (median [IQR]) 6.50 [5.30, 8.60]
#> postoperative_segmented_lordosis (median [IQR]) 8.50 [8.07, 9.72]
#> preoperative_segmented_lordosis_cranial (mean (SD)) 7.60 (1.33)
#> postoperative_segmented_lordosis_cranial (median [IQR]) 7.95 [6.90, 8.90]
#> delta_H (median [IQR]) 1.75 [0.90, 3.90]
#> preoperative_ll (median [IQR]) 46.80 [43.75, 48.60]
#> postoperative_ll (median [IQR]) 47.80 [46.18, 49.60]
#> group (%) 70 (50.0)
#> 70 (50.0)
#> Stratified by group
#> TLIF
#> n 70
#> sex (%) 30 ( 42.9)
#> 40 ( 57.1)
#> age (mean (SD)) 62.89 (5.37)
#> bmi (median [IQR]) 25.25 [24.35, 26.08]
#> preoperative_pfirmann_level (%) 0 ( 0.0)
#> 0 ( 0.0)
#> 52 ( 74.3)
#> 18 ( 25.7)
#> 0 ( 0.0)
#> preoperative_pfirmann_cranial (%) 0 ( 0.0)
#> 1 ( 1.4)
#> 65 ( 92.9)
#> 4 ( 5.7)
#> 0 ( 0.0)
#> preoperative_pfirmann_caudal (%) 0 ( 0.0)
#> 1 ( 1.4)
#> 56 ( 80.0)
#> 13 ( 18.6)
#> 0 ( 0.0)
#> postoperative_pfirmann_cranial (%) 0 ( 0.0)
#> 0 ( 0.0)
#> 49 ( 70.0)
#> 21 ( 30.0)
#> 0 ( 0.0)
#> postoperative_pfirmann_caudal (%) 0 ( 0.0)
#> 0 ( 0.0)
#> 52 ( 74.3)
#> 18 ( 25.7)
#> 0 ( 0.0)
#> preoperative_segmented_lordosis (median [IQR]) 7.55 [5.90, 8.60]
#> postoperative_segmented_lordosis (median [IQR]) 8.40 [7.73, 9.45]
#> preoperative_segmented_lordosis_cranial (mean (SD)) 7.62 (1.22)
#> postoperative_segmented_lordosis_cranial (median [IQR]) 7.95 [6.90, 8.78]
#> delta_H (median [IQR]) 0.90 [0.72, 1.17]
#> preoperative_ll (median [IQR]) 46.90 [45.37, 48.90]
#> postoperative_ll (median [IQR]) 47.85 [46.50, 49.60]
#> group (%) 70 (100.0)
#> 0 ( 0.0)
#> Stratified by group
#> Mis-LLIF
#> n 70
#> sex (%) 34 ( 48.6)
#> 36 ( 51.4)
#> age (mean (SD)) 62.56 (6.43)
#> bmi (median [IQR]) 25.20 [24.10, 26.05]
#> preoperative_pfirmann_level (%) 0 ( 0.0)
#> 0 ( 0.0)
#> 51 ( 72.9)
#> 16 ( 22.9)
#> 3 ( 4.3)
#> preoperative_pfirmann_cranial (%) 0 ( 0.0)
#> 0 ( 0.0)
#> 64 ( 91.4)
#> 6 ( 8.6)
#> 0 ( 0.0)
#> preoperative_pfirmann_caudal (%) 0 ( 0.0)
#> 0 ( 0.0)
#> 58 ( 82.9)
#> 12 ( 17.1)
#> 0 ( 0.0)
#> postoperative_pfirmann_cranial (%) 0 ( 0.0)
#> 0 ( 0.0)
#> 45 ( 64.3)
#> 18 ( 25.7)
#> 7 ( 10.0)
#> postoperative_pfirmann_caudal (%) 0 ( 0.0)
#> 0 ( 0.0)
#> 51 ( 72.9)
#> 15 ( 21.4)
#> 4 ( 5.7)
#> preoperative_segmented_lordosis (median [IQR]) 5.60 [5.30, 8.12]
#> postoperative_segmented_lordosis (median [IQR]) 8.60 [8.30, 10.30]
#> preoperative_segmented_lordosis_cranial (mean (SD)) 7.58 (1.44)
#> postoperative_segmented_lordosis_cranial (median [IQR]) 7.95 [6.93, 9.00]
#> delta_H (median [IQR]) 3.90 [3.52, 4.60]
#> preoperative_ll (median [IQR]) 46.25 [43.23, 48.30]
#> postoperative_ll (median [IQR]) 47.65 [45.23, 49.45]
#> group (%) 0 ( 0.0)
#> 70 (100.0)
#> Stratified by group
#> p test
#> n
#> sex (%) 0.611
#>
#> age (mean (SD)) 0.743
#> bmi (median [IQR]) 0.425 nonnorm
#> preoperative_pfirmann_level (%) 0.295 exact
#>
#>
#>
#>
#> preoperative_pfirmann_cranial (%) 0.745 exact
#>
#>
#>
#>
#> preoperative_pfirmann_caudal (%) 0.828 exact
#>
#>
#>
#>
#> postoperative_pfirmann_cranial (%) 0.025 exact
#>
#>
#>
#>
#> postoperative_pfirmann_caudal (%) 0.136 exact
#>
#>
#>
#>
#> preoperative_segmented_lordosis (median [IQR]) 0.010 nonnorm
#> postoperative_segmented_lordosis (median [IQR]) 0.009 nonnorm
#> preoperative_segmented_lordosis_cranial (mean (SD)) 0.854
#> postoperative_segmented_lordosis_cranial (median [IQR]) 0.350 nonnorm
#> delta_H (median [IQR]) <0.001 nonnorm
#> preoperative_ll (median [IQR]) 0.095 nonnorm
#> postoperative_ll (median [IQR]) 0.769 nonnorm
#> group (%) <0.001
#>
tbl1 %>% print (
nonnormal = c ( # 非正态分布
"bmi" ,
"preoperative_segmented_lordosis" ,
"postoperative_segmented_lordosis" ,
"preoperative_ll" ,
"postoperative_ll" ,
"postoperative_segmented_lordosis_cranial" ,
"delta_H"
) ,
exact = c ( # fisher 精确检验
"preoperative_pfirmann_level" ,
"preoperative_pfirmann_cranial" ,
"preoperative_pfirmann_caudal" ,
"postoperative_pfirmann_cranial" ,
"postoperative_pfirmann_caudal"
) ,
showAllLevels = T ,
smd = F ,
formatOptions = list ( big.mark = "," )
) %>%
write.csv ( "data/三线表/tableone生成三线表.csv" )
#> Stratified by group
#> level
#> n
#> sex (%) F
#> M
#> age (mean (SD))
#> bmi (median [IQR])
#> preoperative_pfirmann_level (%) Ⅰ
#> Ⅱ
#> Ⅲ
#> Ⅳ
#> Ⅴ
#> preoperative_pfirmann_cranial (%) 1
#> 2
#> 3
#> 4
#> 5
#> preoperative_pfirmann_caudal (%) 1
#> 2
#> 3
#> 4
#> 5
#> postoperative_pfirmann_cranial (%) 1
#> 2
#> 3
#> 4
#> 5
#> postoperative_pfirmann_caudal (%) 1
#> 2
#> 3
#> 4
#> 5
#> preoperative_segmented_lordosis (median [IQR])
#> postoperative_segmented_lordosis (median [IQR])
#> preoperative_segmented_lordosis_cranial (mean (SD))
#> postoperative_segmented_lordosis_cranial (median [IQR])
#> delta_H (median [IQR])
#> preoperative_ll (median [IQR])
#> postoperative_ll (median [IQR])
#> group (%) TLIF
#> Mis-LLIF
#> Stratified by group
#> Overall
#> n 140
#> sex (%) 64 (45.7)
#> 76 (54.3)
#> age (mean (SD)) 62.72 (5.90)
#> bmi (median [IQR]) 25.20 [24.28, 26.10]
#> preoperative_pfirmann_level (%) 0 ( 0.0)
#> 0 ( 0.0)
#> 103 (73.6)
#> 34 (24.3)
#> 3 ( 2.1)
#> preoperative_pfirmann_cranial (%) 0 ( 0.0)
#> 1 ( 0.7)
#> 129 (92.1)
#> 10 ( 7.1)
#> 0 ( 0.0)
#> preoperative_pfirmann_caudal (%) 0 ( 0.0)
#> 1 ( 0.7)
#> 114 (81.4)
#> 25 (17.9)
#> 0 ( 0.0)
#> postoperative_pfirmann_cranial (%) 0 ( 0.0)
#> 0 ( 0.0)
#> 94 (67.1)
#> 39 (27.9)
#> 7 ( 5.0)
#> postoperative_pfirmann_caudal (%) 0 ( 0.0)
#> 0 ( 0.0)
#> 103 (73.6)
#> 33 (23.6)
#> 4 ( 2.9)
#> preoperative_segmented_lordosis (median [IQR]) 6.50 [5.30, 8.60]
#> postoperative_segmented_lordosis (median [IQR]) 8.50 [8.07, 9.72]
#> preoperative_segmented_lordosis_cranial (mean (SD)) 7.60 (1.33)
#> postoperative_segmented_lordosis_cranial (median [IQR]) 7.95 [6.90, 8.90]
#> delta_H (median [IQR]) 1.75 [0.90, 3.90]
#> preoperative_ll (median [IQR]) 46.80 [43.75, 48.60]
#> postoperative_ll (median [IQR]) 47.80 [46.18, 49.60]
#> group (%) 70 (50.0)
#> 70 (50.0)
#> Stratified by group
#> TLIF
#> n 70
#> sex (%) 30 ( 42.9)
#> 40 ( 57.1)
#> age (mean (SD)) 62.89 (5.37)
#> bmi (median [IQR]) 25.25 [24.35, 26.08]
#> preoperative_pfirmann_level (%) 0 ( 0.0)
#> 0 ( 0.0)
#> 52 ( 74.3)
#> 18 ( 25.7)
#> 0 ( 0.0)
#> preoperative_pfirmann_cranial (%) 0 ( 0.0)
#> 1 ( 1.4)
#> 65 ( 92.9)
#> 4 ( 5.7)
#> 0 ( 0.0)
#> preoperative_pfirmann_caudal (%) 0 ( 0.0)
#> 1 ( 1.4)
#> 56 ( 80.0)
#> 13 ( 18.6)
#> 0 ( 0.0)
#> postoperative_pfirmann_cranial (%) 0 ( 0.0)
#> 0 ( 0.0)
#> 49 ( 70.0)
#> 21 ( 30.0)
#> 0 ( 0.0)
#> postoperative_pfirmann_caudal (%) 0 ( 0.0)
#> 0 ( 0.0)
#> 52 ( 74.3)
#> 18 ( 25.7)
#> 0 ( 0.0)
#> preoperative_segmented_lordosis (median [IQR]) 7.55 [5.90, 8.60]
#> postoperative_segmented_lordosis (median [IQR]) 8.40 [7.73, 9.45]
#> preoperative_segmented_lordosis_cranial (mean (SD)) 7.62 (1.22)
#> postoperative_segmented_lordosis_cranial (median [IQR]) 7.95 [6.90, 8.78]
#> delta_H (median [IQR]) 0.90 [0.72, 1.17]
#> preoperative_ll (median [IQR]) 46.90 [45.37, 48.90]
#> postoperative_ll (median [IQR]) 47.85 [46.50, 49.60]
#> group (%) 70 (100.0)
#> 0 ( 0.0)
#> Stratified by group
#> Mis-LLIF
#> n 70
#> sex (%) 34 ( 48.6)
#> 36 ( 51.4)
#> age (mean (SD)) 62.56 (6.43)
#> bmi (median [IQR]) 25.20 [24.10, 26.05]
#> preoperative_pfirmann_level (%) 0 ( 0.0)
#> 0 ( 0.0)
#> 51 ( 72.9)
#> 16 ( 22.9)
#> 3 ( 4.3)
#> preoperative_pfirmann_cranial (%) 0 ( 0.0)
#> 0 ( 0.0)
#> 64 ( 91.4)
#> 6 ( 8.6)
#> 0 ( 0.0)
#> preoperative_pfirmann_caudal (%) 0 ( 0.0)
#> 0 ( 0.0)
#> 58 ( 82.9)
#> 12 ( 17.1)
#> 0 ( 0.0)
#> postoperative_pfirmann_cranial (%) 0 ( 0.0)
#> 0 ( 0.0)
#> 45 ( 64.3)
#> 18 ( 25.7)
#> 7 ( 10.0)
#> postoperative_pfirmann_caudal (%) 0 ( 0.0)
#> 0 ( 0.0)
#> 51 ( 72.9)
#> 15 ( 21.4)
#> 4 ( 5.7)
#> preoperative_segmented_lordosis (median [IQR]) 5.60 [5.30, 8.12]
#> postoperative_segmented_lordosis (median [IQR]) 8.60 [8.30, 10.30]
#> preoperative_segmented_lordosis_cranial (mean (SD)) 7.58 (1.44)
#> postoperative_segmented_lordosis_cranial (median [IQR]) 7.95 [6.93, 9.00]
#> delta_H (median [IQR]) 3.90 [3.52, 4.60]
#> preoperative_ll (median [IQR]) 46.25 [43.23, 48.30]
#> postoperative_ll (median [IQR]) 47.65 [45.23, 49.45]
#> group (%) 0 ( 0.0)
#> 70 (100.0)
#> Stratified by group
#> p test
#> n
#> sex (%) 0.611
#>
#> age (mean (SD)) 0.743
#> bmi (median [IQR]) 0.425 nonnorm
#> preoperative_pfirmann_level (%) 0.295 exact
#>
#>
#>
#>
#> preoperative_pfirmann_cranial (%) 0.745 exact
#>
#>
#>
#>
#> preoperative_pfirmann_caudal (%) 0.828 exact
#>
#>
#>
#>
#> postoperative_pfirmann_cranial (%) 0.025 exact
#>
#>
#>
#>
#> postoperative_pfirmann_caudal (%) 0.136 exact
#>
#>
#>
#>
#> preoperative_segmented_lordosis (median [IQR]) 0.010 nonnorm
#> postoperative_segmented_lordosis (median [IQR]) 0.009 nonnorm
#> preoperative_segmented_lordosis_cranial (mean (SD)) 0.854
#> postoperative_segmented_lordosis_cranial (median [IQR]) 0.350 nonnorm
#> delta_H (median [IQR]) <0.001 nonnorm
#> preoperative_ll (median [IQR]) 0.095 nonnorm
#> postoperative_ll (median [IQR]) 0.769 nonnorm
#> group (%) <0.001
#>