PSM by R

1 说明

本文件为使用R语言进行倾向性评分匹配的数据、代码、匹配结果,以及匹配前后的数据基线。

2 数据

单孔机器人手术数据,一共339例。

3 方法

使用gtsummary(1)包分析数据基线,并绘制基线表格。使用MatchIt(2)包进行PSM分析,采用1:2比例。使用cobalt(3)包对PSM后结果进行数据平衡性检验。以上所有分析均在R-4.5.0完成。

4 结果

# 导入R包
suppressPackageStartupMessages(library(magrittr))
suppressPackageStartupMessages(library(MatchIt))
suppressPackageStartupMessages(library(cobalt))
suppressPackageStartupMessages(library(gtsummary))
suppressPackageStartupMessages(library(tidyselect))
suppressPackageStartupMessages(library(survival))

倾向性评分匹配前的数据

# 载入数据,并选择出指定变量
raw_data <- openxlsx::read.xlsx("../../data/单孔机器人-1228.xlsx",sheet = 1)
x_vars <- c("Age", "Gender", "Smoking","BMI", "ECOGPerformanceStatus", "ClinicalTNMStage", "InductionTreatment","NoduleLocation","TumorSize")
y_var <- "SurgicalApproach"
psm_in <- raw_data %>% 
  dplyr::select(y_var,all_of(x_vars)) %>%
  # 对分级变量因子化
  dplyr::mutate_at(.vars = c('Gender','Smoking','ClinicalTNMStage','InductionTreatment',"NoduleLocation"),
                   .funs = as.factor)%>%
  # 不能有缺失值存在
  tidyr::drop_na()

倾向性评分匹配前的基线表。注意:以下字段Comorbidities、Pulmonary function、Tumor Location未数据表中获知,因此未纳入表格。

raw_data %>% 
  # 将 Gender == 1置为Male,0为Female
  dplyr::mutate(Gender = ifelse(Gender == 1,"Male","Female"))%>%
  dplyr::mutate(Smoking = ifelse(Smoking == 1,"Yes","No"))%>%
  # dplyr::mutate(Smoking = as.factor(Smoking)) %>%
  # str()
  tbl_summary(by = SurgicalApproach,
              include = c(x_vars,"HistologicalClassification","PathologicalNStage"),
              type = list(Age ~ "continuous", 
                          Smoking ~ "categorical",
                          ECOGPerformanceStatus ~ "continuous"),
              statistic = list(
                all_continuous() ~ "{mean} ({sd})",
                all_categorical() ~ "{n} ({p}%)"
                )) %>%
  add_p(pvalue_fun = label_style_pvalue(digits = 3)) %>%
  add_overall() %>% 
  modify_caption("**Table 1. Patient Baseline Characteristics**") |> 
  bold_labels()
Table 1. Patient Baseline Characteristics
Characteristic Overall
N = 339
1
0
N = 269
1
1
N = 70
1
p-value2
Age 61 (10) 61 (10) 61 (10) 0.765
Gender


0.459
    Female 161 (47%) 125 (46%) 36 (51%)
    Male 178 (53%) 144 (54%) 34 (49%)
Smoking


0.182
    No 250 (74%) 194 (72%) 56 (80%)
    Yes 89 (26%) 75 (28%) 14 (20%)
BMI 23.12 (2.82) 23.23 (2.88) 22.66 (2.53) 0.145
ECOGPerformanceStatus 97.9 (4.2) 97.6 (4.4) 98.8 (2.7) 0.150
ClinicalTNMStage


0.181
    0 1 (0.3%) 1 (0.4%) 0 (0%)
    1 260 (77%) 201 (75%) 59 (84%)
    2 40 (12%) 37 (14%) 3 (4.3%)
    3 36 (11%) 28 (10%) 8 (11%)
    4 2 (0.6%) 2 (0.7%) 0 (0%)
InductionTreatment


<0.001
    0 305 (90%) 245 (91%) 60 (86%)
    1 25 (7.4%) 24 (8.9%) 1 (1.4%)
    2 7 (2.1%) 0 (0%) 7 (10%)
    3 2 (0.6%) 0 (0%) 2 (2.9%)
NoduleLocation


0.875
    0 107 (32%) 86 (32%) 21 (30%)
    1 107 (32%) 86 (32%) 21 (30%)
    2 77 (23%) 61 (23%) 16 (23%)
    3 48 (14%) 36 (13%) 12 (17%)
TumorSize 2.96 (1.21) 2.90 (1.21) 3.19 (1.18) 0.026
HistologicalClassification


0.254
    1 47 (14%) 42 (16%) 5 (7.1%)
    2 279 (82%) 216 (80%) 63 (90%)
    3 2 (0.6%) 2 (0.7%) 0 (0%)
    5 11 (3.2%) 9 (3.3%) 2 (2.9%)
PathologicalNStage


0.192
    0 269 (79%) 214 (80%) 55 (79%)
    1 28 (8.3%) 25 (9.3%) 3 (4.3%)
    2 42 (12%) 30 (11%) 12 (17%)
1 Mean (SD); n (%)
2 Wilcoxon rank sum test; Pearson’s Chi-squared test; Fisher’s exact test

针对该二分类的结局变量,我们选择条件logistic回归探索PSM前连续变量对结局的影响

model <- clogit(SurgicalApproach ~ Age + BMI + ECOGPerformanceStatus + TumorSize, psm_in)
# model <- glm(SurgicalApproach ~ Age + BMI + ECOGPerformanceStatus + TumorSize, psm_in, family = binomial)
tbl_regression(model, exponentiate = TRUE)|>
  as_gt() |>
  gt::tab_source_note(gt::md("*Before PSM*"))
Characteristic OR 95% CI p-value
Age 1.00 0.98, 1.03 0.8
BMI 0.93 0.84, 1.03 0.14
ECOGPerformanceStatus 1.10 1.01, 1.19 0.027
TumorSize 1.23 0.99, 1.54 0.057
Abbreviations: CI = Confidence Interval, OR = Odds Ratio
Before PSM

执行倾向性评分匹配,采用nearest方法,进行1:2匹配

# PSM分析
set.seed(3897)
m_formula <- as.formula(paste0(y_var,"~",paste0(x_vars,collapse = "+")))
matchit_out <- matchit(data = psm_in,
                       formula = m_formula,
                       ratio = 2,
                       method = "nearest",
                       distance = "logit",
                       caliper = 0.5, # 设定处理组与对照组个体之间倾向得分PS的最大可接受差异。
                       replace = FALSE)

对PSM结果进行平衡性检验,结果表明,PSM后的数据MSD均小于0.1,认为数据平衡。

# 平衡性检验
bal.tab(matchit_out, threshold = 0.1)
## Balance Measures
##                           Type Diff.Adj        M.Threshold
## distance              Distance   0.0496     Balanced, <0.1
## Age                    Contin.  -0.0285     Balanced, <0.1
## Gender                  Binary   0.0328     Balanced, <0.1
## Smoking                 Binary  -0.0082     Balanced, <0.1
## BMI                    Contin.   0.0098     Balanced, <0.1
## ECOGPerformanceStatus  Contin.   0.0745     Balanced, <0.1
## ClinicalTNMStage_0      Binary   0.0000     Balanced, <0.1
## ClinicalTNMStage_1      Binary  -0.0164     Balanced, <0.1
## ClinicalTNMStage_2      Binary   0.0082     Balanced, <0.1
## ClinicalTNMStage_3      Binary   0.0082     Balanced, <0.1
## ClinicalTNMStage_4      Binary   0.0000     Balanced, <0.1
## InductionTreatment_0    Binary  -0.0082     Balanced, <0.1
## InductionTreatment_1    Binary   0.0082     Balanced, <0.1
## InductionTreatment_2    Binary   0.0000     Balanced, <0.1
## InductionTreatment_3    Binary   0.0000     Balanced, <0.1
## NoduleLocation_0        Binary  -0.0246     Balanced, <0.1
## NoduleLocation_1        Binary  -0.0082     Balanced, <0.1
## NoduleLocation_2        Binary   0.0000     Balanced, <0.1
## NoduleLocation_3        Binary   0.0328     Balanced, <0.1
## TumorSize              Contin.   0.1534 Not Balanced, >0.1
## 
## Balance tally for mean differences
##                    count
## Balanced, <0.1        19
## Not Balanced, >0.1     1
## 
## Variable with the greatest mean difference
##   Variable Diff.Adj        M.Threshold
##  TumorSize   0.1534 Not Balanced, >0.1
## 
## Sample sizes
##           Control Treated
## All           269      70
## Matched       122      61
## Unmatched     147       9

PSM匹配后的数据(可点击按钮下载数据)

# 获取PSM结果
psm_out_init <- match.data(matchit_out)
psm_out <- psm_out_init %>%
  dplyr::select(y_var,x_vars)

PSM匹配后数据的基线表

psm_out %>%
  dplyr::select(SurgicalApproach,all_of(x_vars)) %>%
  dplyr::mutate_at(.vars = c('Gender','Smoking','ClinicalTNMStage','InductionTreatment',"NoduleLocation"),
                   .funs = as.factor) %>%
  tbl_summary(by = SurgicalApproach,
              # include = c(x_vars,"HistologicalClassification","PathologicalNStage"),
              # type = list(Age ~ "continuous", 
              #             Smoking ~ "categorical",
              #             ECOGPerformanceStatus ~ "continuous"),
              statistic = list(
                all_continuous() ~ "{mean} ({sd})",
                all_categorical() ~ "{n} ({p}%)"
                )) %>%
  add_p(pvalue_fun = label_style_pvalue(digits = 3)) %>%
  add_overall() %>% 
  # modify_caption("**Table 2. Patient Characteristics After PSM**") |> 
  bold_labels() 
Characteristic Overall
N = 183
1
0
N = 122
1
1
N = 61
1
p-value2
Age 62 (9) 62 (9) 62 (9) 0.979
Gender


0.676
    0 94 (51%) 64 (52%) 30 (49%)
    1 89 (49%) 58 (48%) 31 (51%)
Smoking


0.896
    0 146 (80%) 97 (80%) 49 (80%)
    1 37 (20%) 25 (20%) 12 (20%)
BMI 22.49 (2.62) 22.48 (2.64) 22.50 (2.59) 0.929
ECOGPerformanceStatus


0.020
    80 1 (0.5%) 1 (0.8%) 0 (0%)
    90 19 (10%) 15 (12%) 4 (6.6%)
    95 11 (6.0%) 3 (2.5%) 8 (13%)
    100 152 (83%) 103 (84%) 49 (80%)
ClinicalTNMStage


>0.999
    0 0 (0%) 0 (0%) 0 (0%)
    1 170 (93%) 114 (93%) 56 (92%)
    2 2 (1.1%) 1 (0.8%) 1 (1.6%)
    3 11 (6.0%) 7 (5.7%) 4 (6.6%)
    4 0 (0%) 0 (0%) 0 (0%)
InductionTreatment


>0.999
    0 181 (99%) 121 (99%) 60 (98%)
    1 2 (1.1%) 1 (0.8%) 1 (1.6%)
    2 0 (0%) 0 (0%) 0 (0%)
    3 0 (0%) 0 (0%) 0 (0%)
NoduleLocation


0.947
    0 54 (30%) 37 (30%) 17 (28%)
    1 52 (28%) 35 (29%) 17 (28%)
    2 48 (26%) 32 (26%) 16 (26%)
    3 29 (16%) 18 (15%) 11 (18%)
TumorSize 2.96 (1.05) 2.90 (1.07) 3.08 (1.01) 0.106
1 Mean (SD); n (%)
2 Wilcoxon rank sum test; Pearson’s Chi-squared test; Fisher’s exact test

