:py:mod:`causal_testing.testing.causal_effect` ============================================== .. py:module:: causal_testing.testing.causal_effect .. autoapi-nested-parse:: This module contains the CausalEffect abstract class, as well as the concrete extension classes: ExactValue, Positive, Negative, SomeEffect, NoEffect Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: causal_testing.testing.causal_effect.CausalEffect causal_testing.testing.causal_effect.SomeEffect causal_testing.testing.causal_effect.NoEffect causal_testing.testing.causal_effect.ExactValue causal_testing.testing.causal_effect.Positive causal_testing.testing.causal_effect.Negative .. py:class:: CausalEffect Bases: :py:obj:`abc.ABC` An abstract class representing an expected causal effect. .. py:method:: apply(res: causal_testing.testing.causal_test_result.CausalTestResult) -> bool :abstractmethod: Abstract apply method that should return a bool representing if the result meets the outcome :param res: CausalTestResult to be checked :return: Bool that is true if outcome is met .. py:method:: __str__() -> str Return str(self). .. py:class:: SomeEffect Bases: :py:obj:`CausalEffect` An extension of CausalEffect representing that the expected causal effect should not be zero. .. py:method:: apply(res: causal_testing.testing.causal_test_result.CausalTestResult) -> bool Abstract apply method that should return a bool representing if the result meets the outcome :param res: CausalTestResult to be checked :return: Bool that is true if outcome is met .. py:class:: NoEffect(atol: float = 1e-10, ctol: float = 0.05) Bases: :py:obj:`CausalEffect` An extension of CausalEffect representing that the expected causal effect should be zero. :param atol: Arithmetic tolerance. The test will pass if the absolute value of the causal effect is less than atol. :param ctol: Categorical tolerance. The test will pass if this proportion of categories pass. .. py:method:: apply(res: causal_testing.testing.causal_test_result.CausalTestResult) -> bool Abstract apply method that should return a bool representing if the result meets the outcome :param res: CausalTestResult to be checked :return: Bool that is true if outcome is met .. py:class:: ExactValue(value: float, atol: float = None, ci_low: float = None, ci_high: float = None) Bases: :py:obj:`CausalEffect` An extension of CausalEffect representing that the expected causal effect should be a specific value. .. py:method:: apply(res: causal_testing.testing.causal_test_result.CausalTestResult) -> bool Abstract apply method that should return a bool representing if the result meets the outcome :param res: CausalTestResult to be checked :return: Bool that is true if outcome is met .. py:method:: __str__() Return str(self). .. py:class:: Positive Bases: :py:obj:`SomeEffect` An extension of CausalEffect representing that the expected causal effect should be positive. Currently only single values are supported for the test value .. py:method:: apply(res: causal_testing.testing.causal_test_result.CausalTestResult) -> bool Abstract apply method that should return a bool representing if the result meets the outcome :param res: CausalTestResult to be checked :return: Bool that is true if outcome is met .. py:class:: Negative Bases: :py:obj:`SomeEffect` An extension of CausalEffect representing that the expected causal effect should be negative. Currently only single values are supported for the test value .. py:method:: apply(res: causal_testing.testing.causal_test_result.CausalTestResult) -> bool Abstract apply method that should return a bool representing if the result meets the outcome :param res: CausalTestResult to be checked :return: Bool that is true if outcome is met