Skip to content

Better handling of treated input in RegressionDiscontinuity #440

Open
@drbenvincent

Description

@drbenvincent

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions