McCraryDensityTest#

class causalpy.checks.mccrary.McCraryDensityTest[source]#

Test for manipulation of the running variable at the threshold.

Compares the density of observations just below and just above the treatment threshold using a histogram-based approach.

Parameters:
  • n_bins (int) – Number of bins on each side of the threshold.

  • alpha (float) – Significance level for the test.

Examples

>>> import causalpy as cp
>>> check = cp.checks.McCraryDensityTest(n_bins=20)

Methods

McCraryDensityTest.__init__([n_bins, alpha])

McCraryDensityTest.run(experiment, context)

Test for manipulation of the running variable at the threshold.

McCraryDensityTest.validate(experiment)

Verify the experiment is a RegressionDiscontinuity instance.

Attributes

applicable_methods

__init__(n_bins=20, alpha=0.05)[source]#
Parameters:
Return type:

None

classmethod __new__(*args, **kwargs)#