fsml_tst Module

Module for common statistical tests.


Uses

  • module~~fsml_tst~~UsesGraph module~fsml_tst fsml_tst module~fsml_con fsml_con module~fsml_tst->module~fsml_con module~fsml_dst fsml_dst module~fsml_tst->module~fsml_dst module~fsml_err fsml_err module~fsml_tst->module~fsml_err module~fsml_ini fsml_ini module~fsml_tst->module~fsml_ini module~fsml_sts fsml_sts module~fsml_tst->module~fsml_sts module~fsml_utl fsml_utl module~fsml_tst->module~fsml_utl module~fsml_con->module~fsml_ini module~fsml_dst->module~fsml_con module~fsml_dst->module~fsml_err module~fsml_dst->module~fsml_ini module~fsml_err->module~fsml_con module~fsml_err->module~fsml_ini module~fsml_err->module~fsml_utl iso_fortran_env iso_fortran_env module~fsml_ini->iso_fortran_env stdlib_linalg stdlib_linalg module~fsml_ini->stdlib_linalg module~fsml_sts->module~fsml_con module~fsml_sts->module~fsml_err module~fsml_sts->module~fsml_ini module~fsml_utl->module~fsml_ini

Used by

  • module~~fsml_tst~~UsedByGraph module~fsml_tst fsml_tst module~fsml fsml module~fsml->module~fsml_tst

Subroutines

public impure subroutine s_tst_anova_1w(x, f, df_b, df_w, p)

Impure wrapper procedure for s_tst_anova_1w_core.

Arguments

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

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

public impure subroutine s_tst_ranksum(x1, x2, u, p, h1)

Impure wrapper procedure for s_tst_ranksum_core.

Arguments

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

public impure subroutine s_tst_signedrank_1s(x, mu0, w, p, h1)

Impure wrapper procedure for s_tst_signedrank_1s_core.

Arguments

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

public impure subroutine s_tst_signedrank_2s(x1, x2, w, p, h1)

Impure wrapper procedure for s_tst_signedrank_2s_core.

Arguments

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

public impure subroutine s_tst_ttest_1s(x, mu0, t, df, p, h1)

Impure wrapper procedure for s_tst_ttest_1s_core.

Arguments

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

public impure subroutine s_tst_ttest_2s(x1, x2, t, df, p, eq_var, h1)

Impure wrapper procedure for s_tst_ttest_2s_core.

Arguments

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

public impure subroutine s_tst_ttest_paired(x1, x2, t, df, p, h1)

Impure wrapper procedure for s_tst_ttest_paired_core.

Arguments

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

private pure subroutine s_tst_anova_1w_core(x, f, df_b, df_w, p)

One-way ANOVA.

Arguments

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

private pure subroutine s_tst_kruskalwallis_core(x, h, df, p)

Kruskal-Wallis H-test for independent samples. No tie correction.

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

private pure subroutine s_tst_ranksum_core(x1, x2, u, p, h1)

The ranks sum test (Wilcoxon rank-sum test or Mann–Whitney U test).

Arguments

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

private pure subroutine s_tst_signedrank_1s_core(x, mu0, w, p, h1)

The 1-sample Wilcoxon signed rank test.

Arguments

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

private pure subroutine s_tst_signedrank_2s_core(x1, x2, w, p, h1)

The Wilcoxon signed rank test.

Arguments

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

private pure subroutine s_tst_ttest_1s_core(x, mu0, t, df, p, h1)

The 1-sample t-test.

Arguments

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

private pure subroutine s_tst_ttest_2s_core(x1, x2, t, df, p, eq_var, h1)

The 2-sample t-test.

Arguments

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

private pure subroutine s_tst_ttest_paired_core(x1, x2, t, df, p, h1)

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).

Arguments

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