针对该二分类的结局变量,我们选择条件logistic回归探索PSM后连续变量对结局的影响

model_2 <- clogit(SurgicalApproach ~ Age + BMI + ECOGPerformanceStatus + TumorSize, psm_out)
# model <- glm(SurgicalApproach ~ Age + BMI + ECOGPerformanceStatus + TumorSize, psm_out, family = binomial)
tbl_regression(model_2, exponentiate = TRUE)|>
  as_gt() |>
  gt::tab_source_note(gt::md("*After PSM*"))
Characteristic OR 95% CI p-value
Age 1.00 0.96, 1.03 >0.9
BMI 1.00 0.89, 1.12 >0.9
ECOGPerformanceStatus 1.03 0.93, 1.14 0.6
TumorSize 1.20 0.89, 1.63 0.2
Abbreviations: CI = Confidence Interval, OR = Odds Ratio
After PSM

提取匹配后记录的所有字段信息(可点击按钮下载数据)

Table 2. Characteristics for Patients With Lobectomy After Propensity Score Matching

Table 2. Characteristics for Patients With Lobectomy After PSM
Characteristic Overall
N = 183
1
0
N = 122
1
1
N = 61
1
p-value2
Age 62 (9) 62 (9) 62 (9) 0.979
Gender


0.676
    Female 94 (51%) 64 (52%) 30 (49%)
    Male 89 (49%) 58 (48%) 31 (51%)
Smoking


0.896
    No 146 (80%) 97 (80%) 49 (80%)
    Yes 37 (20%) 25 (20%) 12 (20%)
BMI 22.49 (2.62) 22.48 (2.64) 22.50 (2.59) 0.929
ECOGPerformanceStatus 98.6 (3.5) 98.5 (3.7) 98.7 (2.9) 0.676
ClinicalTNMStage


>0.999
    1 170 (93%) 114 (93%) 56 (92%)
    2 2 (1.1%) 1 (0.8%) 1 (1.6%)
    3 11 (6.0%) 7 (5.7%) 4 (6.6%)
InductionTreatment 2 (1.1%) 1 (0.8%) 1 (1.6%) >0.999
NoduleLocation


0.947
    0 54 (30%) 37 (30%) 17 (28%)
    1 52 (28%) 35 (29%) 17 (28%)
    2 48 (26%) 32 (26%) 16 (26%)
    3 29 (16%) 18 (15%) 11 (18%)
TumorSize 2.96 (1.05) 2.90 (1.07) 3.08 (1.01) 0.106
HistologicalClassification


>0.999
    1 15 (8.2%) 10 (8.2%) 5 (8.2%)
    2 166 (91%) 111 (91%) 55 (90%)
    5 2 (1.1%) 1 (0.8%) 1 (1.6%)
PathologicalNStage


0.673
    0 156 (85%) 105 (86%) 51 (84%)
    1 11 (6.0%) 8 (6.6%) 3 (4.9%)
    2 16 (8.7%) 9 (7.4%) 7 (11%)
1 Mean (SD); n (%)
2 Wilcoxon rank sum test; Pearson’s Chi-squared test; Fisher’s exact test

Table3: Operative Features and Major Complications After Propensity Score Matching

注意:原始数据中 R0Resection 的值全是1。

Table 3. Operative Features and Major Complications After PSM
Characteristic Overall
N = 183
1
0
N = 122
1
1
N = 61
1
p-value2
R0Resection



    1 183 (100%) 122 (100%) 61 (100%)
IntraoperativeBloodLoss 27 (34) 29 (40) 24 (15) 0.920
OperationDuration 173 (50) 159 (46) 202 (43) <0.001
DrainageDuration 5.19 (3.13) 5.26 (3.53) 5.03 (2.14) 0.990
DrainageVolume 856 (679) 842 (722) 885 (586) 0.313
LymphNodesStationsDissected 7.81 (1.60) 7.34 (1.52) 8.74 (1.33) <0.001
LymphNodesDissected 23 (9) 21 (9) 26 (8) <0.001
LengthOfPostoperativeStay 6.39 (3.39) 6.30 (3.19) 6.59 (3.77) 0.971
1 n (%); Mean (SD)
2 NA; Wilcoxon rank sum test

