X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Fstats%2Ft-test.q;h=8f23cefd4afa54c8be6cfebe7031128a913e3616;hb=refs%2Ftags%2Flenny-x64-build53;hp=d25477cdd153f27a55b8170f89bdf75e6020b75a;hpb=734bcddfcfbb6f802aa0975a8423b3be5b874ca6;p=pspp-builds.git diff --git a/src/language/stats/t-test.q b/src/language/stats/t-test.q index d25477cd..8f23cefd 100644 --- a/src/language/stats/t-test.q +++ b/src/language/stats/t-test.q @@ -43,10 +43,12 @@ #include #include #include +#include #include #include #include +#include "minmax.h" #include "xalloc.h" #include "xmemdup0.h" @@ -1109,10 +1111,6 @@ pscbox (struct t_test_proc *proc) for (i = 0; i < proc->n_pairs; i++) { struct pair *pair = &proc->pairs[i]; - double p, q; - double df = pair->n -2; - double correlation_t = (pair->correlation * sqrt (df) / - sqrt (1 - pow2 (pair->correlation))); /* row headings */ tab_text_format (table, 0, i + 1, TAB_LEFT | TAT_TITLE, @@ -1126,10 +1124,8 @@ pscbox (struct t_test_proc *proc) tab_double (table, 2, i + 1, TAB_RIGHT, pair->n, &proc->weight_format); tab_double (table, 3, i + 1, TAB_RIGHT, pair->correlation, NULL); - p = gsl_cdf_tdist_P (correlation_t, df); - q = gsl_cdf_tdist_Q (correlation_t, df); - tab_double (table, 4, i + 1, TAB_RIGHT, - 2.0 * (correlation_t > 0 ? q : p), NULL); + tab_double (table, 4, i + 1, TAB_RIGHT, + 2.0 * significance_of_correlation (pair->correlation, pair->n), NULL); } tab_submit (table);