From a8b84a10b8749b3e2ecbfa0b73deb97e1b682d4e Mon Sep 17 00:00:00 2001 From: John Darrington Date: Sun, 5 Feb 2012 18:41:53 +0100 Subject: [PATCH] NPAR /J-T correct significance calculation when test statistic is greater than zero --- src/language/stats/jonckheere-terpstra.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/language/stats/jonckheere-terpstra.c b/src/language/stats/jonckheere-terpstra.c index 087f655b3d..9bf4cb7413 100644 --- a/src/language/stats/jonckheere-terpstra.c +++ b/src/language/stats/jonckheere-terpstra.c @@ -122,7 +122,7 @@ u (const struct group_data *grp0, const struct group_data *grp1) #if 1 usum += w0 * ( (grp1->cc - prev_cc1) / 2.0); #else - usum += w0 * (grp1->cc - (prev_cc1 + cc) / 2.0); + usum += w0 * (grp1->cc - (prev_cc1 + cc1) / 2.0); #endif case_unref (c1); break; @@ -410,7 +410,7 @@ show_jt (const struct n_sample_test *nst, const struct jt *jt, const struct vari std_jt, 0); tab_double (table, 7, i + row_headers, TAT_TITLE, - 2.0 * gsl_cdf_ugaussian_P (std_jt), 0); + 2.0 * ((std_jt > 0) ? gsl_cdf_ugaussian_Q (std_jt) : gsl_cdf_ugaussian_P (std_jt)), 0); } tab_submit (table); -- 2.30.2