ngreifer / cobalt

Covariate Balance Tables and Plots - An R package for assessing covariate balance
https://ngreifer.github.io/cobalt/
73 stars 12 forks source link

Is it possible to add the function of returning the comparison table of the basic information of the two groups of patients before and after weighting in bal.tab() #72

Open zhangkaicr opened 1 year ago

zhangkaicr commented 1 year ago

I'm an Oncology PhD Institute. Thank you very much for this package that can easily perform SMD analysis on the results of various weighting and matching scoring packages. However, in clinical research, we often need to display the baseline information of the patients in addition to analyzing the weighted or matching SMD of the two groups of patients before and after. Unfortunately, I haven't found a package that can do this well. The general baseline information table can be easily completed using the gtsummary series, but it does not support the comparison of weighted information. I believe that if this function can be completed, the application of your package in the medical field will be more common, thank you.

Below is a table of baseline information from an article in a top journal on surgery image

Article address image https://pubmed.ncbi.nlm.nih.gov/31478977/

ngreifer commented 1 year ago

bal.tab() can already display weighted and unweighted means and standard deviations for each covariate. Just set disp = c("m", "sd") in the call to bal.tab(). That is sufficient for reporting the distribution of baseline covariates before and after weighting. You might also use the tableone package. But it is critical that you do not report the SMDs or any balance statistics from tableone or gtsummary. Use cobalt to compute balance statistics.