s_tst_kruskalwallis Subroutine

public impure subroutine s_tst_kruskalwallis(x, h, df, p)

Impure wrapper procedure for s_tst_kruskalwallis_core.

Arguments

Type IntentOptional 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


Calls

proc~~s_tst_kruskalwallis~~CallsGraph proc~s_tst_kruskalwallis s_tst_kruskalwallis proc~s_err_print s_err_print proc~s_tst_kruskalwallis->proc~s_err_print proc~s_tst_kruskalwallis_core s_tst_kruskalwallis_core proc~s_tst_kruskalwallis->proc~s_tst_kruskalwallis_core proc~f_utl_r2c f_utl_r2c proc~s_err_print->proc~f_utl_r2c proc~f_dst_chi2_cdf_core f_dst_chi2_cdf_core proc~s_tst_kruskalwallis_core->proc~f_dst_chi2_cdf_core proc~s_utl_rank s_utl_rank proc~s_tst_kruskalwallis_core->proc~s_utl_rank proc~f_dst_gammai_core f_dst_gammai_core proc~f_dst_chi2_cdf_core->proc~f_dst_gammai_core

Called by

proc~~s_tst_kruskalwallis~~CalledByGraph proc~s_tst_kruskalwallis s_tst_kruskalwallis interface~fsml_kruskalwallis fsml_kruskalwallis interface~fsml_kruskalwallis->proc~s_tst_kruskalwallis

Source Code

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