cleverly.sensitivity.EValue#

class cleverly.sensitivity.EValue(estimand: str, scale: str, risk_ratio: float, risk_ratio_ci: tuple[float, float], point: float, limit: float, approximate: bool, note: str = '', source_estimand: str | None = None, truncated_bound: float | None = None, support: Support = Support(label='experimental', reason='This estimate was built outside a classified fit.', evidence=(), row=None, limits=()))[source]#

E-values for a point estimate and the confidence limit nearest the null.

Parameters:
estimandstr

Alias of the estimand this row describes.

scalestr

Scale the estimate was reported on before conversion.

risk_ratiofloat

The estimate expressed as a risk ratio.

risk_ratio_cituple of float

That ratio’s confidence interval. A converted lower bound below zero is outside the risk-ratio parameter space. The report truncates it at zero, records the untruncated value in truncated_bound, and says so in note.

pointfloat

Equal-strength threshold for the confounder’s treatment and outcome associations on the risk-ratio scale to explain the point estimate away. Unequal association strengths can trade off.

limitfloat

The equal-strength threshold to move the confidence limit to the null.

approximatebool

Whether reaching the risk-ratio scale needed an approximate conversion.

notestr

Explanation of that conversion, when one was used.

source_estimandstr or None

Reported source alias, which can differ from a derived output alias.

truncated_boundfloat or None

The converted lower bound before truncation, when the report truncated one. None when risk_ratio_ci reports the conversion unchanged.

supportSupport

The support of the source estimate, combined with the derived ratio’s when the row derives one. An E-value built outside a classified fit is experimental.

Methods#

EValue.summary() → str[source]#

Return a printable summary.

Returns:
str

A printable report, one line per reported quantity.

EValue.to_dict() → dict[str, float | str | bool | None][source]#

Return a JSON-compatible representation.

truncated_bound carries the untruncated lower bound, so a caller who reads only this mapping still sees that rr_ci_lower is a boundary value rather than a converted confidence limit.

Returns:
dict

A JSON-compatible mapping of every reported field.

Attributes#

EValue.note: str = ''#
EValue.source_estimand: str | None = None#
EValue.support: Support = Support(label='experimental', reason='This estimate was built outside a classified fit.', evidence=(), row=None, limits=())#
EValue.truncated_bound: float | None = None#
EValue.estimand: str#
EValue.scale: str#
EValue.risk_ratio: float#
EValue.risk_ratio_ci: tuple[float, float]#
EValue.point: float#
EValue.limit: float#
EValue.approximate: bool#