Skip to main content

Module testing

Module testing 

Source
Expand description

Hypothesis testing.

Parametric and non-parametric statistical tests: t-tests, ANOVA, chi-squared tests, and normality tests.

§Examples

use u_analytics::testing::{one_sample_t_test, TestResult};

let data = [5.1, 4.9, 5.2, 5.0, 4.8, 5.3, 5.1, 4.9];
let result = one_sample_t_test(&data, 5.0).unwrap();
assert!(result.p_value > 0.05); // cannot reject H₀: μ = 5.0

Structs§

AdNormalityResult
Result of the Anderson-Darling normality test (Stephens 1974 variant).
AdfResult
Result of the Augmented Dickey-Fuller (ADF) unit root test.
AndersonDarlingResult
Result of the Anderson-Darling normality test.
AnovaResult
Result of one-way ANOVA.
MannKendallResult
Result of the Mann-Kendall trend test.
ShapiroWilkResult
Result of the Shapiro-Wilk normality test.
TestResult
Result of a hypothesis test.

Enums§

AdfModel
Model specification for the ADF test.

Functions§

adf_test
Augmented Dickey-Fuller (ADF) unit root test for stationarity.
anderson_darling_normality
Anderson-Darling normality test (Stephens 1974): H₀: data is normally distributed.
anderson_darling_test
Anderson-Darling normality test: H₀: data is normally distributed.
bartlett_test
Bartlett test for equality of variances: H₀: all groups have equal variance.
benjamini_hochberg
Benjamini-Hochberg FDR correction.
bonferroni_correction
Bonferroni correction: adjusts p-values for multiple comparisons.
chi_squared_goodness_of_fit
Chi-squared goodness-of-fit test: H₀: observed matches expected distribution.
chi_squared_independence
Chi-squared test of independence on a contingency table.
fisher_exact_test
Fisher exact test for a 2×2 contingency table.
jarque_bera_test
Jarque-Bera normality test: H₀: data is normally distributed.
kruskal_wallis_test
Kruskal-Wallis test: H₀: all groups have the same distribution.
levene_test
Levene test for equality of variances: H₀: all groups have equal variance.
mann_kendall_test
Mann-Kendall non-parametric trend test with Sen’s slope estimator.
mann_whitney_u_test
Mann-Whitney U test: H₀: the two populations have the same distribution.
one_sample_t_test
One-sample t-test: H₀: μ = μ₀.
one_way_anova
One-way ANOVA: H₀: all group means are equal.
paired_t_test
Paired t-test: H₀: mean difference = 0.
shapiro_wilk_test
Shapiro-Wilk normality test: H₀: data is normally distributed.
two_sample_t_test
Two-sample Welch t-test: H₀: μ₁ = μ₂ (unequal variances).
wilcoxon_signed_rank_test
Wilcoxon signed-rank test: H₀: median of differences = 0.