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

Error with Do operator. #1240

Open
brrbaral opened this issue Aug 20, 2024 · 0 comments
Open

Error with Do operator. #1240

brrbaral opened this issue Aug 20, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@brrbaral
Copy link

Hi, pywhy I am having issue with implementing 'do' operator.

Error:
AttributeError: 'int' object has no attribute 'copy'

Code that is producing error

import dowhy.datasets
dataset = dowhy.datasets.lalonde_dataset()
dataset=dataset.replace({True:1,False:0})
dataset
treatment_col='treat'
outcome_col='re78'
from dowhy import CausalModel
model=CausalModel(
        data = dataset,
        treatment=treatment_col,
        outcome=outcome_col,
        common_causes='nodegr+black+hisp+age+educ+married'.split('+'))
model
identified_estimand = model.identify_effect(proceed_when_unidentifiable=True)
print(identified_estimand)
# Estimate with confidence intervals and p-values
estimate = model.estimate_effect(
    identified_estimand,
    method_name="backdoor.linear_regression",
    test_significance=True
)
estimate.value
estimate.get_confidence_intervals()
estimate.estimator.do(x=1,data_df=dataset)

Version information:

  • 0.11.1

Thank you

@brrbaral brrbaral added the bug Something isn't working label Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant