RegressionKink#

class causalpy.experiments.regression_kink.RegressionKink[source]#

A class to analyse regression kink designs.

Parameters:
  • data (DataFrame) – A pandas dataframe

  • formula (str) – A statistical model formula

  • kink_point (float) – A scalar value at which the kink occurs

  • model (PyMCModel | None) – A PyMC model. Defaults to LinearRegression.

  • running_variable_name (str) – The name of the running variable column

  • epsilon (float) – A small scalar for evaluating the causal impact above/below the kink

  • bandwidth (float) – Data outside of the bandwidth (relative to the kink) is not used to fit the model.

Methods

RegressionKink.__init__(data, formula, ...)

RegressionKink.algorithm()

Run the experiment algorithm: fit model, predict, and evaluate gradient change.

RegressionKink.effect_summary(*[, ...])

Generate a decision-ready summary of causal effects for Regression Kink.

RegressionKink.fit(*args, **kwargs)

RegressionKink.get_plot_data(*args, **kwargs)

Recover the data of an experiment along with the prediction and causal impact information.

RegressionKink.get_plot_data_bayesian(*args, ...)

Return plot data for Bayesian models.

RegressionKink.get_plot_data_ols(*args, **kwargs)

Return plot data for OLS models.

RegressionKink.input_validation()

Validate the input data and model formula for correctness

RegressionKink.plot(*args, **kwargs)

Plot the model.

RegressionKink.print_coefficients([round_to])

Ask the model to print its coefficients.

RegressionKink.summary([round_to])

Print summary of main results and model coefficients.

Attributes

idata

Return the InferenceData object of the model.

supports_bayes

supports_ols

labels

__init__(data, formula, kink_point, model=None, running_variable_name='x', epsilon=0.001, bandwidth=inf, **kwargs)[source]#
Parameters:
Return type:

None

classmethod __new__(*args, **kwargs)#