From the course: The Modern Stata Playbook: Critical Enhancements You Need to Know
Unlock this course with a free trial
Join today to access over 25,100 courses taught by industry experts.
Causal mediation analysis - Stata Tutorial
From the course: The Modern Stata Playbook: Critical Enhancements You Need to Know
Causal mediation analysis
The goal of causal inference is to identify and identify a treatment effect on an outcome. But often part of the effect flows through another variable, creating both direct and indirect effects. And that's mediation. The new mediate command allows you to estimate these effects easily. Imagine a simple causal diagram where exercise effects will be. But why does this happen? exercising increases certain chemicals in the body that leads to improved feelings of well-being. And that can be represented on the diagram by a mediating variable, in this case hormones. This can create multiple paths. You can have a direct path where exercise directly affects well-being, or you can have an indirect path where exercise affects well-being through a hormone. The key question is which path dominates. The command mediate fits causal mediation models in Stata in one step. Specify an outcome variable, and if you want a control list, this is then followed by a mediating variable with another optional…