Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
"""Refute an estimated causal effect.
If method_name is provided, uses the provided method. In the future, we may support automatic selection of suitable refutation tests.
:param estimand: target estimand, an instance of the IdentifiedEstimand class (typically, the output of identify_effect)
:param estimate: estimate to be refuted, an instance of the CausalEstimate class (typically, the output of estimate_effect)
:param method_name: name of the refutation method
:param **kwargs: (optional) additional method-specific arguments that are passed directly to the refutation method
:returns: an instance of the RefuteResult class
"""
if method_name is None:
pass
else:
refuter_class = causal_refuters.get_class_object(method_name)
refuter = refuter_class(
self._data,
identified_estimand=estimand,
estimate=estimate,
**kwargs
)
res = refuter.refute_estimate()
return res