同样的,选择条件logistic回归探索PSM后其他未纳入PSM的连续变量对二分类结局的影响(同时比较PSM前的)

tmp_vars <- c("IntraoperativeBloodLoss",
              "OperationDuration","DrainageDuration","DrainageVolume",
              "LymphNodesStationsDissected","LymphNodesDissected",
              "LengthOfPostoperativeStay"
              )
m_formula <- as.formula(paste0(y_var,"~",paste0(tmp_vars,collapse = "+")))
model_1 <- clogit(m_formula, raw_data)
table_1 <- tbl_regression(model_1, exponentiate = TRUE)

model_2 <- clogit(m_formula, psm_out_all)
table_2 <- tbl_regression(model_2, exponentiate = TRUE) #|>
  # as_gt() |>
  # gt::tab_source_note(gt::md("*After PSM*"))

tbl_merge(
    tbls = list(table_1, table_2),
    tab_spanner = c("**Before PSM**", "**After PSM**")
    )
Characteristic
Before PSM
After PSM
OR 95% CI p-value OR 95% CI p-value
IntraoperativeBloodLoss 0.97 0.95, 0.99 0.001 0.97 0.95, 1.00 0.027
OperationDuration 1.03 1.02, 1.04 <0.001 1.03 1.02, 1.04 <0.001
DrainageDuration 0.84 0.63, 1.12 0.2 0.84 0.61, 1.17 0.3
DrainageVolume 1.00 1.00, 1.00 0.067 1.00 1.00, 1.00 0.3
LymphNodesStationsDissected 2.02 1.56, 2.60 <0.001 1.82 1.36, 2.46 <0.001
LymphNodesDissected 1.01 0.98, 1.05 0.4 1.02 0.98, 1.07 0.3
LengthOfPostoperativeStay 1.18 0.98, 1.43 0.083 1.19 0.94, 1.50 0.2
Abbreviations: CI = Confidence Interval, OR = Odds Ratio

Table 4. Comparison of Clinical Variables and Perioperative Outcomes of uRATS Lobectomy (n = 61) 因缺失Anatomic resection,因此未纳入。

tmp_vars <- c("OperationDuration",
              "IntraoperativeBloodLoss",
              "LengthOfPostoperativeStay",
              "LymphNodesStationsDissected",
              "LymphNodesDissected"
              )
tmp_data2 <- psm_out_all %>%
  dplyr::filter(SurgicalApproach == 1)%>%
  dplyr::select(Gender,Smoking,TumorSize,InductionTreatment,
                all_of(tmp_vars))
  
str(tmp_data2)
## 'data.frame':    61 obs. of  9 variables:
##  $ Gender                     : num  1 1 0 0 0 0 1 0 1 1 ...
##  $ Smoking                    : num  0 0 0 0 0 1 0 0 1 1 ...
##  $ TumorSize                  : num  2.7 2.8 3.8 3.8 2.1 4 2.6 4.3 1.4 2.5 ...
##  $ InductionTreatment         : num  0 0 0 0 0 0 0 0 0 0 ...
##  $ OperationDuration          : num  184 202 231 198 235 180 302 250 197 211 ...
##  $ IntraoperativeBloodLoss    : num  20 20 20 20 50 20 20 30 20 20 ...
##  $ LengthOfPostoperativeStay  : num  12 6 7 5 6 6 6 4 5 5 ...
##  $ LymphNodesStationsDissected: num  9 10 9 6 9 7 7 7 6 8 ...
##  $ LymphNodesDissected        : num  33 24 16 30 17 17 22 17 10 20 ...
tbl_gender <- tmp_data2 %>%
  dplyr::select(-Smoking,-TumorSize,-InductionTreatment)|>
  dplyr::mutate_at(.vars = tmp_vars,.funs = as.numeric)|>
  dplyr::mutate(Gender = as.factor(Gender))|>
  tbl_summary(by = Gender,
              type = list(IntraoperativeBloodLoss ~ "continuous", 
                          LymphNodesStationsDissected ~ "continuous"),
              statistic = list(
                tmp_vars ~ "{mean} ({sd})"
                )) |>
  # add_p(pvalue_fun = label_style_pvalue(digits = 3)) |>
  # add_overall() |>
  bold_labels() 

