1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
//! Effect Size and Confidence Interval Analysis
//!
//! This module contains structures for effect size measures, confidence intervals,
//! and bootstrap analysis for statistical significance assessment.
use serde::{Deserialize, Serialize};
/// Effect size measures
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct EffectSize {
/// Cohen's d
pub cohens_d: f64,
/// Glass's delta
pub glass_delta: f64,
/// Hedges' g
pub hedges_g: f64,
/// Cliff's delta (non-parametric)
pub cliffs_delta: f64,
/// Effect size interpretation
pub interpretation: EffectSizeInterpretation,
}
/// Interpretation of effect size magnitude
#[derive(Debug, Clone, Serialize, Deserialize)]
pub enum EffectSizeInterpretation {
/// Negligible effect size
Negligible,
/// Small effect size
Small,
/// Medium effect size
Medium,
/// Large effect size
Large,
/// Very large effect size
VeryLarge,
}
/// Confidence interval
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ConfidenceInterval {
/// Lower bound
pub lower: f64,
/// Upper bound
pub upper: f64,
/// Confidence level
pub confidence_level: f64,
/// Method used to calculate interval
pub method: ConfidenceIntervalMethod,
}
/// Method for calculating confidence intervals
#[derive(Debug, Clone, Serialize, Deserialize)]
pub enum ConfidenceIntervalMethod {
/// Normal distribution assumption
Normal,
/// Bootstrap confidence interval
Bootstrap,
/// T-distribution confidence interval
TDistribution,
/// Percentile-based confidence interval
Percentile,
}
/// Bootstrap confidence interval
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct BootstrapInterval {
/// Statistic name
pub statistic: String,
/// Original estimate
pub original_estimate: f64,
/// Bootstrap mean
pub bootstrap_mean: f64,
/// Bootstrap standard error
pub bootstrap_se: f64,
/// Bootstrap bias
pub bias: f64,
/// Bias-corrected estimate
pub bias_corrected: f64,
/// Percentile confidence interval
pub percentile_ci: ConfidenceInterval,
/// Bias-corrected and accelerated (BCa) interval
pub bca_ci: Option<ConfidenceInterval>,
}