Author: Bailey DeBarmore
Learning about a method in class, like inverse probability weighting, is different than implementing it in practice.
This post will remind you why we might be interested in propensity scores to control for confounding - specifically inverse probability of treatment weights and SMR - and then show how to do so in SAS and Stata.
If you have corresponding code in R that you'd like to add to this post, please contact me.
A note about weighting versus multivariable regression:
Effect estimate interpretations when you use weighting are marginal effect in the target population. When you adjust for covariates in a regression model, you are interpreting a conditional effect, that is, the effect of the exposure holding (conditional on) the covariates being constant.
Conditional estimates are troublesome with time-varying covariates because we run into collider bias and conditioning on mediators, thus weights are preferable. In simpler situations, using weights over multivariable regression can help with convergence issues .
Files to Download: .txt file with SAS and Stata code, as well as a PDF version of this post with code (perfect for students) available to download at the end of the post or at my github
Trying to figure out how to model a categorical predictor in your regression?
Done this code a million times but can never remember the syntax for the class statement?
Want to generate exponentiated estimates and confidence intervals?
We'll give examples for binary, 3 levels, 4 levels, and stratified.
Practical solutions for conducting great epidemiology methods. Transparency in code. Attitude of constant improvement.
Appreciate our stuff?