tbl_smoking <- tmp_data2 %>%
  dplyr::select(-Gender,-TumorSize,-InductionTreatment)|>
  dplyr::mutate_at(.vars = tmp_vars,.funs = as.numeric)|>
  dplyr::mutate(Smoking = as.factor(Smoking))|>
  tbl_summary(by = Smoking,
              type = list(IntraoperativeBloodLoss ~ "continuous", 
                          LymphNodesStationsDissected ~ "continuous"),
              statistic = list(
                tmp_vars ~ "{mean} ({sd})"
                )) |>
  # add_p(pvalue_fun = label_style_pvalue(digits = 3)) |>
  # add_overall() |>
  bold_labels() 

tbl_tumorsize <- tmp_data2 %>%
  dplyr::select(-Gender,-Smoking,-InductionTreatment)|>
  dplyr::mutate(TumorSize = ifelse(TumorSize >=3,">=3","<3"))|>
  dplyr::mutate_at(.vars = tmp_vars,.funs = as.numeric)|>
  dplyr::mutate(TumorSize = as.factor(TumorSize))|>
  tbl_summary(by = TumorSize,
              type = list(IntraoperativeBloodLoss ~ "continuous", 
                          LymphNodesStationsDissected ~ "continuous"),
              statistic = list(
                tmp_vars ~ "{mean} ({sd})"
                )) |>
  # add_p(pvalue_fun = label_style_pvalue(digits = 3)) |>
  # add_overall() |>
  bold_labels() 

tbl_inductiontreatment <- tmp_data2 %>%
  dplyr::select(-Gender,-Smoking,-TumorSize)|>
  dplyr::mutate_at(.vars = tmp_vars,.funs = as.numeric)|>
  dplyr::mutate(InductionTreatment = as.factor(InductionTreatment))|>
  tbl_summary(by = InductionTreatment,
              type = list(IntraoperativeBloodLoss ~ "continuous", 
                          LymphNodesStationsDissected ~ "continuous"),
              statistic = list(
                tmp_vars ~ "{mean} ({sd})"
                )) |>
  # add_p(pvalue_fun = label_style_pvalue(digits = 3)) |>
  # add_overall() |>
  bold_labels() 

# merge tables
tbl_merge(
    tbls = list(tbl_gender, tbl_smoking,tbl_tumorsize,tbl_inductiontreatment),
    tab_spanner = c("**Gender**", "**Smoking**","**Tumor size**","**Induction Treatment**")
    ) |>
  modify_caption("**Table 4. Comparison of Clinical Variables and Perioperative Outcomes of uRATS Lobectomy**")
Table 4. Comparison of Clinical Variables and Perioperative Outcomes of uRATS Lobectomy
Characteristic
Gender
Smoking
Tumor size
Induction Treatment
0
N = 30
1
1
N = 31
1
0
N = 49
1
1
N = 12
1
<3
N = 29
1
>=3
N = 32
1
0
N = 60
1
1
N = 1
1
OperationDuration 189 (32) 214 (49) 199 (41) 214 (51) 202 (38) 202 (48) 201 (43) 232 (NA)
IntraoperativeBloodLoss 25 (19) 23 (11) 23 (16) 26 (12) 22 (11) 25 (18) 24 (15) 20 (NA)
LengthOfPostoperativeStay 6.2 (4.1) 7.0 (3.5) 6.6 (4.0) 6.4 (2.9) 6.3 (3.2) 6.8 (4.2) 6.6 (3.8) 6.0 (NA)
LymphNodesStationsDissected 8.77 (1.30) 8.71 (1.37) 8.84 (1.25) 8.33 (1.61) 9.00 (1.46) 8.50 (1.16) 8.72 (1.33) 10.00 (NA)
LymphNodesDissected 25 (8) 28 (9) 27 (8) 24 (10) 27 (9) 26 (8) 27 (8) 24 (NA)
1 Mean (SD)

