Calculate single absolute standardized difference across levels of a categorical treatment variable cobalt::bal.tab Can I calculate a single absolute standardized difference (ASD) across the levels of my categorical treatment variable? For reporting in a balance table.
I performed an inverse probability of treatment weighting analysis to estimate the average treatment effect of provider experience on complications after surgery. I used cobalt::bal.tab (R) to generate my balance table reporting ASD before and after adjustment. The output provides an unadjusted and adjusted difference for each level of each categorical variable.
A peer reviewer requests I report one ASD per categorical variable (not one for each level). Is there a way to calculate this by hand or does cobalt::bal.tab provide a solution I have not discovered yet?
An example of a section of my output: ('Age' is continuous and 'ASA status' categorical with 4 levels.)
Unweighted Population                      IPTW Population
Basic               Advanced        ASD    Basic            Advanced            ASD
n   100             200                    200              300 
Age 34 (24.3-52.0)  38 (27.0-57.8)  0.22   34.0 (25.0-55.9) 36.2 (27.0-57.0)    0.08
ASA status                      
 1  70 (70)         100 (50)        0.20   120 (60)         150 (50)            0.10
 2  20 (20)         80  (40)        0.10   60  (30)         100 (33)            0.03
 3  8  (8)          40  (20)        0.12   30  (10)         50  (17)            0.07
 4  0  (0)          8   (4)         0.04   0   (0)          9   (3)             0.03

etc...
So for 'ASA status' can I calculate a single ASD across the four levels? One unadjusted and one adjusted?
Thank you for reading my question :-)
 A: Author of cobalt here. What the reviewer is requesting doesn't really make a lot of sense. The bias in an effect estimate is a function of the mean difference of each level of the categorical variable. You could create a one-dimensional summary of balance for that categorical variable, e.g., as the maximum SMD for that variable, and then just mention the interpretation of that summary in the caption of your table. There isn't a way to do this automatically in cobalt, and it seems to me to lose important information.
I will note that there has been a value proposed as an equivalent to the SMD for categorical variables. This was proposed by Yang and Dalton (2012). It doesn't have an intuitive interpretation except vaguely as the equivalent of the SMD. It is calculated as the Mahalanobis distance between the two samples based on the categorical variable. A nice aspect of its interpretation is that for two-level variables, the formula reduces to the SMD. The bias in the effect estimate is not a function of this value, though, at it seems to me that it would be possible to have an extreme imbalance in one level of the variable that is masked by the other levels.
It is not in cobalt because the current framework wouldn't work with it (cobalt turns the supplied dataset into a numerical matrix, losing the relationship among levels of the categorical variable by turning them into dummy variables). There is another package that can be used to assess balance called tableone, which does compute this modified SMD for categorical variables. It also produces beautiful tables, much nicer than those from cobalt, the latter of which are mainly for use in balance assessment rather than reporting. You can see examples of such a table using the modified SMD on the package vignette.
This is such a minute detail for a reviewer to focus on. SMDs themselves are an arbitrary method to assess balance, so it's not clear to me why a specific method of computing a summary SMD should be preferred over another. Given that this value the reviewer wants you to compute is just a summary of the balance for each categorical variable, you could choose any summary and explain it in a caption. No one summary is superior to another. As long as you can convincingly demonstrate balance, you should be okay.
