HypoResult

class hypotestx.core.result.HypoResult(test_name: str, statistic: float, p_value: float, effect_size: float | None = None, effect_size_name: str | None = None, confidence_interval: tuple | None = None, degrees_of_freedom: int | tuple | None = None, sample_sizes: int | tuple | None = None, assumptions_met: Dict[str, bool] | None = None, interpretation: str | None = None, data_summary: Dict[str, Any] | None = None, alpha: float = 0.05, alternative: str = 'two-sided', **kwargs)[source]

Bases: object

Standardized result object for hypothesis tests

property is_significant: bool

Check if result is statistically significant

property effect_magnitude: str

Interpret effect size magnitude using Cohen’s conventions for the appropriate measure.

summary(verbose: bool = False) str[source]

Human-readable summary of results

to_dict() Dict[str, Any][source]

Convert result to dictionary

plot(kind: str = 'auto')[source]

Visualise this result.

Delegates to hypotestx.explore.visualize.plot_result().

Parameters:

kind (str) – "auto" (default), "p_value", "bar", "box".

Return type:

matplotlib.figure.Figure

Raises:

ImportError – If matplotlib is not installed. Install with pip install matplotlib or pip install hypotestx[visualization].

Fields Reference

Field

Type

Description

test_name

str

Human-readable test name

statistic

float

Test statistic value (t, F, χ², U, W, r, …)

p_value

float

p-value

effect_size

float | None

Effect size (Cohen’s d, r, η², Cramér’s V, …)

effect_size_name

str | None

Name of the effect size measure

confidence_interval

tuple[float, float] | None

(lower, upper) confidence interval

degrees_of_freedom

int | float | None

Degrees of freedom

sample_sizes

int | tuple | None

Per-group or total sample size(s)

assumptions_met

dict[str, bool]

Assumption check results

interpretation

str | None

Plain-English interpretation

alpha

float

Significance level used

alternative

str

"two-sided", "greater", or "less"

routing_confidence

float

Routing confidence: 1.0 (LLM) or 0.6 (fallback)

routing_source

str

"llm" or "fallback"

is_significant

bool (property)

True if p_value < alpha

effect_magnitude

str (property)

"negligible", "small", "medium", or "large"