ggplot(data = smds,aes(x =abs(smd), y = variable, group = method, color = method )) +geom_love()ggplot(data = smds,aes(x =abs(smd), y = variable, group = method, color = method )) +geom_love()ggplot(data = smds,aes(x =abs(smd), y = variable, group = method, color = method )) +geom_love()ggplot(data = smds,aes(x =abs(smd), y = variable, group = method, color = method )) +geom_love()
Love plot
Your turn 1
06:00
Create a Love Plot for the propensity score weighting you created in the previous exercise
ECDF
For continuous variables, it can be helpful to look at the whole distribution pre and post-weighting rather than a single summary measure
ECDF
Unweighted ECDF
ggplot(nhefs_complete_wts, aes(x = wt71, color =factor(qsmk))) +geom_ecdf() +scale_color_manual("Quit smoking", values =c("#5154B8", "#5DB854"),labels =c("Yes", "No") ) +xlab("Weight in Kg in 1971") +ylab("Proportion <= x") ggplot(nhefs_complete_wts, aes(x = wt71, color =factor(qsmk))) +geom_ecdf() +scale_color_manual("Quit smoking", values =c("#5154B8", "#5DB854"),labels =c("Yes", "No") ) +xlab("Weight in Kg in 1971") +ylab("Proportion <= x") ggplot(nhefs_complete_wts, aes(x = wt71, color =factor(qsmk))) +geom_ecdf() +scale_color_manual("Quit smoking", values =c("#5154B8", "#5DB854"),labels =c("Yes", "No") ) +xlab("Weight in Kg in 1971") +ylab("Proportion <= x")
Unweighted ECDF
Weighted ECDF
ggplot(nhefs_complete_wts, aes(x = wt71, color =factor(qsmk))) +geom_ecdf(aes(weights = w_ate)) +scale_color_manual("Quit smoking", values =c("#5154B8", "#5DB854"),labels =c("Yes", "No") ) +xlab("Weight in Kg in 1971") +ylab("Proportion <= x (Weighted)") ggplot(nhefs_complete_wts, aes(x = wt71, color =factor(qsmk))) +geom_ecdf(aes(weights = w_ate)) +scale_color_manual("Quit smoking", values =c("#5154B8", "#5DB854"),labels =c("Yes", "No") ) +xlab("Weight in Kg in 1971") +ylab("Proportion <= x (Weighted)")
Weighted ECDF
Your turn 2
06:00
Create an unweighted ECDF examining the park_temperature_high confounder by whether or not the day had Extra Magic Hours.
Create a weighted ECDF examining the park_temperature_high confounder
Bonus! Weighted Tables in R
1. Create a “design object” to incorporate the weights