X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Fstats%2Ft-test.q;h=8f23cefd4afa54c8be6cfebe7031128a913e3616;hb=67d1e36f29bc59dc38ebe7b197a4c40751ad92fa;hp=09a96cfc194930b3cc063c77056622c91455237b;hpb=2cf38ce51a9f34961d68a75e0b312a591b5c9abf;p=pspp-builds.git diff --git a/src/language/stats/t-test.q b/src/language/stats/t-test.q index 09a96cfc..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" @@ -506,7 +508,7 @@ ssbox_one_sample_init (struct ssbox *this, struct t_test_proc *proc) tab_text (this->t, 1, 0, TAB_CENTER | TAT_TITLE, _("N")); tab_text (this->t, 2, 0, TAB_CENTER | TAT_TITLE, _("Mean")); tab_text (this->t, 3, 0, TAB_CENTER | TAT_TITLE, _("Std. Deviation")); - tab_text (this->t, 4, 0, TAB_CENTER | TAT_TITLE, _("SE. Mean")); + tab_text (this->t, 4, 0, TAB_CENTER | TAT_TITLE, _("S.E. Mean")); } /* Initialize the independent samples ssbox */ @@ -526,7 +528,7 @@ ssbox_independent_samples_init (struct ssbox *this, struct t_test_proc *proc) tab_text (this->t, 2, 0, TAB_CENTER | TAT_TITLE, _("N")); tab_text (this->t, 3, 0, TAB_CENTER | TAT_TITLE, _("Mean")); tab_text (this->t, 4, 0, TAB_CENTER | TAT_TITLE, _("Std. Deviation")); - tab_text (this->t, 5, 0, TAB_CENTER | TAT_TITLE, _("SE. Mean")); + tab_text (this->t, 5, 0, TAB_CENTER | TAT_TITLE, _("S.E. Mean")); } /* Populate the ssbox for independent samples */ @@ -625,7 +627,7 @@ ssbox_paired_init (struct ssbox *this, struct t_test_proc *proc) tab_text (this->t, 2, 0, TAB_CENTER | TAT_TITLE, _("Mean")); tab_text (this->t, 3, 0, TAB_CENTER | TAT_TITLE, _("N")); tab_text (this->t, 4, 0, TAB_CENTER | TAT_TITLE, _("Std. Deviation")); - tab_text (this->t, 5, 0, TAB_CENTER | TAT_TITLE, _("SE. Mean")); + tab_text (this->t, 5, 0, TAB_CENTER | TAT_TITLE, _("S.E. Mean")); } /* Populate the ssbox for paired values */ @@ -974,8 +976,8 @@ trbox_paired_populate (struct trbox *trb, /* Degrees of freedom */ tab_double (trb->t, 8, i + 3, TAB_RIGHT, df, &proc->weight_format); - p = gsl_cdf_tdist_P (t, df); - q = gsl_cdf_tdist_P (t, df); + p = gsl_cdf_tdist_P (t,df); + q = gsl_cdf_tdist_Q (t,df); tab_double (trb->t, 9, i + 3, TAB_RIGHT, 2.0 * (t > 0 ? q : p), NULL); } @@ -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);