Generating Standardised Mean Differences in R

137 views Asked by At

I would like to generate SMD and plot them without including the prediction model in my code; I am using the cobalt package and specifically the loveplot command to generate the plot. However, I would like to just include the probability of treatment in my code as opposed to including the full prediction model in the code as shown below.

library(WeightIt); data("lalonde", package = "cobalt")


w.out1 <- weightit(treat ~ age + educ + race + 
                     married + nodegree + re74 + re75, 
                   data = lalonde)


love.plot(treat ~ age + educ + race + 
            married + nodegree + re74 + re75, 
          data = lalonde, 
          weights = list(IPW =w.out1 ),
          var.order = "alphabetical", binary = "std",
          abs = FALSE, colors = c("red", "blue"), 
          shapes = c("circle", "triangle"),
          sample.names = c("Unweighted", "PS Weighted"),
          line = FALSE,
          themes = list(theme(legend.position = "top")))


0

There are 0 answers