Step 3 – obtaining estimates
In this section, we’ll compute causal effect estimates for our model.
Computing estimates using DoWhy is as simple as it can be. To do it, we need to call the .estimate_effect()
method of our CausalModel
object:
estimate = model.estimate_effect( Â Â Â Â identified_estimand=estimand, Â Â Â Â method_name='frontdoor.two_stage_regression')
We pass two arguments to the method:
- Our identified estimand
- The name of the method that will be used to compute the estimate
You might recall from Chapter 6 that we needed to fit two linear regression models, get their coefficients, and multiply them in order to obtain the final causal effect estimate. DoWhy makes this process much easier for us.
Let’s print out the result:
print(f'Estimate of causal effect ( Â Â Â Â linear regression): {estimate.value}')
This gives us the following output:
Estimate...