pub struct TestResult {
pub statistic: f64,
pub p_value: f64,
pub log_p_value: Option<f64>,
pub df: Option<f64>,
pub effect_size: Option<f64>,
}Expand description
The outcome of a hypothesis test: its statistic, p-value, and — where the test defines them — degrees of freedom and an effect size.
df and effect_size are None for tests that define no such quantity (e.g.
Shapiro–Wilk, Fisher exact), matching the reference’s contract rather than
emitting a misleading numeric placeholder.
log_p_value is the natural log of the p-value (ln(p_value), the
scipy.stats logsf/logcdf convention), populated for the tests whose null
is a continuous distribution with a numerically-stable log tail (the t-tests,
ANOVA/F, and the chi-squared-routed tests). It stays finite in the extreme tail
where the linear Self::p_value underflows to 0.0. It is
None for tests that report no continuous-tail p-value in log space (e.g. the
exact rank tests and Shapiro–Wilk); Self::p_value is unchanged regardless.
Fields§
§statistic: f64The test statistic (χ², t, F, U, …) — its meaning is per-test.
p_value: f64The p-value in [0, 1] for the test’s selected alternative.
log_p_value: Option<f64>ln(p_value), finite in the extreme tail where p_value underflows, or
None for tests with no log-space p-value path.
df: Option<f64>Degrees of freedom, or None when the test defines none.
effect_size: Option<f64>The effect size (Cramér’s V, η², rank-biserial, …), or None.
Trait Implementations§
Source§impl Clone for TestResult
impl Clone for TestResult
Source§fn clone(&self) -> TestResult
fn clone(&self) -> TestResult
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TestResult
impl Debug for TestResult
Source§impl PartialEq for TestResult
impl PartialEq for TestResult
Source§fn eq(&self, other: &TestResult) -> bool
fn eq(&self, other: &TestResult) -> bool
self and other values to be equal, and is used by ==.