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:
- When using the
PSWeight
package and itsSumStat
function, SMDs are calculated for each category, with one category treated as the reference. - When using the
WeightIt
andcobalt
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
orWeightIt
packages.
Thank you in advance for your assistance!