Closed maellecoursonnais closed 2 years ago
Actually, this is not possible and I programmed it this way for a reason (i.e., it is technically possible but I don't think it should be done so I don't allow it). The average SMD is useful when the effect estimate is the average of several effect estimates and offsetting biases cancel out, for example, with multiply imputed data or clustered data where the clustering is incidental. Within longitudinal treatments, this is not the case. Balance must be achieved at each time point, not in aggregate, so the average SMD across time points is not a valid measure of balance (i.e., because it will miss imbalance in some time periods, which do not cancel out with offsetting imbalances in other time periods). I recommend you stick with the maximum balance statistic provided by default or look at balance at individual time points.
If you want to compute average SMDs across time points, I cannot condone this, so you will have to do it manually. Some code to do that might be the following:
colMeans(dplyr::bind_rows(lapply(baltab$Time.Balance, \(x) {
setNames(x$Balance$Diff.Adj, rownames(x$Balance))
})), na.rm = TRUE)
Hello,
As far as I know, there is no easy way to access the mean covariate balance across times, only the max is available. I'm guessing that could be an easy thing to add to the function?
Minimal example:
So we get the Max here, but not the mean value. Are you aware of a way to compute those values? It seems it is possible to plot them with
love.plot
but not to get them directly frombal.tab
.Cheers!