X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Fstats%2Fsign.c;h=5149489d1185fd6633fe7eb2b27c1255f40ef872;hb=30cea3a93e0c674cfd581b9ae9e4f3cb5847e639;hp=3848911313ed62721eff29b20d6fd9bdf14ca6e9;hpb=9895af61788837886be8b30fdb2baf46f9f0724a;p=pspp diff --git a/src/language/stats/sign.c b/src/language/stats/sign.c index 3848911313..5149489d11 100644 --- a/src/language/stats/sign.c +++ b/src/language/stats/sign.c @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 2009 Free Software Foundation, Inc. + Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -15,22 +15,24 @@ along with this program. If not, see . */ #include -#include "sign.h" -#include -#include -#include +#include "language/stats/sign.h" + #include #include -#include "npar.h" -#include -#include -#include -#include -#include -#include "minmax.h" -#include "xalloc.h" +#include "data/casereader.h" +#include "data/dataset.h" +#include "data/dictionary.h" +#include "data/format.h" +#include "data/missing-values.h" +#include "data/variable.h" +#include "language/stats/npar.h" +#include "libpspp/str.h" +#include "output/tab.h" + +#include "gl/minmax.h" +#include "gl/xalloc.h" #include "gettext.h" #define _(msgid) gettext (msgid) @@ -57,6 +59,7 @@ output_frequency_table (const struct two_sample_test *t2s, const struct variable *wv = dict_get_weight (dict); const struct fmt_spec *wfmt = wv ? var_get_print_format (wv) : & F_8_0; + tab_set_format (table, RC_WEIGHT, wfmt); tab_title (table, _("Frequencies")); tab_headers (table, 2, 0, 1, 0); @@ -92,11 +95,11 @@ output_frequency_table (const struct two_sample_test *t2s, tab_text (table, 1, 3 + i * 4, TAB_LEFT, _("Ties")); tab_text (table, 1, 4 + i * 4, TAB_LEFT, _("Total")); - tab_double (table, 2, 1 + i * 4, TAB_RIGHT, param[i].neg, wfmt); - tab_double (table, 2, 2 + i * 4, TAB_RIGHT, param[i].pos, wfmt); - tab_double (table, 2, 3 + i * 4, TAB_RIGHT, param[i].ties, wfmt); + tab_double (table, 2, 1 + i * 4, TAB_RIGHT, param[i].neg, NULL, RC_WEIGHT); + tab_double (table, 2, 2 + i * 4, TAB_RIGHT, param[i].pos, NULL, RC_WEIGHT); + tab_double (table, 2, 3 + i * 4, TAB_RIGHT, param[i].ties, NULL, RC_WEIGHT); tab_double (table, 2, 4 + i * 4, TAB_RIGHT, - param[i].ties + param[i].neg + param[i].pos, wfmt); + param[i].ties + param[i].neg + param[i].pos, NULL, RC_WEIGHT); } tab_submit (table); @@ -149,10 +152,10 @@ output_statistics_table (const struct two_sample_test *t2s, ds_destroy (&pair_name); tab_double (table, 1 + i, 1, TAB_RIGHT, - param[i].one_tailed_sig * 2, NULL); + param[i].one_tailed_sig * 2, NULL, RC_PVALUE); - tab_double (table, 1 + i, 2, TAB_RIGHT, param[i].one_tailed_sig, NULL); - tab_double (table, 1 + i, 3, TAB_RIGHT, param[i].point_prob, NULL); + tab_double (table, 1 + i, 2, TAB_RIGHT, param[i].one_tailed_sig, NULL, RC_PVALUE); + tab_double (table, 1 + i, 3, TAB_RIGHT, param[i].point_prob, NULL, RC_PVALUE); } tab_submit (table); @@ -172,7 +175,7 @@ sign_execute (const struct dataset *ds, const struct two_sample_test *t2s = UP_CAST (test, const struct two_sample_test, parent); struct ccase *c; - struct sign_test_params *stp = xcalloc (sizeof *stp, t2s->n_pairs); + struct sign_test_params *stp = xcalloc (t2s->n_pairs, sizeof *stp); struct casereader *r = input;