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 subroutine s_tst_kruskalwallis(x, h, df, p) ! ==== Description !! Impure wrapper procedure for `s_tst_kruskalwallis_core`. ! ==== Declarations real(wp) , intent(in) :: x(:,:) !! 2D array, each column is a group real(wp) , intent(out) :: h !! Kruskal-Wallis H-statistic real(wp) , intent(out) :: df !! degrees of freedom (k - 1) real(wp) , intent(out) :: p !! p-value from chi-squared distribution ! ==== Instructions ! ---- handle input ! check that no. of elements and groups (must both be 2 or higher) if (size(x, 1) .le. 1 .or. size(x, 2) .le. 1) then ! write error message and assign sentinel value if invalid call s_err_print(fsml_error(4)) h = c_sentinel_r p = c_sentinel_r df = c_sentinel_r return endif ! ---- conduct test ! call pure procedure call s_tst_kruskalwallis_core(x, h, df, p) end subroutine s_tst_kruskalwallis