How to Calculate a Single SMD for Categorical Variables with More Than Three Levels After IPTW?

I am conducting an analysis using Inverse Probability of Treatment Weighting (IPTW) and would like to evaluate balance between treatment and control groups using Standardized Mean Differences (SMD).

For categorical variables with more than three levels, I have encountered the following challenges:

  1. When using the PSWeight package and its SumStat function, SMDs are calculated for each category, with one category treated as the reference.
  2. When using the WeightIt and cobalt packages, SMDs are also calculated for each category, rather than providing a single SMD for the entire variable.

However, I would like to calculate a single SMD to evaluate the balance for a categorical variable with multiple levels.

What I Tried

I have reviewed the documentation for PSWeight and WeightIt, but I could not find a straightforward way to aggregate SMDs into one value. I understand that some methods, such as chi-squared-based statistics or weighted averages, might work, but I am unsure how to implement them correctly in R.

Desired Outcome

  • A clear explanation or example code for calculating a single SMD for categorical variables with three or more levels after IPTW adjustment.
  • If possible, I would like to know how to achieve this using the PSWeight or WeightIt packages.

Thank you in advance for your assistance!