X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Fstats%2Fnpar-summary.c;h=4ed897ee3a6e172fbb80ab9fe0c5a90ec738af6c;hb=38993354cabb6fc37bb882be92f9a49e9aeb4c88;hp=3ad3a5bb1554194cca7160be6b9b87fd4200e7dd;hpb=537fdeb3702c011e05d7826a8d556a7beeba2605;p=pspp diff --git a/src/language/stats/npar-summary.c b/src/language/stats/npar-summary.c index 3ad3a5bb15..4ed897ee3a 100644 --- a/src/language/stats/npar-summary.c +++ b/src/language/stats/npar-summary.c @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 2006, 2009 Free Software Foundation, Inc. + Copyright (C) 2006, 2009, 2010 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 @@ -17,9 +17,8 @@ #include #include -#include +#include #include -#include #include #include "npar-summary.h" #include @@ -86,11 +85,6 @@ npar_summary_calc_descriptives (struct descriptives *desc, } -void -do_summary_box (const struct descriptives *desc, - const struct variable *const *vv, - int n_vars); - void do_summary_box (const struct descriptives *desc, @@ -107,16 +101,15 @@ do_summary_box (const struct descriptives *desc, if ( desc ) columns += 5; if ( quartiles ) columns += 3; - table = tab_create (columns, 2 + n_vars, 0); + table = tab_create (columns, 2 + n_vars); - tab_dim (table, tab_natural_dimensions); tab_title (table, _("Descriptive Statistics")); tab_headers (table, 1, 0, 1, 0); tab_box (table, TAL_1, TAL_1, -1, TAL_1, - 0, 0, table->nc - 1, tab_nr(table) - 1 ); + 0, 0, tab_nc (table) - 1, tab_nr(table) - 1 ); tab_hline (table, TAL_2, 0, tab_nc (table) -1, 2); tab_vline (table, TAL_2, 1, 0, tab_nr (table) - 1); @@ -164,13 +157,17 @@ do_summary_box (const struct descriptives *desc, const struct variable *var = vv[v]; const struct fmt_spec *fmt = var_get_print_format (var); - tab_text (table, 0, 2 + v, TAT_NONE, var_to_string (var)); - - tab_double (table, 1, 2 + v, TAT_NONE, desc[v].n, fmt); - tab_double (table, 2, 2 + v, TAT_NONE, desc[v].mean, fmt); - tab_double (table, 3, 2 + v, TAT_NONE, desc[v].std_dev, fmt); - tab_double (table, 4, 2 + v, TAT_NONE, desc[v].min, fmt); - tab_double (table, 5, 2 + v, TAT_NONE, desc[v].max, fmt); + tab_text (table, 0, 2 + v, 0, var_to_string (var)); + + col = 1; + if (desc != NULL) + { + tab_double (table, col++, 2 + v, 0, desc[v].n, fmt); + tab_double (table, col++, 2 + v, 0, desc[v].mean, fmt); + tab_double (table, col++, 2 + v, 0, desc[v].std_dev, fmt); + tab_double (table, col++, 2 + v, 0, desc[v].min, fmt); + tab_double (table, col++, 2 + v, 0, desc[v].max, fmt); + } }