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 |
pure subroutine s_tst_ttest_paired_core(x1, x2, t, df, p, h1) ! ==== Description !! 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`). ! ==== Declarations real(wp) , intent(in) :: x1(:) !! x1 vector (samples) real(wp) , intent(in) :: x2(:) !! x2 vector (samples); must be same length as x1 character(len=*) , intent(in) :: h1 !! \( H_{1} \) option: two (default), le, ge real(wp) , intent(out) :: t !! test statistic real(wp) , intent(out) :: df !! degrees of freedom real(wp) , intent(out) :: p !! p-value ! ==== Instructions ! use procedure for 1-sample t-test on difference vector and set mu0 to 0 call s_tst_ttest_1s_core( (x1 - x2), 0.0_wp, t, df, p, h1) end subroutine s_tst_ttest_paired_core