Module for common statistical tests.
Impure wrapper procedure for s_tst_anova_1w_core
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | x(:,:) |
2D array, each column is a group |
||
real(kind=wp), | intent(out) | :: | f |
F-statistic |
||
real(kind=wp), | intent(out) | :: | df_b |
degrees of freedom between groups |
||
real(kind=wp), | intent(out) | :: | df_w |
degrees of freedom within groups |
||
real(kind=wp), | intent(out) | :: | p |
p-value from F distribution |
Impure wrapper procedure for s_tst_kruskalwallis_core
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | x(:,:) |
2D array, each column is a group |
||
real(kind=wp), | intent(out) | :: | h |
Kruskal-Wallis H-statistic |
||
real(kind=wp), | intent(out) | :: | df |
degrees of freedom (k - 1) |
||
real(kind=wp), | intent(out) | :: | p |
p-value from chi-squared distribution |
Impure wrapper procedure for s_tst_ranksum_core
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | x1(:) |
x1 vector (samples) |
||
real(kind=wp), | intent(in) | :: | x2(:) |
x2 vector (samples) |
||
real(kind=wp), | intent(out) | :: | u |
U statistic |
||
real(kind=wp), | intent(out) | :: | p |
p-value |
||
character(len=*), | intent(in), | optional | :: | h1 |
option: "two" (default), "lt", or "gt" |
Impure wrapper procedure for s_tst_signedrank_1s_core
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | x(:) |
x vector (samples) |
||
real(kind=wp), | intent(in) | :: | mu0 |
population mean (null hypothesis expected value) |
||
real(kind=wp), | intent(out) | :: | w |
W statistic (sum of signed ranks) |
||
real(kind=wp), | intent(out) | :: | p |
p-value |
||
character(len=*), | intent(in), | optional | :: | h1 |
: "two" (default), "lt", "gt" |
Impure wrapper procedure for s_tst_signedrank_2s_core
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | x1(:) |
sample 1 (paired data) |
||
real(kind=wp), | intent(in) | :: | x2(:) |
sample 2 (paired data) |
||
real(kind=wp), | intent(out) | :: | w |
W statistic (sum of signed ranks) |
||
real(kind=wp), | intent(out) | :: | p |
p-value |
||
character(len=*), | intent(in), | optional | :: | h1 |
: "two" (default), "lt", "gt" |
Impure wrapper procedure for s_tst_ttest_1s_core
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | x(:) |
x vector (samples) |
||
real(kind=wp), | intent(in) | :: | mu0 |
population mean (null hypothesis expected value) |
||
real(kind=wp), | intent(out) | :: | t |
test statistic |
||
real(kind=wp), | intent(out) | :: | df |
degrees of freedom |
||
real(kind=wp), | intent(out) | :: | p |
p-value |
||
character(len=*), | intent(in), | optional | :: | h1 |
option: two (default), le, ge |
Impure wrapper procedure for s_tst_ttest_2s_core
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | x1(:) |
x1 vector (samples) |
||
real(kind=wp), | intent(in) | :: | x2(:) |
x2 vector (samples) |
||
real(kind=wp), | intent(out) | :: | t |
test statistic |
||
real(kind=wp), | intent(out) | :: | df |
degrees of freedom |
||
real(kind=wp), | intent(out) | :: | p |
p-value |
||
logical, | intent(in), | optional | :: | eq_var |
true if equal variances assumed |
|
character(len=*), | intent(in), | optional | :: | h1 |
option: two (default), le, ge |
Impure wrapper procedure for s_tst_ttest_paired_core
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | x1(:) |
x1 vector (samples) |
||
real(kind=wp), | intent(in) | :: | x2(:) |
x2 vector (samples); must be same length as x1 |
||
real(kind=wp), | intent(out) | :: | t |
test statistic |
||
real(kind=wp), | intent(out) | :: | df |
degrees of freedom |
||
real(kind=wp), | intent(out) | :: | p |
p-value |
||
character(len=*), | intent(in), | optional | :: | h1 |
option: two (default), le, ge |
One-way ANOVA.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | x(:,:) |
2D array, each column is a group |
||
real(kind=wp), | intent(out) | :: | f |
F-statistic |
||
real(kind=wp), | intent(out) | :: | df_b |
degrees of freedom between groups |
||
real(kind=wp), | intent(out) | :: | df_w |
degrees of freedom within groups |
||
real(kind=wp), | intent(out) | :: | p |
p-value from F distribution |
Kruskal-Wallis H-test for independent samples. No tie correction.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | x(:,:) |
2D array, each column is a group |
||
real(kind=wp), | intent(out) | :: | h |
Kruskal-Wallis H-statistic |
||
real(kind=wp), | intent(out) | :: | df |
degrees of freedom (k - 1) |
||
real(kind=wp), | intent(out) | :: | p |
p-value from chi-squared distribution |
The ranks sum test (Wilcoxon rank-sum test or Mann–Whitney U test).
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | x1(:) |
x1 vector (samples) |
||
real(kind=wp), | intent(in) | :: | x2(:) |
x2 vector (samples) |
||
real(kind=wp), | intent(out) | :: | u |
U statistic |
||
real(kind=wp), | intent(out) | :: | p |
p-value |
||
character(len=*), | intent(in) | :: | h1 |
option: "two" (default), "lt", or "gt" |
The 1-sample Wilcoxon signed rank test.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | x(:) |
x vector (samples) |
||
real(kind=wp), | intent(in) | :: | mu0 |
population mean (null hypothesis expected value) |
||
real(kind=wp), | intent(out) | :: | w |
W statistic (sum of signed ranks) |
||
real(kind=wp), | intent(out) | :: | p |
p-value |
||
character(len=*), | intent(in) | :: | h1 |
: "two" (default), "lt", "gt" |
The Wilcoxon signed rank test.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | x1(:) |
sample 1 (paired data) |
||
real(kind=wp), | intent(in) | :: | x2(:) |
sample 2 (paired data) |
||
real(kind=wp), | intent(out) | :: | w |
W statistic (sum of signed ranks) |
||
real(kind=wp), | intent(out) | :: | p |
p-value |
||
character(len=*), | intent(in) | :: | h1 |
: "two" (default), "lt", "gt" |
The 1-sample t-test.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | x(:) |
x vector (samples) |
||
real(kind=wp), | intent(in) | :: | mu0 |
population mean (null hypothesis expected value) |
||
real(kind=wp), | intent(out) | :: | t |
test statistic |
||
real(kind=wp), | intent(out) | :: | df |
degrees of freedom |
||
real(kind=wp), | intent(out) | :: | p |
p-value |
||
character(len=*), | intent(in) | :: | h1 |
option: two (default), le, ge |
The 2-sample t-test.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | x1(:) |
x1 vector (samples) |
||
real(kind=wp), | intent(in) | :: | x2(:) |
x2 vector (samples) |
||
real(kind=wp), | intent(out) | :: | t |
test statistic |
||
real(kind=wp), | intent(out) | :: | df |
degrees of freedom |
||
real(kind=wp), | intent(out) | :: | p |
p-value |
||
logical, | intent(in) | :: | eq_var |
true if equal variances assumed |
||
character(len=*), | intent(in) | :: | h1 |
option: two (default), le, ge |
The paired sample t-test (or dependent sample t-test).
It is a special case of s_tst_ttest_1s
offered and uses
the same pure procedure (s_tst_ttest_1s_core
).
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | x1(:) |
x1 vector (samples) |
||
real(kind=wp), | intent(in) | :: | x2(:) |
x2 vector (samples); must be same length as x1 |
||
real(kind=wp), | intent(out) | :: | t |
test statistic |
||
real(kind=wp), | intent(out) | :: | df |
degrees of freedom |
||
real(kind=wp), | intent(out) | :: | p |
p-value |
||
character(len=*), | intent(in) | :: | h1 |
option: two (default), le, ge |