5 软件版本信息

## R version 4.5.0 (2025-04-11)
## Platform: x86_64-apple-darwin20
## Running under: macOS Ventura 13.7
## 
## Matrix products: default
## BLAS:   /Library/Frameworks/R.framework/Versions/4.5-x86_64/Resources/lib/libRblas.0.dylib 
## LAPACK: /Library/Frameworks/R.framework/Versions/4.5-x86_64/Resources/lib/libRlapack.dylib;  LAPACK version 3.12.1
## 
## locale:
## [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
## 
## time zone: Asia/Shanghai
## tzcode source: internal
## 
## attached base packages:
## [1] stats     graphics  grDevices utils     datasets  methods   base     
## 
## other attached packages:
## [1] DT_0.33          survival_3.8-3   tidyselect_1.2.1 gtsummary_2.4.0 
## [5] cobalt_4.6.1     MatchIt_4.7.2    magrittr_2.0.4  
## 
## loaded via a namespace (and not attached):
##  [1] gt_1.0.0             sass_0.4.10          generics_0.1.4      
##  [4] tidyr_1.3.1          xml2_1.4.1           stringi_1.8.7       
##  [7] lattice_0.22-6       hms_1.1.4            digest_0.6.37       
## [10] evaluate_1.0.5       grid_4.5.0           RColorBrewer_1.1-3  
## [13] bookdown_0.43        cards_0.7.0          fastmap_1.2.0       
## [16] broom.helpers_1.21.0 jsonlite_2.0.0       Matrix_1.7-3        
## [19] cardx_0.3.0          backports_1.5.0      purrr_1.2.0         
## [22] crosstalk_1.2.2      scales_1.4.0         codetools_0.2-20    
## [25] jquerylib_0.1.4      labelled_2.14.1      cli_3.6.5           
## [28] chk_0.10.0           rlang_1.1.6          crayon_1.5.3        
## [31] litedown_0.7         commonmark_2.0.0     splines_4.5.0       
## [34] withr_3.0.2          cachem_1.1.0         yaml_2.3.10         
## [37] tools_4.5.0          dplyr_1.1.4          ggplot2_4.0.0       
## [40] forcats_1.0.0        broom_1.0.10         vctrs_0.6.5         
## [43] R6_2.6.1             lifecycle_1.0.4      stringr_1.6.0       
## [46] htmlwidgets_1.6.4    pkgconfig_2.0.3      pillar_1.11.1       
## [49] bslib_0.9.0          gtable_0.3.6         glue_1.8.0          
## [52] rmdformats_1.0.4     Rcpp_1.1.0           haven_2.5.5         
## [55] xfun_0.54            tibble_3.3.0         rstudioapi_0.17.1   
## [58] knitr_1.50           farver_2.1.2         htmltools_0.5.8.1   
## [61] rmarkdown_2.30       compiler_4.5.0       S7_0.2.0            
## [64] markdown_2.0

6 参考文献

–

1.
Sjoberg D D., Whiting K, Curry M, Lavery J A., Larmarange J. Reproducible Summary Tables with the gtsummary Package. The R Journal. 2021;13:570.
2.
Ho DE, Imai K, King G, Stuart EA. MatchIt: Nonparametric Preprocessing for Parametric Causal Inference. 2011;
3.
Greifer N. Cobalt: Covariate Balance Tables and Plots. Comprehensive R Archive Network; 2016. page 4.6.1.