Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do operator #1251

Closed
lucasmarques2003 opened this issue Sep 12, 2024 · 3 comments
Closed

Do operator #1251

lucasmarques2003 opened this issue Sep 12, 2024 · 3 comments
Labels
question Further information is requested stale

Comments

@lucasmarques2003
Copy link

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

@lucasmarques2003 lucasmarques2003 added the question Further information is requested label Sep 12, 2024
@emrekiciman
Copy link
Member

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.

Copy link

This issue is stale because it has been open for 14 days with no activity.

@github-actions github-actions bot added the stale label Sep 27, 2024
Copy link

github-actions bot commented Oct 4, 2024

This issue was closed because it has been inactive for 7 days since being marked as stale.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested stale
Projects
None yet
Development

No branches or pull requests

2 participants