Fixed a bug where contrasts with negative T where incorrectly processed.
[pspp] / src / language / stats / oneway.c
index 807b5dc39f10b6e8bc5f2af2eb8637b97a4796b6..a64b760eb9174ab0ac0c61821c16a2fd4b8589c2 100644 (file)
@@ -1528,10 +1528,15 @@ show_contrast_tests (const struct oneway_spec *cmd, const struct oneway_workspac
                      TAB_RIGHT, df,
                      NULL);
 
-         /* The Significance */
-         tab_double (t, 7, (v * lines_per_variable) + i + 1 + n_contrasts,
-                     TAB_RIGHT,  2 * gsl_cdf_tdist_Q (T,df),
-                     NULL);
+         {
+           double p = gsl_cdf_tdist_P (T, df);
+           double q = gsl_cdf_tdist_Q (T, df);
+
+           /* The Significance */
+           tab_double (t, 7, (v * lines_per_variable) + i + 1 + n_contrasts,
+                       TAB_RIGHT,  2 * ((T > 0) ? q : p),
+                       NULL);
+         }
        }
 
       if ( v > 0 )