X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Fstats%2Fmcnemar.c;h=56fe088de6757c7812c48f9cc30aec4caf8541bf;hb=63ae14f7f555727026138e1668e6cf91a9046bc0;hp=e26a3c1d0954f9632fb58c913fc2bf00107d74e9;hpb=90a008db8b2f6e5bec903e584eb68e9bb20c061e;p=pspp diff --git a/src/language/stats/mcnemar.c b/src/language/stats/mcnemar.c index e26a3c1d09..56fe088de6 100644 --- a/src/language/stats/mcnemar.c +++ b/src/language/stats/mcnemar.c @@ -174,6 +174,8 @@ output_freq_table (variable_pair *vp, struct string val1str ; struct string val0str ; + tab_set_format (table, RC_WEIGHT, wfmt); + ds_init_empty (&val0str); ds_init_empty (&val1str); @@ -184,7 +186,7 @@ output_freq_table (variable_pair *vp, ds_put_cstr (&pair_name, " & "); ds_put_cstr (&pair_name, var_to_string ((*vp)[1])); - tab_title (table, ds_cstr (&pair_name)); + tab_title (table, "%s", ds_cstr (&pair_name)); ds_destroy (&pair_name); @@ -213,10 +215,10 @@ output_freq_table (variable_pair *vp, tab_text (table, header_cols + 0, 1, TAB_LEFT, ds_cstr (&val0str)); tab_text (table, header_cols + 1, 1, TAB_LEFT, ds_cstr (&val1str)); - tab_double (table, header_cols + 0, header_rows + 0, TAB_RIGHT, param->n00, wfmt); - tab_double (table, header_cols + 0, header_rows + 1, TAB_RIGHT, param->n01, wfmt); - tab_double (table, header_cols + 1, header_rows + 0, TAB_RIGHT, param->n10, wfmt); - tab_double (table, header_cols + 1, header_rows + 1, TAB_RIGHT, param->n11, wfmt); + tab_double (table, header_cols + 0, header_rows + 0, TAB_RIGHT, param->n00, NULL, RC_WEIGHT); + tab_double (table, header_cols + 0, header_rows + 1, TAB_RIGHT, param->n01, NULL, RC_WEIGHT); + tab_double (table, header_cols + 1, header_rows + 0, TAB_RIGHT, param->n10, NULL, RC_WEIGHT); + tab_double (table, header_cols + 1, header_rows + 1, TAB_RIGHT, param->n11, NULL, RC_WEIGHT); tab_submit (table); @@ -238,6 +240,7 @@ output_statistics_table (const struct two_sample_test *t2s, const struct fmt_spec *wfmt = wv ? var_get_print_format (wv) : & F_8_0; tab_title (table, _("Test Statistics")); + tab_set_format (table, RC_WEIGHT, wfmt); tab_headers (table, 0, 1, 0, 1); @@ -280,15 +283,15 @@ output_statistics_table (const struct two_sample_test *t2s, tab_text (table, 0, 1 + i, TAB_LEFT, ds_cstr (&pair_name)); ds_destroy (&pair_name); - tab_double (table, 1, 1 + i, TAB_RIGHT, mc[i].n00 + mc[i].n01 + mc[i].n10 + mc[i].n11, wfmt); + tab_double (table, 1, 1 + i, TAB_RIGHT, mc[i].n00 + mc[i].n01 + mc[i].n10 + mc[i].n11, NULL, RC_WEIGHT); sig = gsl_cdf_binomial_P (mc[i].n01, 0.5, mc[i].n01 + mc[i].n10); - tab_double (table, 2, 1 + i, TAB_RIGHT, 2 * sig, NULL); - tab_double (table, 3, 1 + i, TAB_RIGHT, sig, NULL); + tab_double (table, 2, 1 + i, TAB_RIGHT, 2 * sig, NULL, RC_PVALUE); + tab_double (table, 3, 1 + i, TAB_RIGHT, sig, NULL, RC_PVALUE); tab_double (table, 4, 1 + i, TAB_RIGHT, gsl_ran_binomial_pdf (mc[i].n01, 0.5, mc[i].n01 + mc[i].n10), - NULL); + NULL, RC_OTHER); } tab_submit (table);