Skip to content
New issue

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

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

Already on GitHub? # to your account

Better handling of treated input in RegressionDiscontinuity #440

Open
2 tasks
drbenvincent opened this issue Feb 28, 2025 · 1 comment
Open
2 tasks

Better handling of treated input in RegressionDiscontinuity #440

drbenvincent opened this issue Feb 28, 2025 · 1 comment
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@drbenvincent
Copy link
Collaborator

When doing regression discontinuity analysis, eg.

result = cp.RegressionDiscontinuity(
    df,
    formula="y ~ 1 + x + treated + x:treated",
    model=cp.pymc_models.LinearRegression(sample_kwargs={"random_seed": seed}),
    treatment_threshold=0.5,
)

it looks like treated has to be of type bool. A mysterious error arises if it is instead 0's and 1's coded as int's.

  • Add an extra data validation step
  • Add a test to check that we get an exception if we provide ints
@drbenvincent drbenvincent added bug Something isn't working good first issue Good for newcomers labels Feb 28, 2025
@inhandan
Copy link

inhandan commented Mar 7, 2025

I'd like to solve this. Can you provide a code snippet and error message? Please include definition of the df, and in particular the treated column

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants
@drbenvincent @inhandan and others