use basic_stats::{
core::{AltHyp, Hyp, SampleMoments},
normal::{welch_ci, welch_test},
};
const ALPHA: f64 = 0.05;
fn main() {
let dat_x = [24., 28., 32., 29., 35., 36., 30., 32., 25., 31.];
let dat_y = [5., 10., 25., 15., 16., 20.];
let moments_x = SampleMoments::from_slice(&dat_x);
let moments_y = SampleMoments::from_slice(&dat_y);
{
let test_res_lt = welch_test(&moments_x, &moments_y, AltHyp::Lt, ALPHA).unwrap();
assert_eq!(Hyp::Null, test_res_lt.accepted());
println!("test result lt: {test_res_lt:?}");
}
{
let test_res_gt = welch_test(&moments_x, &moments_y, AltHyp::Gt, ALPHA).unwrap();
assert_eq!(Hyp::Alt(AltHyp::Gt), test_res_gt.accepted());
println!("test result gt: {test_res_gt:?}");
}
{
let ci = welch_ci(&moments_x, &moments_y, ALPHA).unwrap();
println!("confidence interval for difference of means: {ci:?}");
}
}