Closed lucasmarques2003 closed 1 month ago
Hi Lucas,
This page provides simple examples for estimating treatment (X) effects on an outcome (Y). https://www.pywhy.org/dowhy/v0.11.1/example_notebooks/dowhy_simple_example.html
model=CausalModel(
data = df,
treatment=data["treatment_name"],
outcome=data["outcome_name"],
graph=data["gml_graph"]
)
identified_estimand = model.identify_effect(proceed_when_unidentifiable=True)
causal_estimate = model.estimate_effect(identified_estimand,
method_name="backdoor.propensity_score_stratification")
print(causal_estimate)
Treatment (X) and output variables (Y) are specified when you initialize the CausalModel. If you don't have a graph but just happen to know what your confounders are, there are instructions on that page for how to initialize a canonical causal model.
The identification step figures out how to calculate E(Y|do(X)) for a specific graph; and then estimation actually does the calculation.
This issue is stale because it has been open for 14 days with no activity.
This issue was closed because it has been inactive for 7 days since being marked as stale.
I just wanted to estimate a simple do operation, for example $E(Y|do(X))$ and I can't find an easy way on the documentation. I used dowhy.causal_model.do but it just didn't work