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
use ;
/// Represents the type of tail in hypothesis testing.
/// Stores the result of a statistical test, including test statistic, p-value, confidence interval,
/// and hypothesis testing information.
///
/// # Fields
///
/// * `test_statistic` - The value of the test statistic.
/// * `p_value` - The p-value associated with the test statistic.
/// * `confidence_interval` - The confidence interval for the estimate (lower, upper bounds).
/// * `null_hypothesis` - The null hypothesis being tested.
/// * `alt_hypothesis` - The alternative hypothesis being tested.
/// * `reject_null` - A boolean indicating whether the null hypothesis should be rejected.
///
/// # Example
///
/// ```rust
/// use hypors::common::TestResult;
///
/// let test_result = TestResult {
/// test_statistic: 2.5,
/// p_value: 0.02,
/// confidence_interval: (1.0, 3.0),
/// null_hypothesis: String::from("Mean equals 0"),
/// alt_hypothesis: String::from("Mean is not equal to 0"),
/// reject_null: true,
/// };
///
/// assert_eq!(test_result.test_statistic, 2.5);
/// assert_eq!(test_result.p_value, 0.02);
/// assert!(test_result.reject_null);
/// ```