-/* PSPP - computes sample statistics.
- Copyright (C) 1997-9, 2000 Free Software Foundation, Inc.
+/* PSPP - a program for statistical analysis.
+ Copyright (C) 1997-9, 2000, 2009 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 the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
+ 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
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301, USA. */
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <language/dictionary/split-file.h>
#include <language/lexer/lexer.h>
#include <language/lexer/variable-parser.h>
#include <language/dictionary/split-file.h>
#include <language/lexer/lexer.h>
#include <language/lexer/variable-parser.h>
#include <libpspp/message.h>
#include <libpspp/assertion.h>
#include <math/moments.h>
#include <output/manager.h>
#include <output/table.h>
#include <libpspp/message.h>
#include <libpspp/assertion.h>
#include <math/moments.h>
#include <output/manager.h>
#include <output/table.h>
double valid, missing; /* Valid, missing counts. */
struct moments *moments; /* Moments. */
double min, max; /* Maximum and mimimum values. */
double valid, missing; /* Valid, missing counts. */
struct moments *moments; /* Moments. */
double min, max; /* Maximum and mimimum values. */
grouper = casegrouper_create_splits (proc_open (ds), dict);
while (casegrouper_get_next_group (grouper, &group))
calc_descriptives (dsc, group, ds);
grouper = casegrouper_create_splits (proc_open (ds), dict);
while (casegrouper_get_next_group (grouper, &group))
calc_descriptives (dsc, group, ds);
generate_z_varname (const struct dictionary *dict, struct dsc_proc *dsc, char *z_name,
const char *var_name, int *z_cnt)
{
generate_z_varname (const struct dictionary *dict, struct dsc_proc *dsc, char *z_name,
const char *var_name, int *z_cnt)
{
tab_hline (t, TAL_2, 0, 1, 1);
tab_text (t, 0, 0, TAB_CENTER | TAT_TITLE, _("Source"));
tab_text (t, 1, 0, TAB_CENTER | TAT_TITLE, _("Target"));
tab_hline (t, TAL_2, 0, 1, 1);
tab_text (t, 0, 0, TAB_CENTER | TAT_TITLE, _("Source"));
tab_text (t, 1, 0, TAB_CENTER | TAT_TITLE, _("Target"));
- double input = case_num (c, z->src_var);
- double *output = &case_data_rw (c, z->z_var)->f;
+ double input = case_num (*c, z->src_var);
+ double *output = &case_data_rw (*c, z->z_var)->f;
if (z->mean == SYSMIS || z->std_dev == SYSMIS || all_sysmis
|| var_is_num_missing (z->src_var, input, t->exclude))
if (z->mean == SYSMIS || z->std_dev == SYSMIS || all_sysmis
|| var_is_num_missing (z->src_var, input, t->exclude))
- if (!casereader_peek (group, 0, &c))
- return;
- output_split_file_values (ds, &c);
- case_destroy (&c);
+ c = casereader_peek (group, 0);
+ if (c == NULL)
+ {
+ casereader_destroy (group);
+ return;
+ }
+ output_split_file_values (ds, c);
+ case_unref (c);
- casereader_split (group, &pass1, &pass2);
- if (dsc->max_moment <= MOMENT_MEAN)
- casereader_destroy (pass2);
+ pass1 = group;
+ pass2 = dsc->max_moment <= MOMENT_MEAN ? NULL : casereader_clone (pass1);
tab_box (t, -1, -1, -1, TAL_1, 1, 0, nc - 1, dsc->var_cnt);
tab_hline (t, TAL_2, 0, nc - 1, 1);
tab_vline (t, TAL_2, 1, 0, dsc->var_cnt);
tab_box (t, -1, -1, -1, TAL_1, 1, 0, nc - 1, dsc->var_cnt);
tab_hline (t, TAL_2, 0, nc - 1, 1);
tab_vline (t, TAL_2, 1, 0, dsc->var_cnt);
nc = 0;
tab_text (t, nc++, 0, TAB_LEFT | TAT_TITLE, _("Variable"));
nc = 0;
tab_text (t, nc++, 0, TAB_LEFT | TAT_TITLE, _("Variable"));
nc = 0;
tab_text (t, nc++, i + 1, TAB_LEFT, var_get_name (dv->v));
nc = 0;
tab_text (t, nc++, i + 1, TAB_LEFT, var_get_name (dv->v));
- tab_text (t, nc++, i + 1, TAT_PRINTF, "%g", dv->valid);
+ tab_text_format (t, nc++, i + 1, 0, "%g", dv->valid);
- tab_text (t, nc++, i + 1, TAT_PRINTF, "%g", dv->missing);
+ tab_text_format (t, nc++, i + 1, 0, "%g", dv->missing);
+
- tab_float (t, nc++, i + 1, TAB_NONE, dv->stats[j], 10, 3);
+ tab_double (t, nc++, i + 1, TAB_NONE, dv->stats[j], NULL);