2 #include <openGPMP/stats/hypothesis.cpp>
6 std::vector<double> sample1 = {25, 30, 28, 32, 35};
7 std::vector<double> sample2 = {20, 22, 18, 24, 21};
8 std::vector<std::vector<double>> samples = {{10, 12, 14},
11 std::vector<std::vector<int>> observed = {{10, 20, 30},
14 std::vector<std::vector<double>> expected = {{15, 25, 35},
18 std::cout <<
"One-sample t-test: "
21 std::cout <<
"Two-sample t-test: "
26 std::cout <<
"Chi-square test: "
30 std::cout <<
"Z-test for proportions: "
36 std::cout <<
"Wilcoxon signed-rank test: "
40 std::cout <<
"Mann-Whitney U test: "
static double mann_whitney_test(const std::vector< double > &sample1, const std::vector< double > &sample2)
Mann-Whitney U test.
static double two_sample_ttest(const std::vector< double > &sample1, const std::vector< double > &sample2)
Two-sample t-test.
static double chi_square_test(const std::vector< std::vector< int >> &observed, const std::vector< std::vector< double >> &expected)
Chi-square test of independence.
static double ANOVA(const std::vector< std::vector< double >> &samples)
Analysis of Variance (ANOVA)
static double one_sample_ttest(const std::vector< double > &sample, double populationMean)
One-sample t-test.
static double proportion_z_test(double p1, double p2, double n1, double n2)
Z-test for proportions.
static double wilcoxon_rank_test(const std::vector< double > &sample1, const std::vector< double > &sample2)
Wilcoxon signed-rank test.