assert (is_fmt_type (type));
return &formats[type];
}
+
+const struct fmt_spec F_8_0 = {FMT_F, 8, 0};
void fmt_set_decimal (struct fmt_number_style *, char);
+extern const struct fmt_spec F_8_0 ;
+
#endif /* data/format.h */
#include <libpspp/compiler.h>
#include <output/table.h>
+#include <data/format.h>
#include <data/case.h>
#include <data/casereader.h>
#include <data/dictionary.h>
const struct npar_test *test)
{
int v;
+ const struct dictionary *dict = dataset_dict (ds);
const struct binomial_test *bst = (const struct binomial_test *) test;
const struct one_sample_test *ost = (const struct one_sample_test*) test;
cat2->value = value_dup (&v, 0);
}
- if (do_binomial (dataset_dict(ds), input, bst, cat1, cat2, exclude))
+ if (do_binomial (dict, input, bst, cat1, cat2, exclude))
{
+ const struct variable *wvar = dict_get_weight (dict);
+ const struct fmt_spec *wfmt = wvar ?
+ var_get_print_format (wvar) : & F_8_0;
+
struct tab_table *table = tab_create (7, ost->n_vars * 3 + 1, 0);
tab_dim (table, tab_natural_dimensions);
tab_text (table, 1, 3 + v * 3, TAB_LEFT, _("Total"));
/* Test Prop */
- tab_float (table, 5, 1 + v * 3, TAB_NONE, bst->p, 8, 3);
+ tab_double (table, 5, 1 + v * 3, TAB_NONE, bst->p, NULL);
/* Category labels */
tab_text (table, 2, 1 + v * 3, TAB_NONE, ds_cstr (&catstr1));
tab_text (table, 2, 2 + v * 3, TAB_NONE, ds_cstr (&catstr2));
/* Observed N */
- tab_float (table, 3, 1 + v * 3, TAB_NONE, cat1[v].count, 8, 0);
- tab_float (table, 3, 2 + v * 3, TAB_NONE, cat2[v].count, 8, 0);
+ tab_double (table, 3, 1 + v * 3, TAB_NONE, cat1[v].count, wfmt);
+ tab_double (table, 3, 2 + v * 3, TAB_NONE, cat2[v].count, wfmt);
n_total = cat1[v].count + cat2[v].count;
- tab_float (table, 3, 3 + v * 3, TAB_NONE, n_total, 8, 0);
+ tab_double (table, 3, 3 + v * 3, TAB_NONE, n_total, wfmt);
/* Observed Proportions */
- tab_float (table, 4, 1 + v * 3, TAB_NONE,
- cat1[v].count / n_total, 8, 3);
- tab_float (table, 4, 2 + v * 3, TAB_NONE,
- cat2[v].count / n_total, 8, 3);
- tab_float (table, 4, 3 + v * 3, TAB_NONE,
- (cat1[v].count + cat2[v].count) / n_total, 8, 2);
+ tab_double (table, 4, 1 + v * 3, TAB_NONE,
+ cat1[v].count / n_total, NULL);
+ tab_double (table, 4, 2 + v * 3, TAB_NONE,
+ cat2[v].count / n_total, NULL);
+
+ tab_double (table, 4, 3 + v * 3, TAB_NONE,
+ (cat1[v].count + cat2[v].count) / n_total, wfmt);
/* Significance */
sig = calculate_binomial (cat1[v].count, cat2[v].count, bst->p);
- tab_float (table, 6, 1 + v * 3, TAB_NONE, sig, 8, 3);
+ tab_double (table, 6, 1 + v * 3, TAB_NONE, sig, NULL);
ds_destroy (&catstr1);
ds_destroy (&catstr2);
#include <stdlib.h>
#include <math.h>
+#include <data/format.h>
#include <data/case.h>
#include <data/casereader.h>
#include <data/dictionary.h>
}
for ( i = test->lo ; i <= test->hi ; ++i )
- tab_float (table, 0, 2 + i - test->lo,
- TAB_LEFT, 1 + i - test->lo, 8, 0);
+ tab_fixed (table, 0, 2 + i - test->lo,
+ TAB_LEFT, 1 + i - test->lo, 8, 0);
tab_headers (table, 1, 0, 2, 0);
struct chisquare_test *cst = (struct chisquare_test *) test;
int n_cells = 0;
double total_expected = 0.0;
+ const struct variable *wvar = dict_get_weight (dict);
+ const struct fmt_spec *wfmt = wvar ?
+ var_get_print_format (wvar) : & F_8_0;
double *df = xzalloc (sizeof (*df) * ost->n_vars);
double *xsq = xzalloc (sizeof (*df) * ost->n_vars);
/* The observed N */
- tab_float (freq_table, 1, i + 1, TAB_NONE,
- ff[i]->count, 8, 0);
+ tab_double (freq_table, 1, i + 1, TAB_NONE,
+ ff[i]->count, wfmt);
if ( cst->n_expected > 0 )
exp = cst->expected[i] * total_obs / total_expected ;
else
exp = total_obs / (double) n_cells;
- tab_float (freq_table, 2, i + 1, TAB_NONE,
- exp, 8, 2);
+ tab_double (freq_table, 2, i + 1, TAB_NONE,
+ exp, NULL);
/* The residual */
- tab_float (freq_table, 3, i + 1, TAB_NONE,
- ff[i]->count - exp, 8, 2);
+ tab_double (freq_table, 3, i + 1, TAB_NONE,
+ ff[i]->count - exp, NULL);
xsq[v] += (ff[i]->count - exp) * (ff[i]->count - exp) / exp;
}
df[v] = n_cells - 1.0;
- tab_float (freq_table, 1, i + 1, TAB_NONE,
- total_obs, 8, 0);
+ tab_double (freq_table, 1, i + 1, TAB_NONE,
+ total_obs, wfmt);
tab_submit (freq_table);
ds_destroy (&str);
/* The observed N */
- tab_float (freq_table, v * 4 + 2, i + 2 , TAB_NONE,
- ff[i]->count, 8, 0);
+ tab_double (freq_table, v * 4 + 2, i + 2 , TAB_NONE,
+ ff[i]->count, wfmt);
if ( cst->n_expected > 0 )
exp = cst->expected[i] * total_obs / total_expected ;
exp = total_obs / (double) hsh_count (freq_hash);
/* The expected N */
- tab_float (freq_table, v * 4 + 3, i + 2 , TAB_NONE,
- exp, 8, 2);
+ tab_double (freq_table, v * 4 + 3, i + 2 , TAB_NONE,
+ exp, NULL);
/* The residual */
- tab_float (freq_table, v * 4 + 4, i + 2 , TAB_NONE,
- ff[i]->count - exp, 8, 2);
+ tab_double (freq_table, v * 4 + 4, i + 2 , TAB_NONE,
+ ff[i]->count - exp, NULL);
xsq[v] += (ff[i]->count - exp) * (ff[i]->count - exp) / exp;
}
- tab_float (freq_table, v * 4 + 2, tab_nr (freq_table) - 1, TAB_NONE,
- total_obs, 8, 0);
+ tab_double (freq_table, v * 4 + 2, tab_nr (freq_table) - 1, TAB_NONE,
+ total_obs, wfmt);
df[v] = n_cells - 1.0;
tab_text (stats_table, 1 + v, 0, TAB_CENTER, var_get_name (var));
- tab_float (stats_table, 1 + v, 1, TAB_NONE, xsq[v], 8,3);
- tab_float (stats_table, 1 + v, 2, TAB_NONE, df[v], 8,0);
+ tab_double (stats_table, 1 + v, 1, TAB_NONE, xsq[v], NULL);
+ tab_fixed (stats_table, 1 + v, 2, TAB_NONE, df[v], 8, 0);
- tab_float (stats_table, 1 + v, 3, TAB_NONE,
- gsl_cdf_chisq_Q (xsq[v], df[v]), 8,3);
+ tab_double (stats_table, 1 + v, 3, TAB_NONE,
+ gsl_cdf_chisq_Q (xsq[v], df[v]), NULL);
}
tab_submit (stats_table);
}
static void precalc (struct casereader *, const struct dataset *);
static void calc_general (struct ccase *, const struct dataset *);
static void calc_integer (struct ccase *, const struct dataset *);
-static void postcalc (void);
+static void postcalc (const struct dataset *);
static void submit (struct tab_table *);
static void format_short (char *s, const struct fmt_spec *fp,
}
casereader_destroy (group);
- postcalc ();
+ postcalc (ds);
}
ok = casegrouper_destroy (grouper);
ok = proc_commit (ds) && ok;
int var_idx,
union value **values, int *value_cnt);
static void output_pivot_table (struct table_entry **, struct table_entry **,
+ const struct dictionary *,
double **, double **, double **,
int *, int *, int *);
-static void make_summary_table (void);
+static void make_summary_table (const struct dictionary *);
static void
-postcalc (void)
+postcalc (const struct dataset *ds)
{
if (mode == GENERAL)
{
sorted_tab = (struct table_entry **) hsh_sort (gen_tab);
}
- make_summary_table ();
+ make_summary_table (dataset_dict (ds));
/* Identify all the individual crosstabulation tables, and deal with
them. */
if (pe == NULL)
break;
- output_pivot_table (pb, pe, &mat, &row_tot, &col_tot,
+ output_pivot_table (pb, pe, dataset_dict (ds),
+ &mat, &row_tot, &col_tot,
&maxrows, &maxcols, &maxcells);
pb = pe;
}
}
-static void insert_summary (struct tab_table *, int tab_index, double valid);
+static void insert_summary (struct tab_table *, int tab_index,
+ const struct dictionary *,
+ double valid);
/* Output a table summarizing the cases processed. */
static void
-make_summary_table (void)
+make_summary_table (const struct dictionary *dict)
{
struct tab_table *summary;
break;
while (cur_tab < (*pb)->table)
- insert_summary (summary, cur_tab++, 0.);
+ insert_summary (summary, cur_tab++, dict, 0.);
if (mode == GENERAL)
for (valid = 0.; pb < pe; pb++)
valid += *data++;
}
}
- insert_summary (summary, cur_tab++, valid);
+ insert_summary (summary, cur_tab++, dict, valid);
pb = pe;
}
while (cur_tab < nxtab)
- insert_summary (summary, cur_tab++, 0.);
+ insert_summary (summary, cur_tab++, dict, 0.);
submit (summary);
}
/* Inserts a line into T describing the crosstabulation at index
TAB_INDEX, which has VALID valid observations. */
static void
-insert_summary (struct tab_table *t, int tab_index, double valid)
+insert_summary (struct tab_table *t, int tab_index,
+ const struct dictionary *dict,
+ double valid)
{
struct crosstab *x = xtab[tab_index];
+ const struct variable *wv = dict_get_weight (dict);
+ const struct fmt_spec *wfmt = wv ? var_get_print_format (wv) : & F_8_0;
+
tab_hline (t, TAL_1, 0, 6, 0);
/* Crosstabulation name. */
for (i = 0; i < 3; i++)
{
- tab_float (t, i * 2 + 1, 0, TAB_RIGHT, n[i], 8, 0);
+ tab_double (t, i * 2 + 1, 0, TAB_RIGHT, n[i], wfmt);
tab_text (t, i * 2 + 2, 0, TAB_RIGHT | TAT_PRINTF, "%.1f%%",
n[i] / n[2] * 100.);
}
static void display_dimensions (struct tab_table *, int first_difference,
struct table_entry *);
static void display_crosstabulation (void);
-static void display_chisq (void);
-static void display_symmetric (void);
-static void display_risk (void);
+static void display_chisq (const struct dictionary *);
+static void display_symmetric (const struct dictionary *);
+static void display_risk (const struct dictionary *);
static void display_directional (void);
static void crosstabs_dim (struct tab_table *, struct outp_driver *);
static void table_value_missing (struct tab_table *table, int c, int r,
hold *MAXROWS entries. */
static void
output_pivot_table (struct table_entry **pb, struct table_entry **pe,
+ const struct dictionary *dict,
double **matp, double **row_totp, double **col_totp,
int *maxrows, int *maxcols, int *maxcells)
{
if (cmd.miss == CRS_REPORT)
delete_missing ();
if (chisq)
- display_chisq ();
+ display_chisq (dict);
if (sym)
- display_symmetric ();
+ display_symmetric (dict);
if (risk)
- display_risk ();
+ display_risk (dict);
if (direct)
display_directional ();
/* Display chi-square statistics. */
static void
-display_chisq (void)
+display_chisq (const struct dictionary *dict)
{
+ const struct variable *wv = dict_get_weight (dict);
+ const struct fmt_spec *wfmt = wv ? var_get_print_format (wv) : & F_8_0;
+
static const char *chisq_stats[N_CHISQ] =
{
N_("Pearson Chi-Square"),
tab_text (chisq, 0, 0, TAB_LEFT, gettext (chisq_stats[i]));
if (i != 2)
{
- tab_float (chisq, 1, 0, TAB_RIGHT, chisq_v[i], 8, 3);
- tab_float (chisq, 2, 0, TAB_RIGHT, df[i], 8, 0);
- tab_float (chisq, 3, 0, TAB_RIGHT,
- gsl_cdf_chisq_Q (chisq_v[i], df[i]), 8, 3);
+ tab_double (chisq, 1, 0, TAB_RIGHT, chisq_v[i], NULL);
+ tab_double (chisq, 2, 0, TAB_RIGHT, df[i], wfmt);
+ tab_double (chisq, 3, 0, TAB_RIGHT,
+ gsl_cdf_chisq_Q (chisq_v[i], df[i]), NULL);
}
else
{
chisq_fisher = 1;
- tab_float (chisq, 4, 0, TAB_RIGHT, fisher2, 8, 3);
- tab_float (chisq, 5, 0, TAB_RIGHT, fisher1, 8, 3);
+ tab_double (chisq, 4, 0, TAB_RIGHT, fisher2, NULL);
+ tab_double (chisq, 5, 0, TAB_RIGHT, fisher1, NULL);
}
tab_next_row (chisq);
}
tab_text (chisq, 0, 0, TAB_LEFT, _("N of Valid Cases"));
- tab_float (chisq, 1, 0, TAB_RIGHT, W, 8, 0);
+ tab_double (chisq, 1, 0, TAB_RIGHT, W, wfmt);
tab_next_row (chisq);
tab_offset (chisq, 0, -1);
/* Display symmetric measures. */
static void
-display_symmetric (void)
+display_symmetric (const struct dictionary *dict)
{
+ const struct variable *wv = dict_get_weight (dict);
+ const struct fmt_spec *wfmt = wv ? var_get_print_format (wv) : & F_8_0;
+
static const char *categories[] =
{
N_("Nominal by Nominal"),
}
tab_text (sym, 1, 0, TAB_LEFT, gettext (stats[i]));
- tab_float (sym, 2, 0, TAB_RIGHT, sym_v[i], 8, 3);
+ tab_double (sym, 2, 0, TAB_RIGHT, sym_v[i], NULL);
if (sym_ase[i] != SYSMIS)
- tab_float (sym, 3, 0, TAB_RIGHT, sym_ase[i], 8, 3);
+ tab_double (sym, 3, 0, TAB_RIGHT, sym_ase[i], NULL);
if (sym_t[i] != SYSMIS)
- tab_float (sym, 4, 0, TAB_RIGHT, sym_t[i], 8, 3);
- /*tab_float (sym, 5, 0, TAB_RIGHT, normal_sig (sym_v[i]), 8, 3);*/
+ tab_double (sym, 4, 0, TAB_RIGHT, sym_t[i], NULL);
+ /*tab_double (sym, 5, 0, TAB_RIGHT, normal_sig (sym_v[i]), NULL);*/
tab_next_row (sym);
}
tab_text (sym, 0, 0, TAB_LEFT, _("N of Valid Cases"));
- tab_float (sym, 2, 0, TAB_RIGHT, W, 8, 0);
+ tab_double (sym, 2, 0, TAB_RIGHT, W, wfmt);
tab_next_row (sym);
tab_offset (sym, 0, -1);
/* Display risk estimate. */
static void
-display_risk (void)
+display_risk (const struct dictionary *dict)
{
+ const struct variable *wv = dict_get_weight (dict);
+ const struct fmt_spec *wfmt = wv ? var_get_print_format (wv) : & F_8_0;
+
char buf[256];
double risk_v[3], lower[3], upper[3];
union value c[2];
}
tab_text (risk, 0, 0, TAB_LEFT, buf);
- tab_float (risk, 1, 0, TAB_RIGHT, risk_v[i], 8, 3);
- tab_float (risk, 2, 0, TAB_RIGHT, lower[i], 8, 3);
- tab_float (risk, 3, 0, TAB_RIGHT, upper[i], 8, 3);
+ tab_double (risk, 1, 0, TAB_RIGHT, risk_v[i], NULL);
+ tab_double (risk, 2, 0, TAB_RIGHT, lower[i], NULL);
+ tab_double (risk, 3, 0, TAB_RIGHT, upper[i], NULL);
tab_next_row (risk);
}
tab_text (risk, 0, 0, TAB_LEFT, _("N of Valid Cases"));
- tab_float (risk, 1, 0, TAB_RIGHT, W, 8, 0);
+ tab_double (risk, 1, 0, TAB_RIGHT, W, wfmt);
tab_next_row (risk);
tab_offset (risk, 0, -1);
}
}
- tab_float (direct, 3, 0, TAB_RIGHT, direct_v[i], 8, 3);
+ tab_double (direct, 3, 0, TAB_RIGHT, direct_v[i], NULL);
if (direct_ase[i] != SYSMIS)
- tab_float (direct, 4, 0, TAB_RIGHT, direct_ase[i], 8, 3);
+ tab_double (direct, 4, 0, TAB_RIGHT, direct_ase[i], NULL);
if (direct_t[i] != SYSMIS)
- tab_float (direct, 5, 0, TAB_RIGHT, direct_t[i], 8, 3);
- /*tab_float (direct, 6, 0, TAB_RIGHT, normal_sig (direct_v[i]), 8, 3);*/
+ tab_double (direct, 5, 0, TAB_RIGHT, direct_t[i], NULL);
+ /*tab_double (direct, 6, 0, TAB_RIGHT, normal_sig (direct_v[i]), NULL);*/
tab_next_row (direct);
}
tab_text (t, nc++, i + 1, TAT_PRINTF, "%g", dv->valid);
if (dsc->format == DSC_SERIAL)
tab_text (t, nc++, i + 1, TAT_PRINTF, "%g", dv->missing);
+
for (j = 0; j < DSC_N_STATS; j++)
if (dsc->show_stats & (1ul << j))
- 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);
}
tab_title (t, _("Valid cases = %g; cases with missing value(s) = %g."),
/* PSPP - a program for statistical analysis.
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 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
#include <data/procedure.h>
#include <data/value-labels.h>
#include <data/variable.h>
+#include <data/format.h>
#include <language/command.h>
#include <language/dictionary/split-file.h>
#include <language/lexer/lexer.h>
/* Output functions */
static void show_summary (const struct variable **dependent_var, int n_dep_var,
- const struct factor *f);
+ const struct dictionary *dict,
+ const struct factor *f);
static void show_extremes (const struct variable **dependent_var,
- int n_dep_var,
- const struct factor *factor,
- int n_extremities);
+ int n_dep_var,
+ const struct factor *factor,
+ int n_extremities);
static void show_descriptives (const struct variable **dependent_var,
int n_dep_var,
static void run_examine (struct cmd_examine *, struct casereader *,
struct dataset *);
-static void output_examine (void);
+static void output_examine (const struct dictionary *dict);
void factor_calc (const struct ccase *c, int case_no,
/* Show all the appropriate tables */
static void
-output_examine (void)
+output_examine (const struct dictionary *dict)
{
struct factor *fctr;
/* Show totals if appropriate */
if ( ! cmd.sbc_nototal || factors == 0 )
{
- show_summary (dependent_vars, n_dependent_vars, 0);
+ show_summary (dependent_vars, n_dependent_vars, dict, 0);
if ( cmd.sbc_statistics )
{
fctr = factors;
while ( fctr )
{
- show_summary (dependent_vars, n_dependent_vars, fctr);
+ show_summary (dependent_vars, n_dependent_vars, dict, fctr);
if ( cmd.sbc_statistics )
{
-void populate_percentiles (struct tab_table *tbl, int col, int row,
- const struct metrics *m);
+static void populate_percentiles (struct tab_table *tbl, int col, int row,
+ const struct metrics *m);
-void populate_descriptives (struct tab_table *t, int col, int row,
- const struct metrics *fs);
+static void populate_descriptives (struct tab_table *t, int col, int row,
+ const struct variable *,
+ const struct metrics *fs);
-void populate_extremes (struct tab_table *t, int col, int row, int n,
- const struct metrics *m);
+static void populate_extremes (struct tab_table *t, int col, int row, int n,
+ const struct variable *var,
+ const struct metrics *m);
-void populate_summary (struct tab_table *t, int col, int row,
- const struct metrics *m);
+static void populate_summary (struct tab_table *t, int col, int row,
+ const struct dictionary *dict,
+ const struct metrics *m);
}
if (ok)
- output_examine ();
+ output_examine (dict);
if ( totals )
static void
show_summary (const struct variable **dependent_var, int n_dep_var,
- const struct factor *fctr)
+ const struct dictionary *dict,
+ const struct factor *fctr)
{
static const char *subtitle[]=
{
if ( !fctr )
populate_summary (tbl, heading_columns,
(i * n_factors) + heading_rows,
+ dict,
&totals[i]);
else
{
populate_summary (tbl, heading_columns,
(i * n_factors) + count
+ heading_rows,
+ dict,
& (*fs)->m[i]);
count++ ;
}
-void
+static void
populate_summary (struct tab_table *t, int col, int row,
- const struct metrics *m)
+ const struct dictionary *dict,
+ const struct metrics *m)
{
const double total = m->n + m->n_missing ;
- tab_float (t, col + 0, row + 0, TAB_RIGHT, m->n, 8, 0);
- tab_float (t, col + 2, row + 0, TAB_RIGHT, m->n_missing, 8, 0);
- tab_float (t, col + 4, row + 0, TAB_RIGHT, total, 8, 0);
+ const struct variable *wv = dict_get_weight (dict);
+ const struct fmt_spec *wfmt = wv ? var_get_print_format (wv) : & F_8_0;
+
+ tab_double (t, col + 0, row + 0, TAB_RIGHT, m->n, wfmt);
+
+ tab_double (t, col + 2, row + 0, TAB_RIGHT, m->n_missing, wfmt);
+
+ tab_double (t, col + 4, row + 0, TAB_RIGHT, total, wfmt);
if ( total > 0 ) {
static void
show_extremes (const struct variable **dependent_var, int n_dep_var,
- const struct factor *fctr, int n_extremities)
+ const struct factor *fctr,
+ int n_extremities)
{
int i;
int heading_columns ;
const int heading_rows = 1;
struct tab_table *tbl;
+
+
int n_factors = 1;
int n_rows ;
if ( !fctr )
populate_extremes (tbl, heading_columns - 2,
- i * 2 * n_extremities * n_factors + heading_rows,
- n_extremities, &totals[i]);
-
+ i * 2 * n_extremities * n_factors + heading_rows,
+ n_extremities,
+ dependent_var[i],
+ &totals[i]);
else
{
struct factor_statistics **fs = fctr->fs;
}
populate_extremes (tbl, heading_columns - 2,
- row, n_extremities,
- & (*fs)->m[i]);
+ row, n_extremities,
+ dependent_var[i],
+ & (*fs)->m[i]);
count++ ;
fs++;
/* Fill in the extremities table */
-void
+static void
populate_extremes (struct tab_table *t,
- int col, int row, int n, const struct metrics *m)
+ int col, int row, int n,
+ const struct variable *var,
+ const struct metrics *m)
{
int extremity;
int idx=0;
-
tab_text (t, col, row,
TAB_RIGHT | TAT_TITLE ,
_ ("Highest")
for (extremity = 0; extremity < n ; ++extremity )
{
/* Highest */
- tab_float (t, col + 1, row + extremity,
+ tab_fixed (t, col + 1, row + extremity,
TAB_RIGHT,
extremity + 1, 8, 0);
/* Lowest */
- tab_float (t, col + 1, row + extremity + n,
+ tab_fixed (t, col + 1, row + extremity + n,
TAB_RIGHT,
extremity + 1, 8, 0);
if ( extremity + j >= n )
break ;
- tab_float (t, col + 3, row + extremity + j + n,
- TAB_RIGHT,
- wv->v.f, 8, 2);
+ tab_value (t, col + 3, row + extremity + j + n,
+ TAB_RIGHT,
+ &wv->v, var_get_print_format (var));
- tab_float (t, col + 2, row + extremity + j + n,
- TAB_RIGHT,
- cn->num, 8, 0);
+ tab_fixed (t, col + 2, row + extremity + j + n,
+ TAB_RIGHT,
+ cn->num, 10, 0);
if ( cn->next )
cn = cn->next;
if ( extremity + j >= n )
break ;
- tab_float (t, col + 3, row + extremity + j,
- TAB_RIGHT,
- wv->v.f, 8, 2);
+ tab_value (t, col + 3, row + extremity + j,
+ TAB_RIGHT,
+ &wv->v, var_get_print_format (var));
- tab_float (t, col + 2, row + extremity + j,
+ tab_fixed (t, col + 2, row + extremity + j,
TAB_RIGHT,
- cn->num, 8, 0);
+ cn->num, 10, 0);
if ( cn->next )
cn = cn->next;
}
populate_descriptives (tbl, heading_columns - 2,
- row, & (*fs)->m[i]);
+ row,
+ dependent_var[i],
+ & (*fs)->m[i]);
count++ ;
fs++;
{
populate_descriptives (tbl, heading_columns - 2,
- i * n_stat_rows * n_factors + heading_rows,
- &totals[i]);
+ i * n_stat_rows * n_factors + heading_rows,
+ dependent_var[i],
+ &totals[i]);
}
}
tab_submit (tbl);
-
}
/* Fill in the descriptives data */
-void
+static void
populate_descriptives (struct tab_table *tbl, int col, int row,
- const struct metrics *m)
+ const struct variable *var,
+ const struct metrics *m)
{
const double t = gsl_cdf_tdist_Qinv ((1 - cmd.n_cinterval[0] / 100.0)/2.0,
- m->n -1);
+ m->n -1);
tab_text (tbl, col,
row,
TAB_LEFT | TAT_TITLE,
_ ("Mean"));
- tab_float (tbl, col + 2,
- row,
- TAB_CENTER,
- m->mean,
- 8,2);
+ tab_double (tbl, col + 2,
+ row,
+ TAB_CENTER,
+ m->mean,
+ NULL);
- tab_float (tbl, col + 3,
- row,
- TAB_CENTER,
- m->se_mean,
- 8,3);
+ tab_double (tbl, col + 3,
+ row,
+ TAB_CENTER,
+ m->se_mean,
+ NULL);
tab_text (tbl, col,
TAB_LEFT | TAT_TITLE,
_ ("Lower Bound"));
- tab_float (tbl, col + 2,
- row + 1,
- TAB_CENTER,
- m->mean - t * m->se_mean,
- 8,3);
+ tab_double (tbl, col + 2,
+ row + 1,
+ TAB_CENTER,
+ m->mean - t * m->se_mean,
+ NULL);
tab_text (tbl, col + 1,
row + 2,
_ ("Upper Bound"));
- tab_float (tbl, col + 2,
- row + 2,
- TAB_CENTER,
- m->mean + t * m->se_mean,
- 8,3);
+ tab_double (tbl, col + 2,
+ row + 2,
+ TAB_CENTER,
+ m->mean + t * m->se_mean,
+ NULL);
tab_text (tbl, col,
row + 3,
TAB_LEFT | TAT_TITLE | TAT_PRINTF,
_ ("5%% Trimmed Mean"));
- tab_float (tbl, col + 2,
- row + 3,
- TAB_CENTER,
- m->trimmed_mean,
- 8,2);
+ tab_double (tbl, col + 2,
+ row + 3,
+ TAB_CENTER,
+ m->trimmed_mean,
+ NULL);
tab_text (tbl, col,
row + 4,
assert (p);
- tab_float (tbl, col + 2,
- row + 4,
- TAB_CENTER,
- p->v,
- 8, 2);
+ tab_double (tbl, col + 2,
+ row + 4,
+ TAB_CENTER,
+ p->v,
+ NULL);
}
TAB_LEFT | TAT_TITLE,
_ ("Variance"));
- tab_float (tbl, col + 2,
- row + 5,
- TAB_CENTER,
- m->var,
- 8,3);
+ tab_double (tbl, col + 2,
+ row + 5,
+ TAB_CENTER,
+ m->var,
+ NULL);
tab_text (tbl, col,
_ ("Std. Deviation"));
- tab_float (tbl, col + 2,
- row + 6,
- TAB_CENTER,
- m->stddev,
- 8,3);
+ tab_double (tbl, col + 2,
+ row + 6,
+ TAB_CENTER,
+ m->stddev,
+ NULL);
tab_text (tbl, col,
TAB_LEFT | TAT_TITLE,
_ ("Minimum"));
- tab_float (tbl, col + 2,
- row + 7,
- TAB_CENTER,
- m->min,
- 8,3);
+ tab_double (tbl, col + 2,
+ row + 7,
+ TAB_CENTER,
+ m->min, var_get_print_format (var));
tab_text (tbl, col,
row + 8,
TAB_LEFT | TAT_TITLE,
_ ("Maximum"));
- tab_float (tbl, col + 2,
- row + 8,
- TAB_CENTER,
- m->max,
- 8,3);
-
+ tab_double (tbl, col + 2,
+ row + 8,
+ TAB_CENTER,
+ m->max, var_get_print_format (var));
tab_text (tbl, col,
row + 9,
_ ("Range"));
- tab_float (tbl, col + 2,
- row + 9,
- TAB_CENTER,
- m->max - m->min,
- 8,3);
+ tab_double (tbl, col + 2,
+ row + 9,
+ TAB_CENTER,
+ m->max - m->min,
+ NULL);
tab_text (tbl, col,
row + 10,
assert (p1);
assert (p2);
- tab_float (tbl, col + 2,
- row + 10,
- TAB_CENTER,
- p1->v - p2->v,
- 8, 2);
+ tab_double (tbl, col + 2,
+ row + 10,
+ TAB_CENTER,
+ p1->v - p2->v,
+ NULL);
}
-
-
tab_text (tbl, col,
row + 11,
TAB_LEFT | TAT_TITLE,
_ ("Skewness"));
- tab_float (tbl, col + 2,
- row + 11,
- TAB_CENTER,
- m->skewness,
- 8,3);
+ tab_double (tbl, col + 2,
+ row + 11,
+ TAB_CENTER,
+ m->skewness,
+ NULL);
/* stderr of skewness */
- tab_float (tbl, col + 3,
- row + 11,
- TAB_CENTER,
- calc_seskew (m->n),
- 8,3);
-
+ tab_double (tbl, col + 3,
+ row + 11,
+ TAB_CENTER,
+ calc_seskew (m->n),
+ NULL);
tab_text (tbl, col,
row + 12,
_ ("Kurtosis"));
- tab_float (tbl, col + 2,
- row + 12,
- TAB_CENTER,
- m->kurtosis,
- 8,3);
+ tab_double (tbl, col + 2,
+ row + 12,
+ TAB_CENTER,
+ m->kurtosis,
+ NULL);
/* stderr of kurtosis */
- tab_float (tbl, col + 3,
- row + 12,
- TAB_CENTER,
- calc_sekurt (m->n),
- 8,3);
-
-
+ tab_double (tbl, col + 3,
+ row + 12,
+ TAB_CENTER,
+ calc_sekurt (m->n),
+ NULL);
}
i = 0;
while ( (*p) )
{
- tab_float (tbl, n_heading_columns + i++ , 1,
- TAB_CENTER,
- (*p)->p, 8, 0);
-
+ tab_fixed (tbl, n_heading_columns + i++ , 1,
+ TAB_CENTER,
+ (*p)->p,
+ 8, 0);
p++;
}
populate_percentiles (tbl, n_heading_columns - 1,
- row, & (*fs)->m[i]);
+ row,
+ & (*fs)->m[i]);
count++ ;
else
{
populate_percentiles (tbl, n_heading_columns - 1,
- i * n_stat_rows * n_factors + n_heading_rows,
- &totals[i]);
+ i * n_stat_rows * n_factors + n_heading_rows,
+ &totals[i]);
}
-
-
}
tab_submit (tbl);
-
-
}
-void
+static void
populate_percentiles (struct tab_table *tbl, int col, int row,
- const struct metrics *m)
+ const struct metrics *m)
{
int i;
i = 0;
while ( (*p) )
{
- tab_float (tbl, col + i + 1 , row,
- TAB_CENTER,
- (*p)->v, 8, 2);
- if ( (*p)->p == 25 )
- tab_float (tbl, col + i + 1 , row + 1,
+ tab_double (tbl, col + i + 1 , row,
TAB_CENTER,
- m->hinge[0], 8, 2);
+ (*p)->v,
+ NULL);
- if ( (*p)->p == 50 )
- tab_float (tbl, col + i + 1 , row + 1,
- TAB_CENTER,
- m->hinge[1], 8, 2);
+ if ( (*p)->p == 25 )
+ tab_double (tbl, col + i + 1 , row + 1,
+ TAB_CENTER,
+ m->hinge[0],
+ NULL);
- if ( (*p)->p == 75 )
- tab_float (tbl, col + i + 1 , row + 1,
- TAB_CENTER,
- m->hinge[2], 8, 2);
+ if ( (*p)->p == 50 )
+ tab_double (tbl, col + i + 1 , row + 1,
+ TAB_CENTER,
+ m->hinge[1],
+ NULL);
+ if ( (*p)->p == 75 )
+ tab_double (tbl, col + i + 1 , row + 1,
+ TAB_CENTER,
+ m->hinge[2],
+ NULL);
i++;
-
p++;
}
-
}
static void
static void precalc (struct casereader *, struct dataset *);
static void calc (const struct ccase *, const struct dataset *);
-static void postcalc (void);
+static void postcalc (const struct dataset *);
static void postprocess_freq_tab (const struct variable *);
-static void dump_full (const struct variable *);
-static void dump_condensed (const struct variable *);
-static void dump_statistics (const struct variable *, int show_varname);
+static void dump_full ( const struct variable *, const struct variable *);
+static void dump_condensed (const struct variable *, const struct variable *);
+static void dump_statistics (const struct variable *, bool show_varname, const struct variable *);
static void cleanup_freq_tab (const struct variable *);
static hsh_compare_func compare_value_numeric_a, compare_value_alpha_a;
precalc (group, ds);
for (; casereader_read (group, &c); case_destroy (&c))
calc (&c, ds);
- postcalc ();
+ postcalc (ds);
}
ok = casegrouper_destroy (grouper);
ok = proc_commit (ds) && ok;
/* Finishes up with the variables after frequencies have been
calculated. Displays statistics, percentiles, ... */
static void
-postcalc (void)
+postcalc (const struct dataset *ds)
{
+ const struct dictionary *dict = dataset_dict (ds);
+ const struct variable *wv = dict_get_weight (dict);
size_t i;
for (i = 0; i < n_variables; i++)
switch (cmd.cond)
{
case FRQ_CONDENSE:
- dump_condensed (v);
+ dump_condensed (v, wv);
break;
case FRQ_STANDARD:
- dump_full (v);
+ dump_full (v, wv);
break;
case FRQ_ONEPAGE:
if (n_categories > cmd.onepage_limit)
- dump_condensed (v);
+ dump_condensed (v, wv);
else
- dump_full (v);
+ dump_full (v, wv);
break;
default:
NOT_REACHED ();
/* Statistics. */
if (n_stats)
- dump_statistics (v, !dumped_freq_tab);
+ dump_statistics (v, !dumped_freq_tab, wv);
/* Displays a full frequency table for variable V. */
static void
-dump_full (const struct variable *v)
+dump_full (const struct variable *v, const struct variable *wv)
{
+ const struct fmt_spec *wfmt = wv ? var_get_print_format (wv) : &F_8_0;
int n_categories;
struct var_freqs *vf;
struct freq_tab *ft;
}
tab_value (t, 0 + lab, r, TAB_NONE, f->value, &vf->print);
- tab_float (t, 1 + lab, r, TAB_NONE, f->count, 8, 0);
- tab_float (t, 2 + lab, r, TAB_NONE, percent, 5, 1);
- tab_float (t, 3 + lab, r, TAB_NONE, valid_percent, 5, 1);
- tab_float (t, 4 + lab, r, TAB_NONE, cum_total, 5, 1);
+ tab_double (t, 1 + lab, r, TAB_NONE, f->count, wfmt);
+ tab_double (t, 2 + lab, r, TAB_NONE, percent, NULL);
+ tab_double (t, 3 + lab, r, TAB_NONE, valid_percent, NULL);
+ tab_double (t, 4 + lab, r, TAB_NONE, cum_total, NULL);
r++;
}
for (; f < &ft->valid[n_categories]; f++)
}
tab_value (t, 0 + lab, r, TAB_NONE, f->value, &vf->print);
- tab_float (t, 1 + lab, r, TAB_NONE, f->count, 8, 0);
- tab_float (t, 2 + lab, r, TAB_NONE,
- f->count / ft->total_cases * 100.0, 5, 1);
+ tab_double (t, 1 + lab, r, TAB_NONE, f->count, wfmt);
+ tab_double (t, 2 + lab, r, TAB_NONE,
+ f->count / ft->total_cases * 100.0, NULL);
tab_text (t, 3 + lab, r, TAB_NONE, _("Missing"));
r++;
}
tab_hline (t, TAL_2, 0, 4 + lab, r);
tab_joint_text (t, 0, r, 0 + lab, r, TAB_RIGHT | TAT_TITLE, _("Total"));
tab_vline (t, TAL_0, 1, r, r);
- tab_float (t, 1 + lab, r, TAB_NONE, cum_freq, 8, 0);
- tab_float (t, 2 + lab, r, TAB_NONE, 100.0, 5, 1);
- tab_float (t, 3 + lab, r, TAB_NONE, 100.0, 5, 1);
+ tab_double (t, 1 + lab, r, TAB_NONE, cum_freq, wfmt);
+ tab_fixed (t, 2 + lab, r, TAB_NONE, 100.0, 5, 1);
+ tab_fixed (t, 3 + lab, r, TAB_NONE, 100.0, 5, 1);
tab_title (t, "%s", var_to_string (v));
tab_submit (t);
/* Display condensed frequency table for variable V. */
static void
-dump_condensed (const struct variable *v)
+dump_condensed (const struct variable *v, const struct variable *wv)
{
+ const struct fmt_spec *wfmt = wv ? var_get_print_format (wv) : &F_8_0;
int n_categories;
struct var_freqs *vf;
struct freq_tab *ft;
cum_total += f->count / ft->valid_cases * 100.0;
tab_value (t, 0, r, TAB_NONE, f->value, &vf->print);
- tab_float (t, 1, r, TAB_NONE, f->count, 8, 0);
- tab_float (t, 2, r, TAB_NONE, percent, 3, 0);
- tab_float (t, 3, r, TAB_NONE, cum_total, 3, 0);
+ tab_double (t, 1, r, TAB_NONE, f->count, wfmt);
+ tab_double (t, 2, r, TAB_NONE, percent, NULL);
+ tab_double (t, 3, r, TAB_NONE, cum_total, NULL);
r++;
}
for (; f < &ft->valid[n_categories]; f++)
{
tab_value (t, 0, r, TAB_NONE, f->value, &vf->print);
- tab_float (t, 1, r, TAB_NONE, f->count, 8, 0);
- tab_float (t, 2, r, TAB_NONE,
- f->count / ft->total_cases * 100.0, 3, 0);
+ tab_double (t, 1, r, TAB_NONE, f->count, wfmt);
+ tab_double (t, 2, r, TAB_NONE,
+ f->count / ft->total_cases * 100.0, NULL);
r++;
}
/* Displays a table of all the statistics requested for variable V. */
static void
-dump_statistics (const struct variable *v, int show_varname)
+dump_statistics (const struct variable *v, bool show_varname,
+ const struct variable *wv)
{
+ const struct fmt_spec *wfmt = wv ? var_get_print_format (wv) : &F_8_0;
struct freq_tab *ft;
double stat_value[frq_n_stats];
struct tab_table *t;
{
tab_text (t, 0, r, TAB_LEFT | TAT_TITLE,
gettext (st_name[i].s10));
- tab_float (t, 2, r, TAB_NONE, stat_value[i], 11, 3);
+ tab_double (t, 2, r, TAB_NONE, stat_value[i], NULL);
r++;
}
tab_text (t, 1, 0, TAB_LEFT | TAT_TITLE, _("Valid"));
tab_text (t, 1, 1, TAB_LEFT | TAT_TITLE, _("Missing"));
- tab_float(t, 2, 0, TAB_NONE, ft->valid_cases, 11, 0);
- tab_float(t, 2, 1, TAB_NONE, ft->total_cases - ft->valid_cases, 11, 0);
-
+ tab_double (t, 2, 0, TAB_NONE, ft->valid_cases, wfmt);
+ tab_double (t, 2, 1, TAB_NONE, ft->total_cases - ft->valid_cases, wfmt);
for (i = 0; i < n_percentiles; i++, r++)
{
if (percentiles[i].p == 0.5)
tab_text (t, 1, r, TAB_LEFT, _("50 (Median)"));
else
- tab_float (t, 1, r, TAB_LEFT, percentiles[i].p * 100, 3, 0);
- tab_float (t, 2, r, TAB_NONE, percentiles[i].value, 11, 3);
-
+ tab_fixed (t, 1, r, TAB_LEFT, percentiles[i].p * 100, 3, 0);
+ tab_double (t, 2, r, TAB_NONE, percentiles[i].value,
+ var_get_print_format (v));
}
tab_columns (t, SOM_COL_DOWN, 1);
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
+
+#include <data/format.h>
#include <output/table.h>
#include <data/casereader.h>
#include <libpspp/hash.h>
}
+void
+do_summary_box (const struct descriptives *desc,
+ const struct variable *const *vv,
+ int n_vars);
+
void
do_summary_box (const struct descriptives *desc,
int columns = 1 ;
struct tab_table *table ;
-
if ( desc ) columns += 5;
if ( quartiles ) columns += 3;
col++;
}
+
for ( v = 0 ; v < n_vars ; ++v )
{
- tab_text (table, 0, 2 + v, TAT_NONE, var_to_string (vv[v]));
+ 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_float (table, 1, 2 + v, TAT_NONE, desc[v].n, 8, 0);
- tab_float (table, 2, 2 + v, TAT_NONE, desc[v].mean, 8, 3);
- tab_float (table, 3, 2 + v, TAT_NONE, desc[v].std_dev, 8, 3);
- tab_float (table, 4, 2 + v, TAT_NONE, desc[v].min, 8, 3);
- tab_float (table, 5, 2 + v, TAT_NONE, desc[v].max, 8, 3);
+ 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);
}
int n_vars,
enum mv_class filter);
-
-void do_summary_box (const struct descriptives *desc,
- const struct variable *const *vv,
- int n_vars);
-
-
-
#endif
#include <output/manager.h>
#include <output/table.h>
#include "sort-criteria.h"
+#include <data/format.h>
#include "xalloc.h"
/* Routines to show the output tables */
static void show_anova_table(void);
-static void show_descriptives(void);
+static void show_descriptives (const struct dictionary *dict);
static void show_homogeneity(void);
static void show_contrast_coeffs(short *);
static enum stat_table_t stat_tables ;
-void output_oneway(void);
+static void output_oneway (const struct dictionary *dict);
int
}
-void
-output_oneway(void)
+static void
+output_oneway (const struct dictionary *dict)
{
size_t i;
short *bad_contrast ;
}
if ( stat_tables & STAT_DESC )
- show_descriptives();
+ show_descriptives (dict);
if ( stat_tables & STAT_HOMO )
show_homogeneity();
/* Sums of Squares */
- tab_float (t, 2, i * 3 + 1, 0, ssa, 10, 2);
- tab_float (t, 2, i * 3 + 3, 0, sst, 10, 2);
- tab_float (t, 2, i * 3 + 2, 0, sst - ssa, 10, 2);
+ tab_double (t, 2, i * 3 + 1, 0, ssa, NULL);
+ tab_double (t, 2, i * 3 + 3, 0, sst, NULL);
+ tab_double (t, 2, i * 3 + 2, 0, sst - ssa, NULL);
/* Degrees of freedom */
- tab_float (t, 3, i * 3 + 1, 0, df1, 4, 0);
- tab_float (t, 3, i * 3 + 2, 0, df2, 4, 0);
- tab_float (t, 3, i * 3 + 3, 0, totals->n - 1, 4, 0);
+ tab_fixed (t, 3, i * 3 + 1, 0, df1, 4, 0);
+ tab_fixed (t, 3, i * 3 + 2, 0, df2, 4, 0);
+ tab_fixed (t, 3, i * 3 + 3, 0, totals->n - 1, 4, 0);
/* Mean Squares */
- tab_float (t, 4, i * 3 + 1, TAB_RIGHT, msa, 8, 3);
- tab_float (t, 4, i * 3 + 2, TAB_RIGHT, gp->mse, 8, 3);
+ tab_double (t, 4, i * 3 + 1, TAB_RIGHT, msa, NULL);
+ tab_double (t, 4, i * 3 + 2, TAB_RIGHT, gp->mse, NULL);
{
- const double F = msa/gp->mse ;
+ const double F = msa / gp->mse ;
/* The F value */
- tab_float (t, 5, i * 3 + 1, 0, F, 8, 3);
+ tab_double (t, 5, i * 3 + 1, 0, F, NULL);
/* The significance */
- tab_float (t, 6, i * 3 + 1, 0, gsl_cdf_fdist_Q(F,df1,df2), 8, 3);
+ tab_double (t, 6, i * 3 + 1, 0, gsl_cdf_fdist_Q (F, df1,df2), NULL);
}
}
/* Show the descriptives table */
static void
-show_descriptives(void)
+show_descriptives (const struct dictionary *dict)
{
size_t v;
- int n_cols =10;
+ int n_cols = 10;
struct tab_table *t;
int row;
- const double confidence=0.95;
+ const double confidence = 0.95;
const double q = (1.0 - confidence) / 2.0;
+ const struct variable *wv = dict_get_weight (dict);
+ const struct fmt_spec *wfmt = wv ? var_get_print_format (wv) : & F_8_0;
int n_rows = 2 ;
struct group_statistics *gs;
struct group_statistics *totals = &gp->ugs;
- const char *s = var_to_string(vars[v]);
+ const char *s = var_to_string (vars[v]);
+ const struct fmt_spec *fmt = var_get_print_format (vars[v]);
struct group_statistics *const *gs_array =
(struct group_statistics *const *) hsh_sort(gp->group_hash);
if ( v > 0)
tab_hline(t, TAL_1, 0, n_cols - 1 , row);
- for (count = 0 ; count < hsh_count(gp->group_hash) ; ++count)
+ for (count = 0; count < hsh_count (gp->group_hash); ++count)
{
struct string vstr;
ds_init_empty (&vstr);
/* Now fill in the numbers ... */
- tab_float (t, 2, row + count, 0, gs->n, 8,0);
+ tab_fixed (t, 2, row + count, 0, gs->n, 8, 0);
- tab_float (t, 3, row + count, 0, gs->mean,8,2);
+ tab_double (t, 3, row + count, 0, gs->mean, NULL);
- tab_float (t, 4, row + count, 0, gs->std_dev,8,2);
+ tab_double (t, 4, row + count, 0, gs->std_dev, NULL);
- std_error = gs->std_dev/sqrt(gs->n) ;
- tab_float (t, 5, row + count, 0,
- std_error, 8,2);
+ std_error = gs->std_dev / sqrt (gs->n) ;
+ tab_double (t, 5, row + count, 0,
+ std_error, NULL);
/* Now the confidence interval */
- T = gsl_cdf_tdist_Qinv(q,gs->n - 1);
+ T = gsl_cdf_tdist_Qinv (q, gs->n - 1);
- tab_float(t, 6, row + count, 0,
- gs->mean - T * std_error, 8, 2);
+ tab_double (t, 6, row + count, 0,
+ gs->mean - T * std_error, NULL);
- tab_float(t, 7, row + count, 0,
- gs->mean + T * std_error, 8, 2);
+ tab_double (t, 7, row + count, 0,
+ gs->mean + T * std_error, NULL);
/* Min and Max */
- tab_float(t, 8, row + count, 0, gs->minimum, 8, 2);
- tab_float(t, 9, row + count, 0, gs->maximum, 8, 2);
-
+ tab_double (t, 8, row + count, 0, gs->minimum, fmt);
+ tab_double (t, 9, row + count, 0, gs->maximum, fmt);
}
tab_text (t, 1, row + count,
TAB_LEFT | TAT_TITLE ,_("Total"));
- tab_float (t, 2, row + count, 0, totals->n, 8,0);
+ tab_double (t, 2, row + count, 0, totals->n, wfmt);
- tab_float (t, 3, row + count, 0, totals->mean, 8,2);
+ tab_double (t, 3, row + count, 0, totals->mean, NULL);
- tab_float (t, 4, row + count, 0, totals->std_dev,8,2);
+ tab_double (t, 4, row + count, 0, totals->std_dev, NULL);
- std_error = totals->std_dev/sqrt(totals->n) ;
+ std_error = totals->std_dev / sqrt (totals->n) ;
- tab_float (t, 5, row + count, 0, std_error, 8,2);
+ tab_double (t, 5, row + count, 0, std_error, NULL);
/* Now the confidence interval */
- T = gsl_cdf_tdist_Qinv(q,totals->n - 1);
+ T = gsl_cdf_tdist_Qinv (q, totals->n - 1);
- tab_float(t, 6, row + count, 0,
- totals->mean - T * std_error, 8, 2);
+ tab_double (t, 6, row + count, 0,
+ totals->mean - T * std_error, NULL);
- tab_float(t, 7, row + count, 0,
- totals->mean + T * std_error, 8, 2);
+ tab_double (t, 7, row + count, 0,
+ totals->mean + T * std_error, NULL);
/* Min and Max */
- tab_float(t, 8, row + count, 0, totals->minimum, 8, 2);
- tab_float(t, 9, row + count, 0, totals->maximum, 8, 2);
+ tab_double (t, 8, row + count, 0, totals->minimum, fmt);
+ tab_double (t, 9, row + count, 0, totals->maximum, fmt);
row += gp->n_groups + 1;
}
tab_submit (t);
-
-
}
/* Show the homogeneity table */
tab_text (t, 0, v + 1, TAB_LEFT | TAT_TITLE, s);
F = gp->levene;
- tab_float (t, 1, v + 1, TAB_RIGHT, F, 8,3);
- tab_float (t, 2, v + 1, TAB_RIGHT, df1 ,8,0);
- tab_float (t, 3, v + 1, TAB_RIGHT, df2 ,8,0);
+ tab_double (t, 1, v + 1, TAB_RIGHT, F, NULL);
+ tab_fixed (t, 2, v + 1, TAB_RIGHT, df1, 8, 0);
+ tab_fixed (t, 3, v + 1, TAB_RIGHT, df2, 8, 0);
/* Now the significance */
- tab_float (t, 4, v + 1, TAB_RIGHT,gsl_cdf_fdist_Q(F,df1,df2), 8, 3);
+ tab_double (t, 4, v + 1, TAB_RIGHT,gsl_cdf_fdist_Q (F, df1, df2), NULL);
}
tab_submit (t);
}
sec_vneq = sqrt(sec_vneq);
- df_numerator = pow2(df_numerator);
+ df_numerator = pow2 (df_numerator);
- tab_float (t, 3, (v * lines_per_variable) + i + 1,
- TAB_RIGHT, contrast_value, 8,2);
+ tab_double (t, 3, (v * lines_per_variable) + i + 1,
+ TAB_RIGHT, contrast_value, NULL);
- tab_float (t, 3, (v * lines_per_variable) + i + 1 +
+ tab_double (t, 3, (v * lines_per_variable) + i + 1 +
cmd.sbc_contrast,
- TAB_RIGHT, contrast_value, 8,2);
+ TAB_RIGHT, contrast_value, NULL);
- std_error_contrast = sqrt(grp_data->mse * coef_msq);
+ std_error_contrast = sqrt (grp_data->mse * coef_msq);
/* Std. Error */
- tab_float (t, 4, (v * lines_per_variable) + i + 1,
+ tab_double (t, 4, (v * lines_per_variable) + i + 1,
TAB_RIGHT, std_error_contrast,
- 8,3);
+ NULL);
T = fabs(contrast_value / std_error_contrast) ;
/* T Statistic */
- tab_float (t, 5, (v * lines_per_variable) + i + 1,
+ tab_double (t, 5, (v * lines_per_variable) + i + 1,
TAB_RIGHT, T,
- 8,3);
+ NULL);
df = grp_data->ugs.n - grp_data->n_groups;
/* Degrees of Freedom */
- tab_float (t, 6, (v * lines_per_variable) + i + 1,
+ tab_fixed (t, 6, (v * lines_per_variable) + i + 1,
TAB_RIGHT, df,
- 8,0);
+ 8, 0);
/* Significance TWO TAILED !!*/
- tab_float (t, 7, (v * lines_per_variable) + i + 1,
- TAB_RIGHT, 2 * gsl_cdf_tdist_Q(T,df),
- 8,3);
+ tab_double (t, 7, (v * lines_per_variable) + i + 1,
+ TAB_RIGHT, 2 * gsl_cdf_tdist_Q (T, df),
+ NULL);
/* Now for the Variances NOT Equal case */
/* Std. Error */
- tab_float (t, 4,
+ tab_double (t, 4,
(v * lines_per_variable) + i + 1 + cmd.sbc_contrast,
TAB_RIGHT, sec_vneq,
- 8,3);
+ NULL);
T = contrast_value / sec_vneq;
- tab_float (t, 5,
+ tab_double (t, 5,
(v * lines_per_variable) + i + 1 + cmd.sbc_contrast,
TAB_RIGHT, T,
- 8,3);
+ NULL);
df = df_numerator / df_denominator;
- tab_float (t, 6,
+ tab_double (t, 6,
(v * lines_per_variable) + i + 1 + cmd.sbc_contrast,
TAB_RIGHT, df,
- 8,3);
+ NULL);
/* The Significance */
- tab_float (t, 7, (v * lines_per_variable) + i + 1 + cmd.sbc_contrast,
- TAB_RIGHT, 2 * gsl_cdf_tdist_Q(T,df),
- 8,3);
+ tab_double (t, 7, (v * lines_per_variable) + i + 1 + cmd.sbc_contrast,
+ TAB_RIGHT, 2 * gsl_cdf_tdist_Q (T,df),
+ NULL);
}
}
tab_submit (t);
-
}
ostensible_number_of_groups = hsh_count (global_group_hash);
if (!taint_has_tainted_successor (taint))
- output_oneway();
+ output_oneway (dict);
+
taint_destroy (taint);
}
tab_text (t, 2, 0, TAB_CENTER | TAT_TITLE, _("R Square"));
tab_text (t, 3, 0, TAB_CENTER | TAT_TITLE, _("Adjusted R Square"));
tab_text (t, 4, 0, TAB_CENTER | TAT_TITLE, _("Std. Error of the Estimate"));
- tab_float (t, 1, 1, TAB_RIGHT, sqrt (rsq), 10, 2);
- tab_float (t, 2, 1, TAB_RIGHT, rsq, 10, 2);
- tab_float (t, 3, 1, TAB_RIGHT, adjrsq, 10, 2);
- tab_float (t, 4, 1, TAB_RIGHT, std_error, 10, 2);
+ tab_double (t, 1, 1, TAB_RIGHT, sqrt (rsq), NULL);
+ tab_double (t, 2, 1, TAB_RIGHT, rsq, NULL);
+ tab_double (t, 3, 1, TAB_RIGHT, adjrsq, NULL);
+ tab_double (t, 4, 1, TAB_RIGHT, std_error, NULL);
tab_title (t, _("Model Summary"));
tab_submit (t);
}
tab_text (t, 5, 0, TAB_CENTER | TAT_TITLE, _("t"));
tab_text (t, 6, 0, TAB_CENTER | TAT_TITLE, _("Significance"));
tab_text (t, 1, 1, TAB_LEFT | TAT_TITLE, _("(Constant)"));
- tab_float (t, 2, 1, 0, c->intercept, 10, 2);
+ tab_double (t, 2, 1, 0, c->intercept, NULL);
std_err = sqrt (gsl_matrix_get (c->cov, 0, 0));
- tab_float (t, 3, 1, 0, std_err, 10, 2);
- tab_float (t, 4, 1, 0, 0.0, 10, 2);
+ tab_double (t, 3, 1, 0, std_err, NULL);
+ tab_double (t, 4, 1, 0, 0.0, NULL);
t_stat = c->intercept / std_err;
- tab_float (t, 5, 1, 0, t_stat, 10, 2);
+ tab_double (t, 5, 1, 0, t_stat, NULL);
pval = 2 * gsl_cdf_tdist_Q (fabs (t_stat), 1.0);
- tab_float (t, 6, 1, 0, pval, 10, 2);
+ tab_double (t, 6, 1, 0, pval, NULL);
for (j = 0; j < c->n_coeffs; j++)
{
struct string tstr;
/*
Regression coefficients.
*/
- tab_float (t, 2, this_row, 0, c->coeff[j]->estimate, 10, 2);
+ tab_double (t, 2, this_row, 0, c->coeff[j]->estimate, NULL);
/*
Standard error of the coefficients.
*/
std_err = sqrt (gsl_matrix_get (c->cov, j + 1, j + 1));
- tab_float (t, 3, this_row, 0, std_err, 10, 2);
+ tab_double (t, 3, this_row, 0, std_err, NULL);
/*
Standardized coefficient, i.e., regression coefficient
if all variables had unit variance.
*/
beta = pspp_coeff_get_sd (c->coeff[j]);
beta *= c->coeff[j]->estimate / c->depvar_std;
- tab_float (t, 4, this_row, 0, beta, 10, 2);
+ tab_double (t, 4, this_row, 0, beta, NULL);
/*
Test statistic for H0: coefficient is 0.
*/
t_stat = c->coeff[j]->estimate / std_err;
- tab_float (t, 5, this_row, 0, t_stat, 10, 2);
+ tab_double (t, 5, this_row, 0, t_stat, NULL);
/*
P values for the test statistic above.
*/
pval =
2 * gsl_cdf_tdist_Q (fabs (t_stat),
(double) (c->n_obs - c->n_coeffs));
- tab_float (t, 6, this_row, 0, pval, 10, 2);
+ tab_double (t, 6, this_row, 0, pval, NULL);
ds_destroy (&tstr);
}
tab_title (t, _("Coefficients"));
tab_text (t, 1, 3, TAB_LEFT | TAT_TITLE, _("Total"));
/* Sums of Squares */
- tab_float (t, 2, 1, 0, c->ssm, 10, 2);
- tab_float (t, 2, 3, 0, c->sst, 10, 2);
- tab_float (t, 2, 2, 0, c->sse, 10, 2);
+ tab_double (t, 2, 1, 0, c->ssm, NULL);
+ tab_double (t, 2, 3, 0, c->sst, NULL);
+ tab_double (t, 2, 2, 0, c->sse, NULL);
/* Degrees of freedom */
tab_text (t, 3, 3, TAB_RIGHT | TAT_PRINTF, "%g", c->dft);
/* Mean Squares */
- tab_float (t, 4, 1, TAB_RIGHT, msm, 8, 3);
- tab_float (t, 4, 2, TAB_RIGHT, mse, 8, 3);
+ tab_double (t, 4, 1, TAB_RIGHT, msm, NULL);
+ tab_double (t, 4, 2, TAB_RIGHT, mse, NULL);
- tab_float (t, 5, 1, 0, F, 8, 3);
+ tab_double (t, 5, 1, 0, F, NULL);
- tab_float (t, 6, 1, 0, pval, 8, 3);
+ tab_double (t, 6, 1, 0, pval, NULL);
tab_title (t, _("ANOVA"));
tab_submit (t);
{
col = (i <= k) ? k : i;
row = (i <= k) ? i : k;
- tab_float (t, k + 2, i, TAB_CENTER,
- gsl_matrix_get (c->cov, row, col), 8, 3);
+ tab_double (t, k + 2, i, TAB_CENTER,
+ gsl_matrix_get (c->cov, row, col), NULL);
}
}
tab_title (t, _("Coefficient Correlations"));
#include <math/levene.h>
#include <output/manager.h>
#include <output/table.h>
+#include <data/format.h>
#include "xalloc.h"
/* Structures and Functions for the Statistics Summary Box */
struct ssbox;
typedef void populate_ssbox_func (struct ssbox *ssb,
- struct cmd_t_test *cmd);
+ const struct dictionary *,
+ struct cmd_t_test *cmd);
typedef void finalize_ssbox_func (struct ssbox *ssb);
struct ssbox
void ssbox_create (struct ssbox *ssb, struct cmd_t_test *cmd, int mode);
/* Populate a ssbox according to cmd */
-void ssbox_populate (struct ssbox *ssb, struct cmd_t_test *cmd);
+void ssbox_populate (struct ssbox *ssb, const struct dictionary *dict,
+ struct cmd_t_test *cmd);
/* Submit and destroy a ssbox */
void ssbox_finalize (struct ssbox *ssb);
/* A function to create, populate and submit the Paired Samples Correlation
box */
-void pscbox (void);
+static void pscbox (const struct dictionary *);
/* Structures and Functions for the Test Results Box */
struct trbox;
typedef void populate_trbox_func (struct trbox *trb,
- struct cmd_t_test *cmd);
+ const struct dictionary *dict,
+ struct cmd_t_test *cmd);
typedef void finalize_trbox_func (struct trbox *trb);
struct trbox {
void trbox_create (struct trbox *trb, struct cmd_t_test *cmd, int mode);
/* Populate a ssbox according to cmd */
-void trbox_populate (struct trbox *trb, struct cmd_t_test *cmd);
+static void trbox_populate (struct trbox *trb, const struct dictionary *dict,
+ struct cmd_t_test *cmd);
/* Submit and destroy a ssbox */
void trbox_finalize (struct trbox *trb);
/* Despatcher for the populate method */
void
-ssbox_populate (struct ssbox *ssb,struct cmd_t_test *cmd)
+ssbox_populate (struct ssbox *ssb, const struct dictionary *dict,
+ struct cmd_t_test *cmd)
{
- ssb->populate (ssb,cmd);
+ ssb->populate (ssb, dict, cmd);
}
}
void ssbox_one_sample_populate (struct ssbox *ssb,
- struct cmd_t_test *cmd);
+ const struct dictionary *,
+ struct cmd_t_test *cmd);
/* Initialize the one_sample ssbox */
void
tab_text (this->t, 4, 0, TAB_CENTER | TAT_TITLE, _ ("SE. Mean"));
}
-void ssbox_independent_samples_populate (struct ssbox *ssb,
- struct cmd_t_test *cmd);
+static void ssbox_independent_samples_populate (struct ssbox *ssb,
+ const struct dictionary *,
+ struct cmd_t_test *cmd);
/* Initialize the independent samples ssbox */
void
/* Populate the ssbox for independent samples */
-void
+static void
ssbox_independent_samples_populate (struct ssbox *ssb,
- struct cmd_t_test *cmd)
+ const struct dictionary *dict,
+ struct cmd_t_test *cmd)
{
int i;
+ const struct variable *wv = dict_get_weight (dict);
+ const struct fmt_spec *wfmt = wv ? var_get_print_format (wv) : &F_8_0;
+
char *val_lab[2] = {NULL, NULL};
double indep_value[2];
gs = hsh_find (grp_hash, (void *) &search_val);
assert (gs);
- tab_float (ssb->t, 2 ,i*2+count+1, TAB_RIGHT, gs->n, 10, 0);
- tab_float (ssb->t, 3 ,i*2+count+1, TAB_RIGHT, gs->mean, 8, 2);
- tab_float (ssb->t, 4 ,i*2+count+1, TAB_RIGHT, gs->std_dev, 8, 3);
- tab_float (ssb->t, 5 ,i*2+count+1, TAB_RIGHT, gs->se_mean, 8, 3);
+ tab_double (ssb->t, 2, i*2+count+1, TAB_RIGHT, gs->n, wfmt);
+ tab_double (ssb->t, 3, i*2+count+1, TAB_RIGHT, gs->mean, NULL);
+ tab_double (ssb->t, 4, i*2+count+1, TAB_RIGHT, gs->std_dev, NULL);
+ tab_double (ssb->t, 5, i*2+count+1, TAB_RIGHT, gs->se_mean, NULL);
}
}
free (val_lab[0]);
}
-void ssbox_paired_populate (struct ssbox *ssb,
- struct cmd_t_test *cmd);
+static void ssbox_paired_populate (struct ssbox *ssb,
+ const struct dictionary *dict,
+ struct cmd_t_test *cmd);
/* Initialize the paired values ssbox */
void
/* Populate the ssbox for paired values */
void
-ssbox_paired_populate (struct ssbox *ssb,struct cmd_t_test *cmd UNUSED)
+ssbox_paired_populate (struct ssbox *ssb, const struct dictionary *dict,
+ struct cmd_t_test *cmd UNUSED)
{
int i;
+ const struct variable *wv = dict_get_weight (dict);
+ const struct fmt_spec *wfmt = wv ? var_get_print_format (wv) : &F_8_0;
+
assert (ssb->t);
for (i=0; i < n_pairs; ++i)
var_get_name (pairs[i].v[j]));
/* Values */
- tab_float (ssb->t,2, i*2+j+1, TAB_RIGHT, pairs[i].mean[j], 8, 2);
- tab_float (ssb->t,3, i*2+j+1, TAB_RIGHT, pairs[i].n, 10, 0);
- tab_float (ssb->t,4, i*2+j+1, TAB_RIGHT, pairs[i].std_dev[j], 8, 3);
- tab_float (ssb->t,5, i*2+j+1, TAB_RIGHT, pairs[i].std_dev[j]/sqrt (pairs[i].n), 8, 3);
+ tab_double (ssb->t,2, i*2+j+1, TAB_RIGHT, pairs[i].mean[j], NULL);
+ tab_double (ssb->t,3, i*2+j+1, TAB_RIGHT, pairs[i].n, wfmt);
+ tab_double (ssb->t,4, i*2+j+1, TAB_RIGHT, pairs[i].std_dev[j], NULL);
+ tab_double (ssb->t,5, i*2+j+1, TAB_RIGHT,
+ pairs[i].std_dev[j]/sqrt (pairs[i].n), NULL);
}
}
/* Populate the one sample ssbox */
void
-ssbox_one_sample_populate (struct ssbox *ssb, struct cmd_t_test *cmd)
+ssbox_one_sample_populate (struct ssbox *ssb, const struct dictionary *dict,
+ struct cmd_t_test *cmd)
{
int i;
+ const struct variable *wv = dict_get_weight (dict);
+ const struct fmt_spec *wfmt = wv ? var_get_print_format (wv) : &F_8_0;
+
assert (ssb->t);
for (i=0; i < cmd->n_variables; ++i)
struct group_statistics *gs = &group_proc_get (cmd->v_variables[i])->ugs;
tab_text (ssb->t, 0, i+1, TAB_LEFT, var_get_name (cmd->v_variables[i]));
- tab_float (ssb->t,1, i+1, TAB_RIGHT, gs->n, 10, 0);
- tab_float (ssb->t,2, i+1, TAB_RIGHT, gs->mean, 8, 2);
- tab_float (ssb->t,3, i+1, TAB_RIGHT, gs->std_dev, 8, 2);
- tab_float (ssb->t,4, i+1, TAB_RIGHT, gs->se_mean, 8, 3);
+ tab_double (ssb->t,1, i+1, TAB_RIGHT, gs->n, wfmt);
+ tab_double (ssb->t,2, i+1, TAB_RIGHT, gs->mean, NULL);
+ tab_double (ssb->t,3, i+1, TAB_RIGHT, gs->std_dev, NULL);
+ tab_double (ssb->t,4, i+1, TAB_RIGHT, gs->se_mean, NULL);
}
-
}
void trbox_independent_samples_init (struct trbox *trb,
struct cmd_t_test *cmd );
-void trbox_independent_samples_populate (struct trbox *trb,
- struct cmd_t_test *cmd);
+static void trbox_independent_samples_populate (struct trbox *trb,
+ const struct dictionary *dict,
+ struct cmd_t_test *cmd);
void trbox_one_sample_init (struct trbox *self,
struct cmd_t_test *cmd );
-void trbox_one_sample_populate (struct trbox *trb,
- struct cmd_t_test *cmd);
+static void trbox_one_sample_populate (struct trbox *trb,
+ const struct dictionary *,
+ struct cmd_t_test *cmd);
void trbox_paired_init (struct trbox *self,
struct cmd_t_test *cmd );
-void trbox_paired_populate (struct trbox *trb,
- struct cmd_t_test *cmd);
+static void trbox_paired_populate (struct trbox *trb,
+ const struct dictionary *,
+ struct cmd_t_test *cmd);
}
/* Populate a trbox according to cmd */
-void
-trbox_populate (struct trbox *trb, struct cmd_t_test *cmd)
+static void
+trbox_populate (struct trbox *trb, const struct dictionary *dict,
+ struct cmd_t_test *cmd)
{
- trb->populate (trb,cmd);
+ trb->populate (trb, dict, cmd);
}
/* Submit and destroy a trbox */
}
/* Populate the independent samples trbox */
-void
+static void
trbox_independent_samples_populate (struct trbox *self,
- struct cmd_t_test *cmd )
+ const struct dictionary *dict UNUSED,
+ struct cmd_t_test *cmd)
{
int i;
tab_text (self->t, 1, i*2+3, TAB_LEFT, _ ("Equal variances assumed"));
- tab_float (self->t, 2, i*2+3, TAB_CENTER, grp_data->levene, 8,3);
+ tab_double (self->t, 2, i*2+3, TAB_CENTER, grp_data->levene, NULL);
/* Now work out the significance of the Levene test */
df1 = 1; df2 = grp_data->ugs.n - 2;
q = gsl_cdf_fdist_Q (grp_data->levene, df1, df2);
- tab_float (self->t, 3, i*2+3, TAB_CENTER, q, 8,3 );
+ tab_double (self->t, 3, i*2+3, TAB_CENTER, q, NULL);
df = gs0->n + gs1->n - 2.0 ;
- tab_float (self->t, 5, i*2+3, TAB_RIGHT, df, 10, 0);
+ tab_double (self->t, 5, i*2+3, TAB_RIGHT, df, NULL);
pooled_variance = ( (gs0->n )*pow2 (gs0->s_std_dev)
+
t = (gs0->mean - gs1->mean) / sqrt (pooled_variance) ;
t /= sqrt ((gs0->n + gs1->n)/ (gs0->n*gs1->n));
- tab_float (self->t, 4, i*2+3, TAB_RIGHT, t, 8, 3);
+ tab_double (self->t, 4, i*2+3, TAB_RIGHT, t, NULL);
p = gsl_cdf_tdist_P (t, df);
q = gsl_cdf_tdist_Q (t, df);
- tab_float (self->t, 6, i*2+3, TAB_RIGHT, 2.0* (t>0?q:p) , 8, 3);
+ tab_double (self->t, 6, i*2+3, TAB_RIGHT, 2.0* (t>0?q:p), NULL);
mean_diff = gs0->mean - gs1->mean;
- tab_float (self->t, 7, i*2+3, TAB_RIGHT, mean_diff, 8, 3);
+ tab_double (self->t, 7, i*2+3, TAB_RIGHT, mean_diff, NULL);
std_err_diff = sqrt ( pow2 (gs0->se_mean) + pow2 (gs1->se_mean));
- tab_float (self->t, 8, i*2+3, TAB_RIGHT, std_err_diff, 8, 3);
+ tab_double (self->t, 8, i*2+3, TAB_RIGHT, std_err_diff, NULL);
/* Now work out the confidence interval */
q = (1 - cmd->criteria)/2.0; /* 2-tailed test */
t = gsl_cdf_tdist_Qinv (q,df);
- tab_float (self->t, 9, i*2+3, TAB_RIGHT,
- mean_diff - t * std_err_diff, 8, 3);
+ tab_double (self->t, 9, i*2+3, TAB_RIGHT,
+ mean_diff - t * std_err_diff, NULL);
- tab_float (self->t, 10, i*2+3, TAB_RIGHT,
- mean_diff + t * std_err_diff, 8, 3);
+ tab_double (self->t, 10, i*2+3, TAB_RIGHT,
+ mean_diff + t * std_err_diff, NULL);
{
(pow2 (gs1->s_std_dev)/ (gs1->n -1) );
t = mean_diff / sqrt (se2) ;
- tab_float (self->t, 4, i*2+3+1, TAB_RIGHT, t, 8, 3);
+ tab_double (self->t, 4, i*2+3+1, TAB_RIGHT, t, NULL);
df = pow2 (se2) / (
(pow2 (pow2 (gs0->s_std_dev)/ (gs0->n - 1 ))
/ (gs1->n -1 )
)
) ;
- tab_float (self->t, 5, i*2+3+1, TAB_RIGHT, df, 8, 3);
+
+ tab_double (self->t, 5, i*2+3+1, TAB_RIGHT, df, NULL);
p = gsl_cdf_tdist_P (t, df);
q = gsl_cdf_tdist_Q (t, df);
- tab_float (self->t, 6, i*2+3+1, TAB_RIGHT, 2.0* (t>0?q:p) , 8, 3);
+ tab_double (self->t, 6, i*2+3+1, TAB_RIGHT, 2.0* (t>0?q:p), NULL);
/* Now work out the confidence interval */
q = (1 - cmd->criteria)/2.0; /* 2-tailed test */
t = gsl_cdf_tdist_Qinv (q, df);
- tab_float (self->t, 7, i*2+3+1, TAB_RIGHT, mean_diff, 8, 3);
-
+ tab_double (self->t, 7, i*2+3+1, TAB_RIGHT, mean_diff, NULL);
- tab_float (self->t, 8, i*2+3+1, TAB_RIGHT, std_err_diff, 8, 3);
+ tab_double (self->t, 8, i*2+3+1, TAB_RIGHT, std_err_diff, NULL);
- tab_float (self->t, 9, i*2+3+1, TAB_RIGHT,
- mean_diff - t * std_err_diff, 8, 3);
- tab_float (self->t, 10, i*2+3+1, TAB_RIGHT,
- mean_diff + t * std_err_diff, 8, 3);
+ tab_double (self->t, 9, i*2+3+1, TAB_RIGHT,
+ mean_diff - t * std_err_diff, NULL);
+ tab_double (self->t, 10, i*2+3+1, TAB_RIGHT,
+ mean_diff + t * std_err_diff, NULL);
}
}
}
}
/* Populate the paired samples trbox */
-void
+static void
trbox_paired_populate (struct trbox *trb,
- struct cmd_t_test *cmd UNUSED)
+ const struct dictionary *dict,
+ struct cmd_t_test *cmd UNUSED)
{
int i;
+ const struct variable *wv = dict_get_weight (dict);
+ const struct fmt_spec *wfmt = wv ? var_get_print_format (wv) : &F_8_0;
+
for (i=0; i < n_pairs; ++i)
{
double p,q;
var_get_name (pairs[i].v[0]),
var_get_name (pairs[i].v[1]));
- tab_float (trb->t, 2, i+3, TAB_RIGHT, pairs[i].mean_diff, 8, 4);
+ tab_double (trb->t, 2, i+3, TAB_RIGHT, pairs[i].mean_diff, NULL);
- tab_float (trb->t, 3, i+3, TAB_RIGHT, pairs[i].std_dev_diff, 8, 5);
+ tab_double (trb->t, 3, i+3, TAB_RIGHT, pairs[i].std_dev_diff, NULL);
/* SE Mean */
se_mean = pairs[i].std_dev_diff / sqrt (n) ;
- tab_float (trb->t, 4, i+3, TAB_RIGHT, se_mean, 8,5 );
+ tab_double (trb->t, 4, i+3, TAB_RIGHT, se_mean, NULL);
/* Now work out the confidence interval */
q = (1 - cmd->criteria)/2.0; /* 2-tailed test */
t = gsl_cdf_tdist_Qinv (q, df);
- tab_float (trb->t, 5, i+3, TAB_RIGHT,
- pairs[i].mean_diff - t * se_mean , 8, 4);
+ tab_double (trb->t, 5, i+3, TAB_RIGHT,
+ pairs[i].mean_diff - t * se_mean , NULL);
- tab_float (trb->t, 6, i+3, TAB_RIGHT,
- pairs[i].mean_diff + t * se_mean , 8, 4);
+ tab_double (trb->t, 6, i+3, TAB_RIGHT,
+ pairs[i].mean_diff + t * se_mean , NULL);
t = (pairs[i].mean[0] - pairs[i].mean[1])
/ sqrt (
- ( pow2 (pairs[i].s_std_dev[0]) + pow2 (pairs[i].s_std_dev[1]) -
+ ( pow2 (pairs[i].s_std_dev[0]) + pow2 (pairs[i].s_std_dev[1]) -
2 * pairs[i].correlation *
pairs[i].s_std_dev[0] * pairs[i].s_std_dev[1] )
/ (n - 1)
);
- tab_float (trb->t, 7, i+3, TAB_RIGHT, t , 8,3 );
+ tab_double (trb->t, 7, i+3, TAB_RIGHT, t, NULL);
/* Degrees of freedom */
- tab_float (trb->t, 8, i+3, TAB_RIGHT, df , 10, 0 );
+ tab_double (trb->t, 8, i+3, TAB_RIGHT, df, wfmt);
p = gsl_cdf_tdist_P (t,df);
q = gsl_cdf_tdist_P (t,df);
- tab_float (trb->t, 9, i+3, TAB_RIGHT, 2.0* (t>0?q:p) , 8, 3);
+ tab_double (trb->t, 9, i+3, TAB_RIGHT, 2.0* (t>0?q:p), NULL);
}
}
/* Populate the one sample trbox */
-void
-trbox_one_sample_populate (struct trbox *trb, struct cmd_t_test *cmd)
+static void
+trbox_one_sample_populate (struct trbox *trb,
+ const struct dictionary *dict,
+ struct cmd_t_test *cmd)
{
int i;
+ const struct variable *wv = dict_get_weight (dict);
+ const struct fmt_spec *wfmt = wv ? var_get_print_format (wv) : &F_8_0;
+
assert (trb->t);
for (i=0; i < cmd->n_variables; ++i)
t = (gs->mean - cmd->n_testval[0] ) * sqrt (gs->n) / gs->std_dev ;
- tab_float (trb->t, 1, i+3, TAB_RIGHT, t, 8,3);
+ tab_double (trb->t, 1, i+3, TAB_RIGHT, t, NULL);
/* degrees of freedom */
df = gs->n - 1;
- tab_float (trb->t, 2, i+3, TAB_RIGHT, df, 8,0);
+ tab_double (trb->t, 2, i+3, TAB_RIGHT, df, wfmt);
p = gsl_cdf_tdist_P (t, df);
q = gsl_cdf_tdist_Q (t, df);
/* Multiply by 2 to get 2-tailed significance, makeing sure we've got
the correct tail*/
- tab_float (trb->t, 3, i+3, TAB_RIGHT, 2.0* (t>0?q:p), 8,3);
+ tab_double (trb->t, 3, i+3, TAB_RIGHT, 2.0* (t>0?q:p), NULL);
- tab_float (trb->t, 4, i+3, TAB_RIGHT, gs->mean_diff, 8,3);
+ tab_double (trb->t, 4, i+3, TAB_RIGHT, gs->mean_diff, NULL);
q = (1 - cmd->criteria)/2.0; /* 2-tailed test */
t = gsl_cdf_tdist_Qinv (q, df);
- tab_float (trb->t, 5, i+3, TAB_RIGHT,
- gs->mean_diff - t * gs->se_mean, 8,4);
+ tab_double (trb->t, 5, i+3, TAB_RIGHT,
+ gs->mean_diff - t * gs->se_mean, NULL);
- tab_float (trb->t, 6, i+3, TAB_RIGHT,
- gs->mean_diff + t * gs->se_mean, 8,4);
+ tab_double (trb->t, 6, i+3, TAB_RIGHT,
+ gs->mean_diff + t * gs->se_mean, NULL);
}
}
/* Create , populate and submit the Paired Samples Correlation box */
-void
-pscbox (void)
+static void
+pscbox (const struct dictionary *dict)
{
- const int rows=1+n_pairs;
- const int cols=5;
+ const struct variable *wv = dict_get_weight (dict);
+ const struct fmt_spec *wfmt = wv ? var_get_print_format (wv) : &F_8_0;
+
+ const int rows = 1 + n_pairs;
+ const int cols = 5;
int i;
struct tab_table *table;
/* row data */
- tab_float (table, 2, i+1, TAB_RIGHT, pairs[i].n, 4, 0);
- tab_float (table, 3, i+1, TAB_RIGHT, pairs[i].correlation, 8, 3);
+ tab_double (table, 2, i+1, TAB_RIGHT, pairs[i].n, wfmt);
+ tab_double (table, 3, i+1, TAB_RIGHT, pairs[i].correlation, NULL);
p = gsl_cdf_tdist_P (correlation_t, df);
q = gsl_cdf_tdist_Q (correlation_t, df);
- tab_float (table, 4, i+1, TAB_RIGHT, 2.0* (correlation_t>0?q:p), 8, 3);
+ tab_double (table, 4, i+1, TAB_RIGHT, 2.0* (correlation_t>0?q:p), NULL);
}
tab_submit (table);
if (!taint_has_tainted_successor (taint))
{
ssbox_create (&stat_summary_box,cmd,mode);
- ssbox_populate (&stat_summary_box,cmd);
+ ssbox_populate (&stat_summary_box, dict, cmd);
ssbox_finalize (&stat_summary_box);
if ( mode == T_PAIRED )
- pscbox ();
+ pscbox (dict);
- trbox_create (&test_results_box,cmd,mode);
- trbox_populate (&test_results_box,cmd);
+ trbox_create (&test_results_box, cmd, mode);
+ trbox_populate (&test_results_box, dict, cmd);
trbox_finalize (&test_results_box);
}
#include <libpspp/misc.h>
#include <libpspp/pool.h>
+#include <data/settings.h>
+
#include "minmax.h"
#include "xalloc.h"
/* Sets cell (C,R) in TABLE, with options OPT, to have value VAL
with NDEC decimal places. */
void
-tab_float (struct tab_table *table, int c, int r, unsigned char opt,
+tab_fixed (struct tab_table *table, int c, int r, unsigned char opt,
double val, int w, int d)
{
char *contents;
|| c + table->col_ofs >= table->nc
|| r + table->row_ofs >= table->nr)
{
- printf ("tab_float(): bad cell (%d+%d=%d,%d+%d=%d) in table size "
+ printf ("tab_fixed(): bad cell (%d+%d=%d,%d+%d=%d) in table size "
"(%d,%d)\n",
c, table->col_ofs, c + table->col_ofs,
r, table->row_ofs, r + table->row_ofs,
memcpy (contents, cp, f.w);
}
+/* Sets cell (C,R) in TABLE, with options OPT, to have value VAL as
+ formatted by FMT.
+ If FMT is null, then the default print format will be used.
+*/
+void
+tab_double (struct tab_table *table, int c, int r, unsigned char opt,
+ double val, const struct fmt_spec *fmt)
+{
+ int w;
+ char *contents;
+ char buf[40], *cp;
+
+ union value double_value;
+
+ assert (table != NULL);
+
+ assert (c >= 0);
+ assert (c < table->nc);
+ assert (r >= 0);
+ assert (r < table->nr);
+
+ if ( fmt == NULL)
+ fmt = settings_get_format ();
+
+ fmt_check_output (fmt);
+
+#if DEBUGGING
+ if (c + table->col_ofs < 0 || r + table->row_ofs < 0
+ || c + table->col_ofs >= table->nc
+ || r + table->row_ofs >= table->nr)
+ {
+ printf ("tab_double(): bad cell (%d+%d=%d,%d+%d=%d) in table size "
+ "(%d,%d)\n",
+ c, table->col_ofs, c + table->col_ofs,
+ r, table->row_ofs, r + table->row_ofs,
+ table->nc, table->nr);
+ return;
+ }
+#endif
+
+ double_value.f = val;
+ data_out (&double_value, fmt, buf);
+
+ cp = buf;
+ while (isspace ((unsigned char) *cp) && cp < &buf[fmt->w])
+ cp++;
+ w = fmt->w - (cp - buf);
+
+ contents = pool_alloc (table->container, w);
+ table->cc[c + r * table->cf] = ss_buffer (contents, w);
+ table->ct[c + r * table->cf] = opt;
+ memcpy (contents, cp, w);
+}
+
+
/* Sets cell (C,R) in TABLE, with options OPT, to have text value
TEXT. */
void
|| c + table->col_ofs >= table->nc
|| r + table->row_ofs >= table->nr)
{
- printf ("tab_float(): bad cell (%d+%d=%d,%d+%d=%d) in table size "
+ printf ("tab_raw(): bad cell (%d+%d=%d,%d+%d=%d) in table size "
"(%d,%d)\n",
c, table->col_ofs, c + table->col_ofs,
r, table->row_ofs, r + table->row_ofs,
union value;
void tab_value (struct tab_table *, int c, int r, unsigned char opt,
const union value *, const struct fmt_spec *);
-void tab_float (struct tab_table *, int c, int r, unsigned char opt,
+
+void tab_fixed (struct tab_table *, int c, int r, unsigned char opt,
double v, int w, int d);
+
+void tab_double (struct tab_table *, int c, int r, unsigned char opt,
+ double v, const struct fmt_spec *);
+
void tab_text (struct tab_table *, int c, int r, unsigned opt,
const char *, ...)
PRINTF_FORMAT (5, 6);
|ABC |F8.0 |
+--------+------+
2.1 DESCRIPTIVES. Valid cases = 6; cases with missing value(s) = 0.
-+--------#-+-----+-------+-------+-------+
-|Variable#N| Mean|Std Dev|Minimum|Maximum|
-#========#=#=====#=======#=======#=======#
-|ABC #6|3.000| .837| 2.000| 4.000|
-+--------#-+-----+-------+-------+-------+
++--------#-+----+-------+-------+-------+
+|Variable#N|Mean|Std Dev|Minimum|Maximum|
+#========#=#====#=======#=======#=======#
+|ABC #6|3.00| .84| 2.00| 4.00|
++--------#-+----+-------+-------+-------+
EOF
if [ $? -ne 0 ] ; then fail ; fi
#=============#=#====#==============#========#
# INDEP |N|Mean|Std. Deviation|SE. Mean#
#=============#=#====#==============#========#
-#DEP1 a |5|2.00| .707| .316#
-# b |5|4.00| .707| .316#
-#DEP2 a |5|4.00| .707| .316#
-# b |5|2.00| .707| .316#
+#DEP1 a |5|2.00| .71| .32#
+# b |5|4.00| .71| .32#
+#DEP2 a |5|4.00| .71| .32#
+# b |5|2.00| .71| .32#
#=============#=#====#==============#========#
2.2 T-TEST. Independent Samples Test
-#===============================#==========#===============================================================================#
-# # Levene's | t-test for Equality of Means #
-# #----+-----+------+-----+---------------+---------------+---------------------+------------#
-# # | | | | | | | 95% #
-# # | | | | | | +------+-----#
-# # F | Sig.| t | df |Sig. (2-tailed)|Mean Difference|Std. Error Difference| Lower|Upper#
-#===============================#====#=====#======#=====#===============#===============#=====================#======#=====#
-#DEP1Equal variances assumed #.000|1.000|-4.472| 8| .002| -2.000| .447|-3.031|-.969#
-# Equal variances not assumed# | |-4.472|8.000| .002| -2.000| .447|-3.031|-.969#
-#DEP2Equal variances assumed #.000|1.000| 4.472| 8| .002| 2.000| .447| .969|3.031#
-# Equal variances not assumed# | | 4.472|8.000| .002| 2.000| .447| .969|3.031#
-#===============================#====#=====#======#=====#===============#===============#=====================#======#=====#
+#===============================#========#============================================================================#
+# #Levene's| t-test for Equality of Means #
+# #---+----+-----+----+---------------+---------------+---------------------+-----------#
+# # | | | | | | | 95% #
+# # | | | | | | +-----+-----#
+# # F |Sig.| t | df |Sig. (2-tailed)|Mean Difference|Std. Error Difference|Lower|Upper#
+#===============================#===#====#=====#====#===============#===============#=====================#=====#=====#
+#DEP1Equal variances assumed #.00|1.00|-4.47|8.00| .00| -2.00| .45|-3.03| -.97#
+# Equal variances not assumed# | |-4.47|8.00| .00| -2.00| .45|-3.03| -.97#
+#DEP2Equal variances assumed #.00|1.00| 4.47|8.00| .00| 2.00| .45| .97| 3.03#
+# Equal variances not assumed# | | 4.47|8.00| .00| 2.00| .45| .97| 3.03#
+#===============================#===#====#=====#====#===============#===============#=====================#=====#=====#
EOF
if [ $? -ne 0 ] ; then fail ; fi
#==========#=#====#==============#========#
# gv |N|Mean|Std. Deviation|SE. Mean#
#==========#=#====#==============#========#
-#x One |5|2.60| .548| .245#
-# Two |3|3.50| .500| .289#
+#x One |5|2.60| .55| .24#
+# Two |3|3.50| .50| .29#
#==========#=#====#==============#========#
2.2 T-TEST. Independent Samples Test
-#============================#==========#===============================================================================#
-# # Levene's | t-test for Equality of Means #
-# #-----+----+------+-----+---------------+---------------+---------------------+------------#
-# # | | | | | | | 95% #
-# # | | | | | | +------+-----#
-# # F |Sig.| t | df |Sig. (2-tailed)|Mean Difference|Std. Error Difference| Lower|Upper#
-#============================#=====#====#======#=====#===============#===============#=====================#======#=====#
-#xEqual variances assumed #1.127|.329|-2.315| 6| .060| -.900| .379|-1.826| .026#
-# Equal variances not assumed# | |-2.377|4.699| .067| -.900| .379|-1.892| .092#
-#============================#=====#====#======#=====#===============#===============#=====================#======#=====#
+#============================#=========#============================================================================#
+# # Levene's| t-test for Equality of Means #
+# #----+----+-----+----+---------------+---------------+---------------------+-----------#
+# # | | | | | | | 95% #
+# # | | | | | | +-----+-----#
+# # F |Sig.| t | df |Sig. (2-tailed)|Mean Difference|Std. Error Difference|Lower|Upper#
+#============================#====#====#=====#====#===============#===============#=====================#=====#=====#
+#xEqual variances assumed #1.13| .33|-2.32|6.00| .06| -.90| .38|-1.83| .03#
+# Equal variances not assumed# | |-2.38|4.70| .07| -.90| .38|-1.89| .09#
+#============================#====#====#=====#====#===============#===============#=====================#=====#=====#
EOF
if [ $? -ne 0 ] ; then fail ; fi
|SEX |A1 |
|X |F8.0 |
+--------+------+
-2.1 FREQUENCIES. X
+2.1 FREQUENCIES. X
+-----------+--------+---------+--------+--------+--------+
| | | | | Valid | Cum |
|Value Label| Value |Frequency| Percent| Percent| Percent|
#===========#========#=========#========#========#========#
-| | 12.00| 1| 25.0| 25.0| 25.0|
-| | 13.00| 1| 25.0| 25.0| 50.0|
-| | 21.00| 1| 25.0| 25.0| 75.0|
-| | 31.00| 1| 25.0| 25.0| 100.0|
+| | 12.00| 1| 25.00| 25.00| 25.00|
+| | 13.00| 1| 25.00| 25.00| 50.00|
+| | 21.00| 1| 25.00| 25.00| 75.00|
+| | 31.00| 1| 25.00| 25.00| 100.00|
#===========#========#=========#========#========#========#
| Total| 4| 100.0| 100.0| |
+--------------------+---------+--------+--------+--------+
-+---------------+------+
-|N Valid | 4|
-| Missing| 0|
-|Mean |19.250|
-|Std Dev | 8.808|
-|Minimum |12.000|
-|Maximum |31.000|
-+---------------+------+
++---------------+-----+
+|N Valid | 4|
+| Missing| 0|
+|Mean |19.25|
+|Std Dev | 8.81|
+|Minimum |12.00|
+|Maximum |31.00|
++---------------+-----+
EOF
if [ $? -ne 0 ] ; then fail ; fi
perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list
diff -b $TEMPDIR/pspp.list - << EOF
1.1 EXAMINE. Case Processing Summary
-#==#===============================#
-# # Cases #
-# #----------+---------+----------#
-# # Valid | Missing | Total #
-# #--+-------+-+-------+--+-------#
-# # N|Percent|N|Percent| N|Percent#
-#==#==#=======#=#=======#==#=======#
-#V1#23| 100%|0| 0%|23| 100%#
-#==#==#=======#=#=======#==#=======#
+#==#=======================================#
+# # Cases #
+# #-------------+-----------+-------------#
+# # Valid | Missing | Total #
+# #-----+-------+---+-------+-----+-------#
+# # N |Percent| N |Percent| N |Percent#
+#==#=====#=======#===#=======#=====#=======#
+#V1#23.00| 100%|.00| 0%|23.00| 100%#
+#==#=====#=======#===#=======#=====#=======#
1.2 EXAMINE. Extreme Values
-#============#===========#=====#
-# #Case Number|Value#
-#============#===========#=====#
-#V1 Highest 1# 21|20.00#
-# 2# 20|19.00#
-# 3# 19|18.00#
-# 4# 19|18.00#
-# 5# 18|17.00#
-# 6# 17|16.00#
-# ----------#-----------+-----#
-# Lowest 1# 1| 1.00#
-# 2# 2| 2.00#
-# 3# 4| 3.00#
-# 4# 3| 3.00#
-# 5# 3| 3.00#
-# 6# 5| 4.00#
-#============#===========#=====#
+#============#===========#========#
+# #Case Number| Value #
+#============#===========#========#
+#V1 Highest 1# 21| 20.00#
+# 2# 20| 19.00#
+# 3# 19| 18.00#
+# 4# 19| 18.00#
+# 5# 18| 17.00#
+# 6# 17| 16.00#
+# ----------#-----------+--------#
+# Lowest 1# 1| 1.00#
+# 2# 2| 2.00#
+# 3# 4| 3.00#
+# 4# 3| 3.00#
+# 5# 3| 3.00#
+# 6# 5| 4.00#
+#============#===========#========#
EOF
if [ $? -ne 0 ] ; then fail ; fi
+--------+------+
Case# QUALITY W BRAND
----- -------- -------- --------
- 1 3.00 1.00 1.00
- 2 2.00 2.00 1.00
- 3 1.00 2.00 1.00
- 4 1.00 1.00 1.00
- 5 4.00 1.00 1.00
- 6 4.00 1.00 1.00
- 7 5.00 1.00 2.00
- 8 2.00 1.00 2.00
- 9 4.00 4.00 2.00
- 10 2.00 1.00 2.00
- 11 3.00 1.00 2.00
- 12 7.00 1.00 3.00
- 13 4.00 2.00 3.00
- 14 5.00 3.00 3.00
- 15 3.00 1.00 3.00
- 16 6.00 1.00 3.00
+ 1 3.00 1.00 1.00
+ 2 2.00 2.00 1.00
+ 3 1.00 2.00 1.00
+ 4 1.00 1.00 1.00
+ 5 4.00 1.00 1.00
+ 6 4.00 1.00 1.00
+ 7 5.00 1.00 2.00
+ 8 2.00 1.00 2.00
+ 9 4.00 4.00 2.00
+ 10 2.00 1.00 2.00
+ 11 3.00 1.00 2.00
+ 12 7.00 1.00 3.00
+ 13 4.00 2.00 3.00
+ 14 5.00 3.00 3.00
+ 15 3.00 1.00 3.00
+ 16 6.00 1.00 3.00
2.1 EXAMINE. Case Processing Summary
-#===============#===============================#
-# # Cases #
-# #----------+---------+----------#
-# # Valid | Missing | Total #
-# #--+-------+-+-------+--+-------#
-# # N|Percent|N|Percent| N|Percent#
-#===============#==#=======#=#=======#==#=======#
-#Breaking Strain#24| 100%|0| 0%|24| 100%#
-#===============#==#=======#=#=======#==#=======#
+#===============#=======================================#
+# # Cases #
+# #-------------+-----------+-------------#
+# # Valid | Missing | Total #
+# #-----+-------+---+-------+-----+-------#
+# # N |Percent| N |Percent| N |Percent#
+#===============#=====#=======#===#=======#=====#=======#
+#Breaking Strain#24.00| 100%|.00| 0%|24.00| 100%#
+#===============#=====#=======#===#=======#=====#=======#
2.2 EXAMINE. Extreme Values
-#=========================#===========#=====#
-# #Case Number|Value#
-#=========================#===========#=====#
-#Breaking Strain Highest 1# 12| 7.00#
-# 2# 16| 6.00#
-# 3# 14| 5.00#
-# ----------#-----------+-----#
-# Lowest 1# 4| 1.00#
-# 2# 3| 1.00#
-# 3# 3| 1.00#
-#=========================#===========#=====#
+#=========================#===========#========#
+# #Case Number| Value #
+#=========================#===========#========#
+#Breaking Strain Highest 1# 12| 7.00#
+# 2# 16| 6.00#
+# 3# 14| 5.00#
+# ----------#-----------+--------#
+# Lowest 1# 4| 1.00#
+# 2# 3| 1.00#
+# 3# 3| 1.00#
+#=========================#===========#========#
2.3 EXAMINE. Descriptives
#============================================================#=========#==========#
# #Statistic|Std. Error#
#============================================================#=========#==========#
-#Breaking Strain Mean # 3.54 | .324 #
-# 95% Confidence Interval for Mean Lower Bound# 2.871 | #
-# Upper Bound# 4.212 | #
+#Breaking Strain Mean # 3.54 | .32 #
+# 95% Confidence Interval for Mean Lower Bound# 2.87 | #
+# Upper Bound# 4.21 | #
# 5% Trimmed Mean # 3.50 | #
# Median # 4.00 | #
-# Variance # 2.520 | #
-# Std. Deviation # 1.587 | #
-# Minimum # 1.000 | #
-# Maximum # 7.000 | #
-# Range # 6.000 | #
+# Variance # 2.52 | #
+# Std. Deviation # 1.59 | #
+# Minimum # 1.00 | #
+# Maximum # 7.00 | #
+# Range # 6.00 | #
# Interquartile Range # 2.75 | #
-# Skewness # .059 | .472 #
-# Kurtosis # -.358 | .918 #
+# Skewness # .06 | .47 #
+# Kurtosis # -.36 | .92 #
#============================================================#=========#==========#
2.4 EXAMINE. Case Processing Summary
-#============================#=============================#
-# # Cases #
-# #---------+---------+---------#
-# # Valid | Missing | Total #
-# #-+-------+-+-------+-+-------#
-# Manufacturer#N|Percent|N|Percent|N|Percent#
-#============================#=#=======#=#=======#=#=======#
-#Breaking Strain Aspeger #8| 100%|0| 0%|8| 100%#
-# Bloggs #8| 100%|0| 0%|8| 100%#
-# Charlies #8| 100%|0| 0%|8| 100%#
-#============================#=#=======#=#=======#=#=======#
+#============================#=====================================#
+# # Cases #
+# #------------+-----------+------------#
+# # Valid | Missing | Total #
+# #----+-------+---+-------+----+-------#
+# Manufacturer# N |Percent| N |Percent| N |Percent#
+#============================#====#=======#===#=======#====#=======#
+#Breaking Strain Aspeger #8.00| 100%|.00| 0%|8.00| 100%#
+# Bloggs #8.00| 100%|.00| 0%|8.00| 100%#
+# Charlies #8.00| 100%|.00| 0%|8.00| 100%#
+#============================#====#=======#===#=======#====#=======#
2.5 EXAMINE. Extreme Values
-#======================================#===========#=====#
-# Manufacturer #Case Number|Value#
-#======================================#===========#=====#
-#Breaking Strain Aspeger Highest 1# 6| 4.00#
-# 2# 5| 4.00#
-# 3# 1| 3.00#
-# ----------#-----------+-----#
-# Lowest 1# 4| 1.00#
-# 2# 3| 1.00#
-# 3# 3| 1.00#
-# -----------------------#-----------+-----#
-# Bloggs Highest 1# 7| 5.00#
-# 2# 9| 4.00#
-# 3# 9| 4.00#
-# ----------#-----------+-----#
-# Lowest 1# 10| 2.00#
-# 2# 8| 2.00#
-# 3# 11| 3.00#
-# -----------------------#-----------+-----#
-# Charlies Highest 1# 12| 7.00#
-# 2# 16| 6.00#
-# 3# 14| 5.00#
-# ----------#-----------+-----#
-# Lowest 1# 15| 3.00#
-# 2# 13| 4.00#
-# 3# 13| 4.00#
-#======================================#===========#=====#
+#======================================#===========#========#
+# Manufacturer #Case Number| Value #
+#======================================#===========#========#
+#Breaking Strain Aspeger Highest 1# 6| 4.00#
+# 2# 5| 4.00#
+# 3# 1| 3.00#
+# ----------#-----------+--------#
+# Lowest 1# 4| 1.00#
+# 2# 3| 1.00#
+# 3# 3| 1.00#
+# -----------------------#-----------+--------#
+# Bloggs Highest 1# 7| 5.00#
+# 2# 9| 4.00#
+# 3# 9| 4.00#
+# ----------#-----------+--------#
+# Lowest 1# 10| 2.00#
+# 2# 8| 2.00#
+# 3# 11| 3.00#
+# -----------------------#-----------+--------#
+# Charlies Highest 1# 12| 7.00#
+# 2# 16| 6.00#
+# 3# 14| 5.00#
+# ----------#-----------+--------#
+# Lowest 1# 15| 3.00#
+# 2# 13| 4.00#
+# 3# 13| 4.00#
+#======================================#===========#========#
2.6 EXAMINE. Descriptives
#=========================================================================#=========#==========#
-# Manufacturer #Statistic|Std. Error#
+# Manufacturer #Statistic|Std. Error#
#=========================================================================#=========#==========#
-#Breaking Strain Aspeger Mean # 2.25 | .453 #
-# 95% Confidence Interval for Mean Lower Bound# 1.178 | #
-# Upper Bound# 3.322 | #
+#Breaking Strain Aspeger Mean # 2.25 | .45 #
+# 95% Confidence Interval for Mean Lower Bound# 1.18 | #
+# Upper Bound# 3.32 | #
# 5% Trimmed Mean # 2.22 | #
# Median # 2.00 | #
-# Variance # 1.643 | #
-# Std. Deviation # 1.282 | #
-# Minimum # 1.000 | #
-# Maximum # 4.000 | #
-# Range # 3.000 | #
+# Variance # 1.64 | #
+# Std. Deviation # 1.28 | #
+# Minimum # 1.00 | #
+# Maximum # 4.00 | #
+# Range # 3.00 | #
# Interquartile Range # 2.75 | #
-# Skewness # .475 | .752 #
-# Kurtosis # -1.546 | 1.481 #
+# Skewness # .47 | .75 #
+# Kurtosis # -1.55 | 1.48 #
# ----------------------------------------------------------#---------+----------#
-# Bloggs Mean # 3.50 | .378 #
-# 95% Confidence Interval for Mean Lower Bound# 2.606 | #
-# Upper Bound# 4.394 | #
+# Bloggs Mean # 3.50 | .38 #
+# 95% Confidence Interval for Mean Lower Bound# 2.61 | #
+# Upper Bound# 4.39 | #
# 5% Trimmed Mean # 3.50 | #
# Median # 4.00 | #
-# Variance # 1.143 | #
-# Std. Deviation # 1.069 | #
-# Minimum # 2.000 | #
-# Maximum # 5.000 | #
-# Range # 3.000 | #
+# Variance # 1.14 | #
+# Std. Deviation # 1.07 | #
+# Minimum # 2.00 | #
+# Maximum # 5.00 | #
+# Range # 3.00 | #
# Interquartile Range # 1.75 | #
-# Skewness # -.468 | .752 #
-# Kurtosis # -.831 | 1.481 #
+# Skewness # -.47 | .75 #
+# Kurtosis # -.83 | 1.48 #
# ----------------------------------------------------------#---------+----------#
-# Charlies Mean # 4.88 | .441 #
-# 95% Confidence Interval for Mean Lower Bound# 3.833 | #
-# Upper Bound# 5.917 | #
+# Charlies Mean # 4.88 | .44 #
+# 95% Confidence Interval for Mean Lower Bound# 3.83 | #
+# Upper Bound# 5.92 | #
# 5% Trimmed Mean # 4.86 | #
# Median # 5.00 | #
-# Variance # 1.554 | #
-# Std. Deviation # 1.246 | #
-# Minimum # 3.000 | #
-# Maximum # 7.000 | #
-# Range # 4.000 | #
+# Variance # 1.55 | #
+# Std. Deviation # 1.25 | #
+# Minimum # 3.00 | #
+# Maximum # 7.00 | #
+# Range # 4.00 | #
# Interquartile Range # 1.75 | #
-# Skewness # .304 | .752 #
-# Kurtosis # .146 | 1.481 #
+# Skewness # .30 | .75 #
+# Kurtosis # .15 | 1.48 #
#=========================================================================#=========#==========#
EOF
if [ $? -ne 0 ] ; then fail ; fi
WEIGHT BY w.
+SET FORMAT F8.3.
+
NPAR TESTS
/BINOMIAL(0.3) = x
.
NEW FILE.
-DATA LIST LIST NOTABLE /x * w *.
+
+
+DATA LIST LIST NOTABLE /x (F8.0) w (F8.0).
BEGIN DATA.
1 7
2 6
NEW FILE.
-DATA LIST LIST NOTABLE /x * w *.
+DATA LIST LIST NOTABLE /x (F8.0) w (F8.0).
BEGIN DATA.
1 8
2 8
NEW FILE.
-DATA LIST LIST NOTABLE /x * w *.
+DATA LIST LIST NOTABLE /x (F8.0) w (F8.0).
BEGIN DATA.
1 11
2 12
NEW FILE.
-DATA LIST LIST NOTABLE /x * w *.
+DATA LIST LIST NOTABLE /x (F8.0) w (F8.0).
BEGIN DATA.
1 11
2 9
NEW FILE.
-DATA LIST LIST NOTABLE /x * w *.
+DATA LIST LIST NOTABLE /x (F8.0) w (F8.0).
BEGIN DATA.
1 11
2 11
NEW FILE.
-DATA LIST LIST NOTABLE /x * w *.
+DATA LIST LIST NOTABLE /x (F8.0) w (F8.0).
BEGIN DATA.
1 8
2 15
NEW FILE.
-DATA LIST LIST NOTABLE /x * w *.
+DATA LIST LIST NOTABLE /x (F8.0) w (F8.0).
BEGIN DATA.
1 12
2 6
NEW FILE.
-DATA LIST LIST NOTABLE /x * w *.
+DATA LIST LIST NOTABLE /x (F8.0) w (F8.0).
BEGIN DATA.
1 10
2 10
diff -b $TEMPDIR/pspp.list - << EOF
P < 0.5; N1/N2 < 1
1.1 NPAR TESTS. Binomial Test
-+-+------#--------+--+--------------+----------+---------------------+
-| | #Category| N|Observed Prop.|Test Prop.|Exact Sig. (1-tailed)|
-+-+------#--------+--+--------------+----------+---------------------+
-|x|Group1# 1.00| 6| .286| .300| .551|
-| |Group2# 2.00|15| .714| | |
-| |Total # |21| 1.00| | |
-+-+------#--------+--+--------------+----------+---------------------+
++-+------#--------+-----+--------------+----------+---------------------+
+| | #Category| N |Observed Prop.|Test Prop.|Exact Sig. (1-tailed)|
++-+------#--------+-----+--------------+----------+---------------------+
+|x|Group1# 1.00| 6.00| .286| .300| .551|
+| |Group2# 2.00|15.00| .714| | |
+| |Total # |21.00| 1.00| | |
++-+------#--------+-----+--------------+----------+---------------------+
P < 0.5; N1/N2 > 1
2.1 NPAR TESTS. Binomial Test
+-+------#--------+--+--------------+----------+---------------------+
| | #Category| N|Observed Prop.|Test Prop.|Exact Sig. (1-tailed)|
+-+------#--------+--+--------------+----------+---------------------+
-|x|Group1# 1.00| 7| .538| .400| .229|
-| |Group2# 2.00| 6| .462| | |
-| |Total # |13| 1.00| | |
+|x|Group1# 1| 7| .538| .400| .229|
+| |Group2# 2| 6| .462| | |
+| |Total # |13| 1| | |
+-+------#--------+--+--------------+----------+---------------------+
P < 0.5; N1/N2 = 1
3.1 NPAR TESTS. Binomial Test
+-+------#--------+--+--------------+----------+---------------------+
| | #Category| N|Observed Prop.|Test Prop.|Exact Sig. (1-tailed)|
+-+------#--------+--+--------------+----------+---------------------+
-|x|Group1# 1.00| 8| .500| .400| .284|
-| |Group2# 2.00| 8| .500| | |
-| |Total # |16| 1.00| | |
+|x|Group1# 1| 8| .500| .400| .284|
+| |Group2# 2| 8| .500| | |
+| |Total # |16| 1| | |
+-+------#--------+--+--------------+----------+---------------------+
P > 0.5; N1/N2 < 1
4.1 NPAR TESTS. Binomial Test
+-+------#--------+--+--------------+----------+---------------------+
| | #Category| N|Observed Prop.|Test Prop.|Exact Sig. (1-tailed)|
+-+------#--------+--+--------------+----------+---------------------+
-|x|Group1# 1.00|11| .478| .600| .164|
-| |Group2# 2.00|12| .522| | |
-| |Total # |23| 1.00| | |
+|x|Group1# 1|11| .478| .600| .164|
+| |Group2# 2|12| .522| | |
+| |Total # |23| 1| | |
+-+------#--------+--+--------------+----------+---------------------+
P > 0.5; N1/N2 > 1
5.1 NPAR TESTS. Binomial Test
+-+------#--------+--+--------------+----------+---------------------+
| | #Category| N|Observed Prop.|Test Prop.|Exact Sig. (1-tailed)|
+-+------#--------+--+--------------+----------+---------------------+
-|x|Group1# 1.00|11| .550| .600| .404|
-| |Group2# 2.00| 9| .450| | |
-| |Total # |20| 1.00| | |
+|x|Group1# 1|11| .550| .600| .404|
+| |Group2# 2| 9| .450| | |
+| |Total # |20| 1| | |
+-+------#--------+--+--------------+----------+---------------------+
P > 0.5; N1/N2 == 1
6.1 NPAR TESTS. Binomial Test
+-+------#--------+--+--------------+----------+---------------------+
| | #Category| N|Observed Prop.|Test Prop.|Exact Sig. (1-tailed)|
+-+------#--------+--+--------------+----------+---------------------+
-|x|Group1# 1.00|11| .500| .600| .228|
-| |Group2# 2.00|11| .500| | |
-| |Total # |22| 1.00| | |
+|x|Group1# 1|11| .500| .600| .228|
+| |Group2# 2|11| .500| | |
+| |Total # |22| 1| | |
+-+------#--------+--+--------------+----------+---------------------+
P == 0.5; N1/N2 < 1
7.1 NPAR TESTS. Binomial Test
+-+------#--------+--+--------------+----------+---------------------+
| | #Category| N|Observed Prop.|Test Prop.|Exact Sig. (2-tailed)|
+-+------#--------+--+--------------+----------+---------------------+
-|x|Group1# 1.00| 8| .348| .500| .210|
-| |Group2# 2.00|15| .652| | |
-| |Total # |23| 1.00| | |
+|x|Group1# 1| 8| .348| .500| .210|
+| |Group2# 2|15| .652| | |
+| |Total # |23| 1| | |
+-+------#--------+--+--------------+----------+---------------------+
P == 0.5; N1/N2 > 1
8.1 NPAR TESTS. Binomial Test
+-+------#--------+--+--------------+----------+---------------------+
| | #Category| N|Observed Prop.|Test Prop.|Exact Sig. (2-tailed)|
+-+------#--------+--+--------------+----------+---------------------+
-|x|Group1# 1.00|12| .667| .500| .238|
-| |Group2# 2.00| 6| .333| | |
-| |Total # |18| 1.00| | |
+|x|Group1# 1|12| .667| .500| .238|
+| |Group2# 2| 6| .333| | |
+| |Total # |18| 1| | |
+-+------#--------+--+--------------+----------+---------------------+
P == 0.5; N1/N2 == 1
9.1 NPAR TESTS. Binomial Test
+-+------#--------+--+--------------+----------+---------------------+
| | #Category| N|Observed Prop.|Test Prop.|Exact Sig. (2-tailed)|
+-+------#--------+--+--------------+----------+---------------------+
-|x|Group1# 1.00|10| .500| .500| 1.000|
-| |Group2# 2.00|10| .500| | |
-| |Total # |20| 1.00| | |
+|x|Group1# 1|10| .500| .500| 1.000|
+| |Group2# 2|10| .500| | |
+| |Total # |20| 1| | |
+-+------#--------+--+--------------+----------+---------------------+
EOF
if [ $? -ne 0 ] ; then fail ; fi
+--------#----------+----------+--------+
| #Observed N|Expected N|Residual|
+--------#----------+----------+--------+
-| 1.00# 3| 2.33| .67|
-| 2.00# 3| 2.33| .67|
-| 3.10# 4| 2.33| 1.67|
-| 3.20# 1| 2.33| -1.33|
-| 4.00# 2| 2.33| -.33|
-| 5.00# 1| 2.33| -1.33|
-|Total # 14| | |
+| 1.00# 3.00| 2.33| .67|
+| 2.00# 3.00| 2.33| .67|
+| 3.10# 4.00| 2.33| 1.67|
+| 3.20# 1.00| 2.33| -1.33|
+| 4.00# 2.00| 2.33| -.33|
+| 5.00# 1.00| 2.33| -1.33|
+|Total # 14.00| | |
+--------#----------+----------+--------+
1.2 NPAR TESTS. y
+--------#----------+----------+--------+
| #Observed N|Expected N|Residual|
+--------#----------+----------+--------+
-| 1.00# 7| 3.50| 3.50|
-| 2.00# 4| 3.50| .50|
-| 3.00# 1| 3.50| -2.50|
-| 4.00# 2| 3.50| -1.50|
-|Total # 14| | |
+| 1.00# 7.00| 3.50| 3.50|
+| 2.00# 4.00| 3.50| .50|
+| 3.00# 1.00| 3.50| -2.50|
+| 4.00# 2.00| 3.50| -1.50|
+|Total # 14.00| | |
+--------#----------+----------+--------+
1.3 NPAR TESTS. Test Statistics
-+-----------#-----+-----+
-| # x | y |
-+-----------#-----+-----+
-|Chi-Square #3.143|6.000|
-|df # 5| 3|
-|Asymp. Sig.# .678| .112|
-+-----------#-----+-----+
++-----------#----+----+
+| # x | y |
++-----------#----+----+
+|Chi-Square #3.14|6.00|
+|df # 5| 3|
+|Asymp. Sig.# .68| .11|
++-----------#----+----+
2.1 NPAR TESTS. y
+--------#----------+----------+--------+
| #Observed N|Expected N|Residual|
+--------#----------+----------+--------+
-| 1.00# 7| 2.63| 4.38|
-| 2.00# 4| 3.50| .50|
-| 3.00# 1| 4.38| -3.38|
-| 4.00# 2| 3.50| -1.50|
-|Total # 14| | |
+| 1.00# 7.00| 2.63| 4.38|
+| 2.00# 4.00| 3.50| .50|
+| 3.00# 1.00| 4.38| -3.38|
+| 4.00# 2.00| 3.50| -1.50|
+|Total # 14.00| | |
+--------#----------+----------+--------+
2.2 NPAR TESTS. Test Statistics
-+-----------#------+
-| # y |
-+-----------#------+
-|Chi-Square #10.610|
-|df # 3|
-|Asymp. Sig.# .014|
-+-----------#------+
++-----------#-----+
+| # y |
++-----------#-----+
+|Chi-Square #10.61|
+|df # 3|
+|Asymp. Sig.# .01|
++-----------#-----+
3.1 NPAR TESTS. Frequencies
+-----#---------------------------------------#---------------------------------------+
| # x # y |
| #--------+----------+----------+--------#--------+----------+----------+--------+
| #Category|Observed N|Expected N|Residual#Category|Observed N|Expected N|Residual|
+-----#--------+----------+----------+--------#--------+----------+----------+--------+
-|1 # 2.00| 3| 3.16| -.16# 2.00| 4| 2.21| 1.79|
-|2 # 3.00| 5| 5.26| -.26# 3.00| 1| 3.68| -2.68|
-|3 # 4.00| 2| 1.58| .42# 4.00| 2| 1.11| .89|
-|Total# | 10| | # | 7| | |
+|1 # 2.00| 3.00| 3.16| -.16# 2.00| 4.00| 2.21| 1.79|
+|2 # 3.00| 5.00| 5.26| -.26# 3.00| 1.00| 3.68| -2.68|
+|3 # 4.00| 2.00| 1.58| .42# 4.00| 2.00| 1.11| .89|
+|Total# | 10.00| | # | 7.00| | |
+-----#--------+----------+----------+--------#--------+----------+----------+--------+
3.2 NPAR TESTS. Test Statistics
-+-----------#----+-----+
-| # x | y |
-+-----------#----+-----+
-|Chi-Square #.133|4.129|
-|df # 2| 2|
-|Asymp. Sig.#.936| .127|
-+-----------#----+-----+
++-----------#---+----+
+| # x | y |
++-----------#---+----+
+|Chi-Square #.13|4.13|
+|df # 2| 2|
+|Asymp. Sig.#.94| .13|
++-----------#---+----+
EOF
if [ $? -ne 0 ] ; then fail ; fi
| #--------+----------+----------+--------#--------+----------+----------+--------+
| #Category|Observed N|Expected N|Residual#Category|Observed N|Expected N|Residual|
+-----#--------+----------+----------+--------#--------+----------+----------+--------+
-|1 # -2.00| 0| 1.50| -1.50# -2.00| 0| 1.88| -1.88|
-|2 # -1.00| 0| 1.50| -1.50# -1.00| 0| 1.88| -1.88|
-|3 # .00| 0| 1.50| -1.50# .00| 0| 1.88| -1.88|
-|4 # 1.00| 3| 1.50| 1.50# 1.00| 7| 1.88| 5.13|
-|5 # 2.00| 3| 1.50| 1.50# 2.00| 4| 1.88| 2.13|
-|6 # 3.00| 5| 1.50| 3.50# 3.00| 1| 1.88| -.88|
-|7 # 4.00| 0| 1.50| -1.50# 4.00| 2| 1.88| .13|
-|8 # 5.00| 1| 1.50| -.50# 5.00| 1| 1.88| -.88|
-|Total# | 12| | # | 15| | |
+|1 # -2.00| .00| 1.50| -1.50# -2.00| .00| 1.88| -1.88|
+|2 # -1.00| .00| 1.50| -1.50# -1.00| .00| 1.88| -1.88|
+|3 # .00| .00| 1.50| -1.50# .00| .00| 1.88| -1.88|
+|4 # 1.00| 3.00| 1.50| 1.50# 1.00| 7.00| 1.88| 5.13|
+|5 # 2.00| 3.00| 1.50| 1.50# 2.00| 4.00| 1.88| 2.13|
+|6 # 3.00| 5.00| 1.50| 3.50# 3.00| 1.00| 1.88| -.88|
+|7 # 4.00| .00| 1.50| -1.50# 4.00| 2.00| 1.88| .13|
+|8 # 5.00| 1.00| 1.50| -.50# 5.00| 1.00| 1.88| -.88|
+|Total# | 12.00| | # | 15.00| | |
+-----#--------+----------+----------+--------#--------+----------+----------+--------+
1.2 NPAR TESTS. Test Statistics
-+-----------#------+------+
-| # x | y |
-+-----------#------+------+
-|Chi-Square #17.333|22.867|
-|df # 7| 7|
-|Asymp. Sig.# .015| .002|
-+-----------#------+------+
++-----------#-----+-----+
+| # x | y |
++-----------#-----+-----+
+|Chi-Square #17.33|22.87|
+|df # 7| 7|
+|Asymp. Sig.# .02| .00|
++-----------#-----+-----+
1.3 NPAR TESTS. Descriptive Statistics
-+-#--+-----+-----+-----+-----+
-| # N| Mean| Std.|Minim|Maxim|
-| # | |Devia| um | um |
-#=#==#=====#=====#=====#=====#
-|x#12|2.467|1.193|1.000|5.000|
-|y#15|2.067|1.335|1.000|5.000|
-+-#--+-----+-----+-----+-----+
++-#-----+----+----+----+----+
+| # N |Mean|Std.|Mini|Maxi|
+| # | |Devi| mum| mum|
+#=#=====#====#====#====#====#
+|x#12.00|2.47|1.19|1.00|5.00|
+|y#15.00|2.07|1.33|1.00|5.00|
++-#-----+----+----+----+----+
EOF
if [ $? -ne 0 ] ; then fail ; fi
| #--------+----------+----------+--------#--------+----------+----------+--------+
| #Category|Observed N|Expected N|Residual#Category|Observed N|Expected N|Residual|
+-----#--------+----------+----------+--------#--------+----------+----------+--------+
-|1 # -2.00| 0| 1.75| -1.75# -2.00| 0| 1.75| -1.75|
-|2 # -1.00| 0| 1.75| -1.75# -1.00| 0| 1.75| -1.75|
-|3 # .00| 0| 1.75| -1.75# .00| 0| 1.75| -1.75|
-|4 # 1.00| 3| 1.75| 1.25# 1.00| 7| 1.75| 5.25|
-|5 # 2.00| 3| 1.75| 1.25# 2.00| 4| 1.75| 2.25|
-|6 # 3.00| 5| 1.75| 3.25# 3.00| 1| 1.75| -.75|
-|7 # 4.00| 2| 1.75| .25# 4.00| 2| 1.75| .25|
-|8 # 5.00| 1| 1.75| -.75# 5.00| 0| 1.75| -1.75|
-|Total# | 14| | # | 14| | |
+|1 # -2.00| .00| 1.75| -1.75# -2.00| .00| 1.75| -1.75|
+|2 # -1.00| .00| 1.75| -1.75# -1.00| .00| 1.75| -1.75|
+|3 # .00| .00| 1.75| -1.75# .00| .00| 1.75| -1.75|
+|4 # 1.00| 3.00| 1.75| 1.25# 1.00| 7.00| 1.75| 5.25|
+|5 # 2.00| 3.00| 1.75| 1.25# 2.00| 4.00| 1.75| 2.25|
+|6 # 3.00| 5.00| 1.75| 3.25# 3.00| 1.00| 1.75| -.75|
+|7 # 4.00| 2.00| 1.75| .25# 4.00| 2.00| 1.75| .25|
+|8 # 5.00| 1.00| 1.75| -.75# 5.00| .00| 1.75| -1.75|
+|Total# | 14.00| | # | 14.00| | |
+-----#--------+----------+----------+--------#--------+----------+----------+--------+
1.2 NPAR TESTS. Test Statistics
-+-----------#------+------+
-| # x | y |
-+-----------#------+------+
-|Chi-Square #13.429|26.000|
-|df # 7| 7|
-|Asymp. Sig.# .062| .001|
-+-----------#------+------+
++-----------#-----+-----+
+| # x | y |
++-----------#-----+-----+
+|Chi-Square #13.43|26.00|
+|df # 7| 7|
+|Asymp. Sig.# .06| .00|
++-----------#-----+-----+
1.3 NPAR TESTS. Descriptive Statistics
-+-#--+-----+-----+-----+-----+
-| # N| Mean| Std.|Minim|Maxim|
-| # | |Devia| um | um |
-#=#==#=====#=====#=====#=====#
-|x#14|2.686|1.231|1.000|5.000|
-|y#14|1.857|1.099|1.000|4.000|
-+-#--+-----+-----+-----+-----+
++-#-----+----+----+----+----+
+| # N |Mean|Std.|Mini|Maxi|
+| # | |Devi| mum| mum|
+#=#=====#====#====#====#====#
+|x#14.00|2.69|1.23|1.00|5.00|
+|y#14.00|1.86|1.10|1.00|4.00|
++-#-----+----+----+----+----+
EOF
if [ $? -ne 0 ] ; then fail ; fi
#===============#================#===#===#============#
# #Levene Statistic|df1|df2|Significance#
#===============#================#===#===#============#
-#Breaking Strain# .092| 2| 12| .913#
+#Breaking Strain# .09| 2| 12| .91#
#===============#================#===#===#============#
2.3 ONEWAY. ANOVA
-#==============================#==============#==#===========#=====#============#
-# #Sum of Squares|df|Mean Square| F |Significance#
-#===============#==============#==============#==#===========#=====#============#
-#Breaking Strain|Between Groups# 20.13| 2| 10.067|5.119| .025#
-# |Within Groups # 23.60|12| 1.967| | #
-# |Total # 43.73|14| | | #
-#===============#==============#==============#==#===========#=====#============#
+#==============================#==============#==#===========#====#============#
+# #Sum of Squares|df|Mean Square| F |Significance#
+#===============#==============#==============#==#===========#====#============#
+#Breaking Strain|Between Groups# 20.13| 2| 10.07|5.12| .02#
+# |Within Groups # 23.60|12| 1.97| | #
+# |Total # 43.73|14| | | #
+#===============#==============#==============#==#===========#====#============#
2.4 ONEWAY. Contrast Coefficients
#==========#=======================#
# # Manufacturer #
# |2# 0| -1| 1#
#========#=#=======#======#========#
2.5 ONEWAY. Contrast Tests
-#===============================================#=================#==========#=====#=====#===============#
-# Contrast#Value of Contrast|Std. Error| t | df |Sig. (2-tailed)#
-#===============#======================#========#=================#==========#=====#=====#===============#
-#Breaking Strain|Assume equal variances| 1 # 3.80| 1.536|2.474| 12| .029#
-# | | 2 # 1.80| .887|2.029| 12| .065#
-# |Does not assume equal | 1 # 3.80| 1.483|2.562|8.740| .031#
-# | | 2 # 1.80| .917|1.964|7.720| .086#
-#===============#======================#========#=================#==========#=====#=====#===============#
+#===============================================#=================#==========#====#====#===============#
+# Contrast#Value of Contrast|Std. Error| t | df |Sig. (2-tailed)#
+#===============#======================#========#=================#==========#====#====#===============#
+#Breaking Strain|Assume equal variances| 1 # 3.80| 1.54|2.47| 12| .03#
+# | | 2 # 1.80| .89|2.03| 12| .07#
+# |Does not assume equal | 1 # 3.80| 1.48|2.56|8.74| .03#
+# | | 2 # 1.80| .92|1.96|7.72| .09#
+#===============#======================#========#=================#==========#====#====#===============#
EOF
if [ $? -ne 0 ] ; then fail ; fi
# |.05# .00| .00| 8.11#
#========#===#========#=================#==========================#
2.2 REGRESSION. ANOVA
-#===================#==============#====#===========#=====#============#
-# #Sum of Squares| df |Mean Square| F |Significance#
-#========#==========#==============#====#===========#=====#============#
-# |Regression# 235.23| 1| 235.232|3.580| .059#
-# |Residual # 98438.40|1498| 65.713| | #
-# |Total # 98673.63|1499| | | #
-#========#==========#==============#====#===========#=====#============#
+#===================#==============#====#===========#====#============#
+# #Sum of Squares| df |Mean Square| F |Significance#
+#========#==========#==============#====#===========#====#============#
+# |Regression# 235.23| 1| 235.23|3.58| .06#
+# |Residual # 98438.40|1498| 65.71| | #
+# |Total # 98673.63|1499| | | #
+#========#==========#==============#====#===========#====#============#
2.3 REGRESSION. Coefficients
#===================#====#==========#====#====#============#
# # B |Std. Error|Beta| t |Significance#
# |.97# .94| .93| 1.34#
#========#===#========#=================#==========================#
2.2 REGRESSION. ANOVA
-#===================#==============#==#===========#======#============#
-# #Sum of Squares|df|Mean Square| F |Significance#
-#========#==========#==============#==#===========#======#============#
-# |Regression# 202.75| 2| 101.376|56.754| .000#
-# |Residual # 12.50| 7| 1.786| | #
-# |Total # 215.26| 9| | | #
-#========#==========#==============#==#===========#======#============#
+#===================#==============#==#===========#=====#============#
+# #Sum of Squares|df|Mean Square| F |Significance#
+#========#==========#==============#==#===========#=====#============#
+# |Regression# 202.75| 2| 101.38|56.75| .00#
+# |Residual # 12.50| 7| 1.79| | #
+# |Total # 215.26| 9| | | #
+#========#==========#==============#==#===========#=====#============#
2.3 REGRESSION. Coefficients
#===================#=====#==========#=====#======#============#
# # B |Std. Error| Beta| t |Significance#
#===========#==#====#==============#========#
# INDEP | N|Mean|Std. Deviation|SE. Mean#
#===========#==#====#==============#========#
-#DEP >=1.514|11|9.00| 3.821| 1.152#
-# <1.514 |11|8.00| 2.864| .863#
+#DEP >=1.514|11|9.00| 3.82| 1.15#
+# <1.514 |11|8.00| 2.86| .86#
#===========#==#====#==============#========#
2.2 T-TEST. Independent Samples Test
-#==============================#=========#===============================================================================#
-# # Levene's| t-test for Equality of Means #
-# #----+----+-----+------+---------------+---------------+---------------------+------------#
-# # | | | | | | | 95% #
-# # | | | | | | +------+-----#
-# # F |Sig.| t | df |Sig. (2-tailed)|Mean Difference|Std. Error Difference| Lower|Upper#
-#==============================#====#====#=====#======#===============#===============#=====================#======#=====#
-#DEPEqual variances assumed #.172|.683|-.695| 20| .495| -1.000| 1.440|-4.003|2.003#
-# Equal variances not assumed# | |-.695|18.539| .496| -1.000| 1.440|-4.018|2.018#
-#==============================#====#====#=====#======#===============#===============#=====================#======#=====#
+#==============================#========#============================================================================#
+# #Levene's| t-test for Equality of Means #
+# #---+----+----+-----+---------------+---------------+---------------------+-----------#
+# # | | | | | | | 95% #
+# # | | | | | | +-----+-----#
+# # F |Sig.| t | df |Sig. (2-tailed)|Mean Difference|Std. Error Difference|Lower|Upper#
+#==============================#===#====#====#=====#===============#===============#=====================#=====#=====#
+#DEPEqual variances assumed #.17| .68|-.69|20.00| .50| -1.00| 1.44|-4.00| 2.00#
+# Equal variances not assumed# | |-.69|18.54| .50| -1.00| 1.44|-4.02| 2.02#
+#==============================#===#====#====#=====#===============#===============#=====================#=====#=====#
EOF
if [ $? -ne 0 ] ; then fail ; fi
#===#=#====#==============#========#
# #N|Mean|Std. Deviation|SE. Mean#
#===#=#====#==============#========#
-#ABC#6|3.00| .84| .342#
+#ABC#6|3.00| .84| .34#
#===#=#====#==============#========#
2.2 T-TEST. One-Sample Test
-#===#=====================================================#
-# # Test Value = 2.000000 #
-# #-----+--+---------------+---------------+------------#
-# # | | | | 95% #
-# # | | | +-----+------#
-# # t |df|Sig. (2-tailed)|Mean Difference|Lower| Upper#
-#===#=====#==#===============#===============#=====#======#
-#ABC#2.928| 5| .033| 1.000|.1220|1.8780#
-#===#=====#==#===============#===============#=====#======#
+#===#===================================================#
+# # Test Value = 2.000000 #
+# #----+--+---------------+---------------+-----------#
+# # | | | | 95% #
+# # | | | +-----+-----#
+# # t |df|Sig. (2-tailed)|Mean Difference|Lower|Upper#
+#===#====#==#===============#===============#=====#=====#
+#ABC#2.93| 5| .03| 1.00| .12| 1.88#
+#===#====#==#===============#===============#=====#=====#
EOF
if [ $? -ne 0 ] ; then fail ; fi
#========#====#=#==============#========#
# #Mean|N|Std. Deviation|SE. Mean#
#========#====#=#==============#========#
-#Pair 0 A#2.00|5| .707| .316#
-# B#4.00|5| 1.541| .689#
+#Pair 0 A#2.00|5| .71| .32#
+# B#4.00|5| 1.54| .69#
#========#====#=#==============#========#
2.2 T-TEST. Paired Samples Correlations
#======#=====#=#===========#====#
# | #N|Correlation|Sig.#
#======#=====#=#===========#====#
-#Pair 0|A & B#5| .918|.028#
+#Pair 0|A & B#5| .92| .03#
#======#=====#=#===========#====#
2.3 T-TEST. Paired Samples Test
-#===========#=====================================================#======#==#===============#
-# # Paired Differences | | | #
-# #-------+--------------+---------------+--------------+ | | #
-# # | | |95% Confidence| | | #
-# # | | +-------+------+ | | #
-# # Mean |Std. Deviation|Std. Error Mean| Lower | Upper| t |df|Sig. (2-tailed)#
-#===========#=======#==============#===============#=======#======#======#==#===============#
-#Pair 0A - B#-2.0000| .93541| .41833|-3.1615|-.8385|-4.781| 4| .009#
-#===========#=======#==============#===============#=======#======#======#==#===============#
+#===========#================================================#=====#==#===============#
+# # Paired Differences | | | #
+# #-----+--------------+---------------+-----------+ | | #
+# # | | | 95% | | | #
+# # | | +-----+-----+ | | #
+# # Mean|Std. Deviation|Std. Error Mean|Lower|Upper| t |df|Sig. (2-tailed)#
+#===========#=====#==============#===============#=====#=====#=====#==#===============#
+#Pair 0A - B#-2.00| .94| .42|-3.16| -.84|-4.78| 4| .01#
+#===========#=====#==============#===============#=====#=====#=====#==#===============#
EOF
if [ $? -ne 0 ] ; then fail ; fi
|C |F8.0 |
+--------+------+
2.1 EXAMINE. Case Processing Summary
-#=#===============================#
-# # Cases #
-# #----------+---------+----------#
-# # Valid | Missing | Total #
-# #--+-------+-+-------+--+-------#
-# # N|Percent|N|Percent| N|Percent#
-#=#==#=======#=#=======#==#=======#
-#X#52| 100%|0| 0%|52| 100%#
-#=#==#=======#=#=======#==#=======#
+#=#=======================================#
+# # Cases #
+# #-------------+-----------+-------------#
+# # Valid | Missing | Total #
+# #-----+-------+---+-------+-----+-------#
+# # N |Percent| N |Percent| N |Percent#
+#=#=====#=======#===#=======#=====#=======#
+#X#52.00| 100%|.00| 0%|52.00| 100%#
+#=#=====#=======#===#=======#=====#=======#
2.2 EXAMINE. Descriptives
#==============================================#=========#==========#
# #Statistic|Std. Error#
#==============================================#=========#==========#
-#X Mean # 2.02 | .034 #
-# 95% Confidence Interval for Mean Lower Bound# 1.952 | #
-# Upper Bound# 2.087 | #
+#X Mean # 2.02 | .03 #
+# 95% Confidence Interval for Mean Lower Bound# 1.95 | #
+# Upper Bound# 2.09 | #
# 5% Trimmed Mean # 2.00 | #
# Median # 2.00 | #
-# Variance # .058 | #
-# Std. Deviation # .242 | #
-# Minimum # 1.000 | #
-# Maximum # 3.000 | #
-# Range # 2.000 | #
+# Variance # .06 | #
+# Std. Deviation # .24 | #
+# Minimum # 1.00 | #
+# Maximum # 3.00 | #
+# Range # 2.00 | #
# Interquartile Range # .00 | #
-# Skewness # 1.194 | .330 #
-# Kurtosis # 15.732 | .650 #
+# Skewness # 1.19 | .33 #
+# Kurtosis # 15.73 | .65 #
#==============================================#=========#==========#
EOF
if [ $? -ne 0 ] ; then fail ; fi
activity="create program"
cat > $TESTFILE << EOF
+SET FORMAT F8.3.
data list file='$top_srcdir/tests/weighting.data'/AVAR 1-5 BVAR 6-10.
weight by BVAR.
|BVAR | 1| 6- 10|F5.0 |
+--------+------+-------+------+
2.1 DESCRIPTIVES. Valid cases = 730; cases with missing value(s) = 0.
-+--------#-------+---------+------+--------+-------+--------+--------+--------+--------+--------+------+-------+-------+---------+
-|Variable#Valid N|Missing N| Mean |S E Mean|Std Dev|Variance|Kurtosis|S E Kurt|Skewness|S E Skew| Range|Minimum|Maximum| Sum |
-#========#=======#=========#======#========#=======#========#========#========#========#========#======#=======#=======#=========#
-|AVAR # 730| 0|31.515| .405| 10.937| 119.608| 2.411| .181| 1.345| .090|76.000| 18.000| 94.000|23006.000|
-+--------#-------+---------+------+--------+-------+--------+--------+--------+--------+--------+------+-------+-------+---------+
-3.1 FREQUENCIES. AVAR
++--------#-------+---------+------+--------+-------+--------+--------+--------+--------+--------+------+-------+-------+--------+
+|Variable#Valid N|Missing N| Mean |S E Mean|Std Dev|Variance|Kurtosis|S E Kurt|Skewness|S E Skew| Range|Minimum|Maximum| Sum |
+#========#=======#=========#======#========#=======#========#========#========#========#========#======#=======#=======#========#
+|AVAR # 730| 0|31.515| .405| 10.937| 119.608| 2.411| .181| 1.345| .090|76.000| 18.000| 94.000|23006.00|
++--------#-------+---------+------+--------+-------+--------+--------+--------+--------+--------+------+-------+-------+--------+
+3.1 FREQUENCIES. AVAR
+--------+--------+---+---+
| | | |Cum|
| Value | Freq |Pct|Pct|
#========#========#===#===#
-| 18| 1| 0| 0|
-| 19| 7| 1| 1|
-| 20| 26| 4| 5|
-| 21| 76| 10| 15|
-| 22| 57| 8| 23|
-| 23| 58| 8| 31|
-| 24| 38| 5| 36|
-| 25| 38| 5| 41|
-| 26| 30| 4| 45|
-| 27| 21| 3| 48|
-| 28| 23| 3| 51|
-| 29| 24| 3| 55|
-| 30| 23| 3| 58|
-| 31| 14| 2| 60|
-| 32| 21| 3| 63|
-| 33| 21| 3| 65|
-| 34| 14| 2| 67|
-| 35| 14| 2| 69|
-| 36| 17| 2| 72|
-| 37| 11| 2| 73|
-| 38| 16| 2| 75|
-| 39| 14| 2| 77|
-| 40| 15| 2| 79|
-| 41| 14| 2| 81|
-| 42| 14| 2| 83|
-| 43| 8| 1| 84|
-| 44| 15| 2| 86|
-| 45| 10| 1| 88|
-| 46| 12| 2| 89|
-| 47| 13| 2| 91|
-| 48| 13| 2| 93|
-| 49| 5| 1| 94|
-| 50| 5| 1| 94|
-| 51| 3| 0| 95|
-| 52| 7| 1| 96|
-| 53| 6| 1| 96|
-| 54| 2| 0| 97|
-| 55| 2| 0| 97|
-| 56| 2| 0| 97|
-| 57| 3| 0| 98|
-| 58| 1| 0| 98|
-| 59| 3| 0| 98|
-| 61| 1| 0| 98|
-| 62| 3| 0| 99|
-| 63| 1| 0| 99|
-| 64| 1| 0| 99|
-| 65| 2| 0| 99|
-| 70| 1| 0| 99|
-| 78| 1| 0|100|
-| 79| 1| 0|100|
-| 80| 1| 0|100|
-| 94| 1| 0|100|
+| 18| 1|.13|.13|
+| 19| 7|.95|1.0|
+| 20| 26|3.5|4.6|
+| 21| 76|10.|15.|
+| 22| 57|7.8|22.|
+| 23| 58|7.9|30.|
+| 24| 38|5.2|36.|
+| 25| 38|5.2|41.|
+| 26| 30|4.1|45.|
+| 27| 21|2.8|48.|
+| 28| 23|3.1|51.|
+| 29| 24|3.2|54.|
+| 30| 23|3.1|57.|
+| 31| 14|1.9|59.|
+| 32| 21|2.8|62.|
+| 33| 21|2.8|65.|
+| 34| 14|1.9|67.|
+| 35| 14|1.9|69.|
+| 36| 17|2.3|71.|
+| 37| 11|1.5|73.|
+| 38| 16|2.1|75.|
+| 39| 14|1.9|77.|
+| 40| 15|2.0|79.|
+| 41| 14|1.9|81.|
+| 42| 14|1.9|83.|
+| 43| 8|1.0|84.|
+| 44| 15|2.0|86.|
+| 45| 10|1.3|87.|
+| 46| 12|1.6|89.|
+| 47| 13|1.7|91.|
+| 48| 13|1.7|92.|
+| 49| 5|.68|93.|
+| 50| 5|.68|94.|
+| 51| 3|.41|94.|
+| 52| 7|.95|95.|
+| 53| 6|.82|96.|
+| 54| 2|.27|96.|
+| 55| 2|.27|96.|
+| 56| 2|.27|97.|
+| 57| 3|.41|97.|
+| 58| 1|.13|97.|
+| 59| 3|.41|98.|
+| 61| 1|.13|98.|
+| 62| 3|.41|98.|
+| 63| 1|.13|98.|
+| 64| 1|.13|99.|
+| 65| 2|.27|99.|
+| 70| 1|.13|99.|
+| 78| 1|.13|99.|
+| 79| 1|.13|99.|
+| 80| 1|.13|99.|
+| 94| 1|.13|100|
+--------+--------+---+---+
-+-----------------------+---------+
-|N Valid | 730|
-| Missing | 0|
-|Mean | 31.515|
-|S.E. Mean | .405|
-|Mode | 21.000|
-|Std Dev | 10.937|
-|Variance | 119.608|
-|Kurtosis | 2.411|
-|S.E. Kurt | .181|
-|Skewness | 1.345|
-|S.E. Skew | .090|
-|Range | 76.000|
-|Minimum | 18.000|
-|Maximum | 94.000|
-|Sum |23006.000|
-|Percentiles 50 (Median)| 28.500|
-+-----------------------+---------+
++-----------------------+--------+
+|N Valid | 730|
+| Missing | 0|
+|Mean | 31.515|
+|S.E. Mean | .405|
+|Mode | 21.000|
+|Std Dev | 10.937|
+|Variance | 119.608|
+|Kurtosis | 2.411|
+|S.E. Kurt | .181|
+|Skewness | 1.345|
+|S.E. Skew | .090|
+|Range | 76.000|
+|Minimum | 18.000|
+|Maximum | 94.000|
+|Sum |23006.00|
+|Percentiles 50 (Median)| 29|
++-----------------------+--------+
EOF
if [ $? -ne 0 ] ; then fail ; fi
|V16 | 1| 17- 17|F1.0 |
+--------+------+-------+------+
2.1 DESCRIPTIVES. Valid cases = 10; cases with missing value(s) = 0.
-+--------#-------+---------+-----+--------+-------+--------+--------+--------+--------+--------+-----+-------+-------+------+
-|Variable#Valid N|Missing N| Mean|S E Mean|Std Dev|Variance|Kurtosis|S E Kurt|Skewness|S E Skew|Range|Minimum|Maximum| Sum |
-#========#=======#=========#=====#========#=======#========#========#========#========#========#=====#=======#=======#======#
-|V0 # 10| 0|3.800| .841| 2.658| 7.067| -.035| 1.334| .889| .687|8.000| 1.000| 9.000|38.000|
-|V1 # 10| 0|4.600| .957| 3.026| 9.156| -1.386| 1.334| -.032| .687|9.000| .000| 9.000|46.000|
-|V2 # 10| 0|4.100| 1.159| 3.665| 13.433| -2.019| 1.334| .476| .687|8.000| 1.000| 9.000|41.000|
-|V3 # 10| 0|4.100| .875| 2.767| 7.656| -2.049| 1.334| .422| .687|7.000| 1.000| 8.000|41.000|
-|V4 # 10| 0|7.000| .471| 1.491| 2.222| 7.152| 1.334| -2.516| .687|5.000| 3.000| 8.000|70.000|
-|V5 # 10| 0|4.900| 1.027| 3.247| 10.544| -1.401| 1.334| -.205| .687|9.000| .000| 9.000|49.000|
-|V6 # 10| 0|5.900| .795| 2.514| 6.322| -.290| 1.334| -.960| .687|7.000| 1.000| 8.000|59.000|
-|V7 # 10| 0|4.700| 1.096| 3.466| 12.011| -1.993| 1.334| -.165| .687|9.000| .000| 9.000|47.000|
-|V8 # 10| 0|4.100| 1.100| 3.479| 12.100| -1.928| 1.334| .371| .687|9.000| .000| 9.000|41.000|
-|V9 # 10| 0|4.300| .870| 2.751| 7.567| -.875| 1.334| .730| .687|8.000| 1.000| 9.000|43.000|
-|V10 # 10| 0|5.500| .847| 2.677| 7.167| -1.842| 1.334| -.326| .687|7.000| 2.000| 9.000|55.000|
-|V11 # 10| 0|6.500| .778| 2.461| 6.056| -1.276| 1.334| -.895| .687|6.000| 3.000| 9.000|65.000|
-|V12 # 10| 0|7.900| .605| 1.912| 3.656| 5.241| 1.334| -2.208| .687|6.000| 3.000| 9.000|79.000|
-|V13 # 10| 0|4.300| .989| 3.129| 9.789| -1.248| 1.334| .333| .687|9.000| .000| 9.000|43.000|
-|V14 # 10| 0|3.600| 1.013| 3.204| 10.267| -.961| 1.334| .809| .687|9.000| .000| 9.000|36.000|
-|V15 # 10| 0|3.700| .920| 2.908| 8.456| -1.352| 1.334| .710| .687|7.000| 1.000| 8.000|37.000|
-|V16 # 10| 0|6.400| .909| 2.875| 8.267| -1.142| 1.334| -.923| .687|7.000| 2.000| 9.000|64.000|
-+--------#-------+---------+-----+--------+-------+--------+--------+--------+--------+--------+-----+-------+-------+------+
++--------#-------+---------+----+--------+-------+--------+--------+--------+--------+--------+-----+-------+-------+-----+
+|Variable#Valid N|Missing N|Mean|S E Mean|Std Dev|Variance|Kurtosis|S E Kurt|Skewness|S E Skew|Range|Minimum|Maximum| Sum |
+#========#=======#=========#====#========#=======#========#========#========#========#========#=====#=======#=======#=====#
+|V0 # 10| 0|3.80| .84| 2.66| 7.07| -.03| 1.33| .89| .69| 8.00| 1.00| 9.00|38.00|
+|V1 # 10| 0|4.60| .96| 3.03| 9.16| -1.39| 1.33| -.03| .69| 9.00| .00| 9.00|46.00|
+|V2 # 10| 0|4.10| 1.16| 3.67| 13.43| -2.02| 1.33| .48| .69| 8.00| 1.00| 9.00|41.00|
+|V3 # 10| 0|4.10| .87| 2.77| 7.66| -2.05| 1.33| .42| .69| 7.00| 1.00| 8.00|41.00|
+|V4 # 10| 0|7.00| .47| 1.49| 2.22| 7.15| 1.33| -2.52| .69| 5.00| 3.00| 8.00|70.00|
+|V5 # 10| 0|4.90| 1.03| 3.25| 10.54| -1.40| 1.33| -.20| .69| 9.00| .00| 9.00|49.00|
+|V6 # 10| 0|5.90| .80| 2.51| 6.32| -.29| 1.33| -.96| .69| 7.00| 1.00| 8.00|59.00|
+|V7 # 10| 0|4.70| 1.10| 3.47| 12.01| -1.99| 1.33| -.16| .69| 9.00| .00| 9.00|47.00|
+|V8 # 10| 0|4.10| 1.10| 3.48| 12.10| -1.93| 1.33| .37| .69| 9.00| .00| 9.00|41.00|
+|V9 # 10| 0|4.30| .87| 2.75| 7.57| -.87| 1.33| .73| .69| 8.00| 1.00| 9.00|43.00|
+|V10 # 10| 0|5.50| .85| 2.68| 7.17| -1.84| 1.33| -.33| .69| 7.00| 2.00| 9.00|55.00|
+|V11 # 10| 0|6.50| .78| 2.46| 6.06| -1.28| 1.33| -.89| .69| 6.00| 3.00| 9.00|65.00|
+|V12 # 10| 0|7.90| .60| 1.91| 3.66| 5.24| 1.33| -2.21| .69| 6.00| 3.00| 9.00|79.00|
+|V13 # 10| 0|4.30| .99| 3.13| 9.79| -1.25| 1.33| .33| .69| 9.00| .00| 9.00|43.00|
+|V14 # 10| 0|3.60| 1.01| 3.20| 10.27| -.96| 1.33| .81| .69| 9.00| .00| 9.00|36.00|
+|V15 # 10| 0|3.70| .92| 2.91| 8.46| -1.35| 1.33| .71| .69| 7.00| 1.00| 8.00|37.00|
+|V16 # 10| 0|6.40| .91| 2.88| 8.27| -1.14| 1.33| -.92| .69| 7.00| 2.00| 9.00|64.00|
++--------#-------+---------+----+--------+-------+--------+--------+--------+--------+--------+-----+-------+-------+-----+
EOF
if [ $? -ne 0 ] ; then fail ; fi
activity="create program"
cat > $TEMPDIR/descript.stat <<EOF
+SET FORMAT F8.3.
+
data list notable / X 1.
begin data.
0
|V3 | 1| 3- 3|F1.0 |
+--------+------+-------+------+
2.1 DESCRIPTIVES. Valid cases = 7; cases with missing value(s) = 6.
-+--------#-------+---------+-----+--------+-------+--------+--------+--------+--------+--------+-----+-------+-------+-----+
-|Variable#Valid N|Missing N| Mean|S E Mean|Std Dev|Variance|Kurtosis|S E Kurt|Skewness|S E Skew|Range|Minimum|Maximum| Sum |
-#========#=======#=========#=====#========#=======#========#========#========#========#========#=====#=======#=======#=====#
-|V1 # 1| 6|2.000| . | . | . | . | . | . | . | .000| 2.000| 2.000|2.000|
-|V2 # 2| 5|2.500| .500| .707| .500| . | . | . | . |1.000| 2.000| 3.000|5.000|
-|V3 # 3| 4|3.000| .577| 1.000| 1.000| . | . | .000| 1.225|2.000| 2.000| 4.000|9.000|
-+--------#-------+---------+-----+--------+-------+--------+--------+--------+--------+--------+-----+-------+-------+-----+
++--------#-------+---------+----+--------+-------+--------+--------+--------+--------+--------+-----+-------+-------+----+
+|Variable#Valid N|Missing N|Mean|S E Mean|Std Dev|Variance|Kurtosis|S E Kurt|Skewness|S E Skew|Range|Minimum|Maximum| Sum|
+#========#=======#=========#====#========#=======#========#========#========#========#========#=====#=======#=======#====#
+|V1 # 1| 6|2.00| . | . | . | . | . | . | . | .00| 2.00| 2.00|2.00|
+|V2 # 2| 5|2.50| .50| .71| .50| . | . | . | . | 1.00| 2.00| 3.00|5.00|
+|V3 # 3| 4|3.00| .58| 1.00| 1.00| . | . | .00| 1.22| 2.00| 2.00| 4.00|9.00|
++--------#-------+---------+----+--------+-------+--------+--------+--------+--------+--------+-----+-------+-------+----+
3.1 DESCRIPTIVES. Valid cases = 7; cases with missing value(s) = 3.
-+--------#-------+---------+-----+--------+-------+--------+--------+--------+--------+--------+-----+-------+-------+------+
-|Variable#Valid N|Missing N| Mean|S E Mean|Std Dev|Variance|Kurtosis|S E Kurt|Skewness|S E Skew|Range|Minimum|Maximum| Sum |
-#========#=======#=========#=====#========#=======#========#========#========#========#========#=====#=======#=======#======#
-|V1 # 5| 2|1.200| .200| .447| .200| 5.000| 2.000| 2.236| .913|1.000| 1.000| 2.000| 6.000|
-|V2 # 5| 2|1.600| .400| .894| .800| .312| 2.000| 1.258| .913|2.000| 1.000| 3.000| 8.000|
-|V3 # 5| 2|2.200| .583| 1.304| 1.700| -1.488| 2.000| .541| .913|3.000| 1.000| 4.000|11.000|
-+--------#-------+---------+-----+--------+-------+--------+--------+--------+--------+--------+-----+-------+-------+------+
++--------#-------+---------+----+--------+-------+--------+--------+--------+--------+--------+-----+-------+-------+-----+
+|Variable#Valid N|Missing N|Mean|S E Mean|Std Dev|Variance|Kurtosis|S E Kurt|Skewness|S E Skew|Range|Minimum|Maximum| Sum |
+#========#=======#=========#====#========#=======#========#========#========#========#========#=====#=======#=======#=====#
+|V1 # 5| 2|1.20| .20| .45| .20| 5.00| 2.00| 2.24| .91| 1.00| 1.00| 2.00| 6.00|
+|V2 # 5| 2|1.60| .40| .89| .80| .31| 2.00| 1.26| .91| 2.00| 1.00| 3.00| 8.00|
+|V3 # 5| 2|2.20| .58| 1.30| 1.70| -1.49| 2.00| .54| .91| 3.00| 1.00| 4.00|11.00|
++--------#-------+---------+----+--------+-------+--------+--------+--------+--------+--------+-----+-------+-------+-----+
4.1 DESCRIPTIVES. Valid cases = 1; cases with missing value(s) = 6.
-+--------#-------+---------+-----+--------+-------+--------+--------+--------+--------+--------+-----+-------+-------+-----+
-|Variable#Valid N|Missing N| Mean|S E Mean|Std Dev|Variance|Kurtosis|S E Kurt|Skewness|S E Skew|Range|Minimum|Maximum| Sum |
-#========#=======#=========#=====#========#=======#========#========#========#========#========#=====#=======#=======#=====#
-|V1 # 1| 0|2.000| . | . | . | . | . | . | . | .000| 2.000| 2.000|2.000|
-|V2 # 1| 0|3.000| . | . | . | . | . | . | . | .000| 3.000| 3.000|3.000|
-|V3 # 1| 0|4.000| . | . | . | . | . | . | . | .000| 4.000| 4.000|4.000|
-+--------#-------+---------+-----+--------+-------+--------+--------+--------+--------+--------+-----+-------+-------+-----+
++--------#-------+---------+----+--------+-------+--------+--------+--------+--------+--------+-----+-------+-------+----+
+|Variable#Valid N|Missing N|Mean|S E Mean|Std Dev|Variance|Kurtosis|S E Kurt|Skewness|S E Skew|Range|Minimum|Maximum| Sum|
+#========#=======#=========#====#========#=======#========#========#========#========#========#=====#=======#=======#====#
+|V1 # 1| 0|2.00| . | . | . | . | . | . | . | .00| 2.00| 2.00|2.00|
+|V2 # 1| 0|3.00| . | . | . | . | . | . | . | .00| 3.00| 3.00|3.00|
+|V3 # 1| 0|4.00| . | . | . | . | . | . | . | .00| 4.00| 4.00|4.00|
++--------#-------+---------+----+--------+-------+--------+--------+--------+--------+--------+-----+-------+-------+----+
5.1 DESCRIPTIVES. Valid cases = 4; cases with missing value(s) = 3.
-+--------#-------+---------+-----+--------+-------+--------+--------+--------+--------+--------+-----+-------+-------+------+
-|Variable#Valid N|Missing N| Mean|S E Mean|Std Dev|Variance|Kurtosis|S E Kurt|Skewness|S E Skew|Range|Minimum|Maximum| Sum |
-#========#=======#=========#=====#========#=======#========#========#========#========#========#=====#=======#=======#======#
-|V1 # 4| 0|1.250| .250| .500| .250| 4.000| 2.619| 2.000| 1.014|1.000| 1.000| 2.000| 5.000|
-|V2 # 4| 0|1.750| .479| .957| .917| -1.289| 2.619| .855| 1.014|2.000| 1.000| 3.000| 7.000|
-|V3 # 4| 0|2.500| .645| 1.291| 1.667| -1.200| 2.619| .000| 1.014|3.000| 1.000| 4.000|10.000|
-+--------#-------+---------+-----+--------+-------+--------+--------+--------+--------+--------+-----+-------+-------+------+
++--------#-------+---------+----+--------+-------+--------+--------+--------+--------+--------+-----+-------+-------+-----+
+|Variable#Valid N|Missing N|Mean|S E Mean|Std Dev|Variance|Kurtosis|S E Kurt|Skewness|S E Skew|Range|Minimum|Maximum| Sum |
+#========#=======#=========#====#========#=======#========#========#========#========#========#=====#=======#=======#=====#
+|V1 # 4| 0|1.25| .25| .50| .25| 4.00| 2.62| 2.00| 1.01| 1.00| 1.00| 2.00| 5.00|
+|V2 # 4| 0|1.75| .48| .96| .92| -1.29| 2.62| .85| 1.01| 2.00| 1.00| 3.00| 7.00|
+|V3 # 4| 0|2.50| .65| 1.29| 1.67| -1.20| 2.62| .00| 1.01| 3.00| 1.00| 4.00|10.00|
++--------#-------+---------+----+--------+-------+--------+--------+--------+--------+--------+-----+-------+-------+-----+
EOF
if [ $? -ne 0 ] ; then fail ; fi
activity="compare output $i"
perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list
diff -b $TEMPDIR/pspp.list - <<EOF
-1.1 FREQUENCIES. X
+1.1 FREQUENCIES. X
+-----------+--------+---------+--------+--------+--------+
| | | | | Valid | Cum |
|Value Label| Value |Frequency| Percent| Percent| Percent|
#===========#========#=========#========#========#========#
-| | 1.00| 1| 20.0| 20.0| 20.0|
-| | 2.00| 1| 20.0| 20.0| 40.0|
-| | 3.00| 1| 20.0| 20.0| 60.0|
-| | 4.00| 1| 20.0| 20.0| 80.0|
-| | 5.00| 1| 20.0| 20.0| 100.0|
+| | 1.00| 1| 20.00| 20.00| 20.00|
+| | 2.00| 1| 20.00| 20.00| 40.00|
+| | 3.00| 1| 20.00| 20.00| 60.00|
+| | 4.00| 1| 20.00| 20.00| 80.00|
+| | 5.00| 1| 20.00| 20.00| 100.00|
#===========#========#=========#========#========#========#
| Total| 5| 100.0| 100.0| |
+--------------------+---------+--------+--------+--------+
-+-----------------------+-----+
-|N Valid | 5|
-| Missing | 0|
-|Mean |3.000|
-|Std Dev |1.581|
-|Minimum |1.000|
-|Maximum |5.000|
-|Percentiles 0 |1.000|
-| 25 |1.500|
-| 50 (Median)|3.000|
-| 75 |4.500|
-| 100 |5.000|
-+-----------------------+-----+
++-----------------------+----+
+|N Valid | 5|
+| Missing | 0|
+|Mean |3.00|
+|Std Dev |1.58|
+|Minimum |1.00|
+|Maximum |5.00|
+|Percentiles 0 |1.00|
+| 25 |1.50|
+| 50 (Median)|3.00|
+| 75 |4.50|
+| 100 |5.00|
++-----------------------+----+
EOF
if [ $? -ne 0 ] ; then fail ; fi
activity="compare output $i"
perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list
diff -b $TEMPDIR/pspp.list - <<EOF
-1.1 FREQUENCIES. X
+1.1 FREQUENCIES. X
+-----------+--------+---------+--------+--------+--------+
| | | | | Valid | Cum |
|Value Label| Value |Frequency| Percent| Percent| Percent|
#===========#========#=========#========#========#========#
-| | 1.00| 1| 20.0| 20.0| 20.0|
-| | 2.00| 1| 20.0| 20.0| 40.0|
-| | 3.00| 1| 20.0| 20.0| 60.0|
-| | 4.00| 1| 20.0| 20.0| 80.0|
-| | 5.00| 1| 20.0| 20.0| 100.0|
+| | 1.00| 1| 20.00| 20.00| 20.00|
+| | 2.00| 1| 20.00| 20.00| 40.00|
+| | 3.00| 1| 20.00| 20.00| 60.00|
+| | 4.00| 1| 20.00| 20.00| 80.00|
+| | 5.00| 1| 20.00| 20.00| 100.00|
#===========#========#=========#========#========#========#
| Total| 5| 100.0| 100.0| |
+--------------------+---------+--------+--------+--------+
-+-----------------------+-----+
-|N Valid | 5|
-| Missing | 0|
-|Mean |3.000|
-|Std Dev |1.581|
-|Minimum |1.000|
-|Maximum |5.000|
-|Percentiles 0 |1.000|
-| 25 |2.000|
-| 50 (Median)|3.000|
-| 75 |4.000|
-| 100 |5.000|
-+-----------------------+-----+
++-----------------------+----+
+|N Valid | 5|
+| Missing | 0|
+|Mean |3.00|
+|Std Dev |1.58|
+|Minimum |1.00|
+|Maximum |5.00|
+|Percentiles 0 |1.00|
+| 25 |2.00|
+| 50 (Median)|3.00|
+| 75 |4.00|
+| 100 |5.00|
++-----------------------+----+
EOF
if [ $? -ne 0 ] ; then fail ; fi
activity="compare output $i"
perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list
diff -b $TEMPDIR/pspp.list - <<EOF
-1.1 FREQUENCIES. X
+1.1 FREQUENCIES. X
+-----------+--------+---------+--------+--------+--------+
| | | | | Valid | Cum |
|Value Label| Value |Frequency| Percent| Percent| Percent|
#===========#========#=========#========#========#========#
-| | 1.00| 2| 20.0| 20.0| 20.0|
-| | 2.00| 2| 20.0| 20.0| 40.0|
-| | 3.00| 2| 20.0| 20.0| 60.0|
-| | 4.00| 2| 20.0| 20.0| 80.0|
-| | 5.00| 2| 20.0| 20.0| 100.0|
+| | 1.00| 2.00| 20.00| 20.00| 20.00|
+| | 2.00| 2.00| 20.00| 20.00| 40.00|
+| | 3.00| 2.00| 20.00| 20.00| 60.00|
+| | 4.00| 2.00| 20.00| 20.00| 80.00|
+| | 5.00| 2.00| 20.00| 20.00| 100.00|
#===========#========#=========#========#========#========#
-| Total| 10| 100.0| 100.0| |
+| Total| 10.00| 100.0| 100.0| |
+--------------------+---------+--------+--------+--------+
+-----------------------+-----+
-|N Valid | 10|
-| Missing | 0|
-|Mean |3.000|
-|Std Dev |1.491|
-|Minimum |1.000|
-|Maximum |5.000|
-|Percentiles 0 |1.000|
-| 25 |2.000|
-| 50 (Median)|3.000|
-| 75 |4.000|
-| 100 |5.000|
+|N Valid |10.00|
+| Missing | .00|
+|Mean | 3.00|
+|Std Dev | 1.49|
+|Minimum | 1.00|
+|Maximum | 5.00|
+|Percentiles 0 | 1.00|
+| 25 | 2.00|
+| 50 (Median)| 3.00|
+| 75 | 4.00|
+| 100 | 5.00|
+-----------------------+-----+
EOF
if [ $? -ne 0 ] ; then fail ; fi
activity="compare output $i"
perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list
diff -b $TEMPDIR/pspp.list - <<EOF
-1.1 FREQUENCIES. X
+1.1 FREQUENCIES. X
+-----------+--------+---------+--------+--------+--------+
| | | | | Valid | Cum |
|Value Label| Value |Frequency| Percent| Percent| Percent|
#===========#========#=========#========#========#========#
-| | 1.00| 1| 16.7| 16.7| 16.7|
-| | 3.00| 2| 33.3| 33.3| 50.0|
-| | 4.00| 1| 16.7| 16.7| 66.7|
-| | 5.00| 2| 33.3| 33.3| 100.0|
+| | 1.00| 1.00| 16.67| 16.67| 16.67|
+| | 3.00| 2.00| 33.33| 33.33| 50.00|
+| | 4.00| 1.00| 16.67| 16.67| 66.67|
+| | 5.00| 2.00| 33.33| 33.33| 100.00|
#===========#========#=========#========#========#========#
-| Total| 6| 100.0| 100.0| |
+| Total| 6.00| 100.0| 100.0| |
+--------------------+---------+--------+--------+--------+
-+-----------------------+-----+
-|N Valid | 6|
-| Missing | 0|
-|Mean |3.500|
-|Std Dev |1.517|
-|Minimum |1.000|
-|Maximum |5.000|
-|Percentiles 0 |1.000|
-| 25 |3.000|
-| 50 (Median)|3.500|
-| 75 |4.750|
-| 100 |5.000|
-+-----------------------+-----+
++-----------------------+----+
+|N Valid |6.00|
+| Missing | .00|
+|Mean |3.50|
+|Std Dev |1.52|
+|Minimum |1.00|
+|Maximum |5.00|
+|Percentiles 0 |1.00|
+| 25 |3.00|
+| 50 (Median)|3.50|
+| 75 |4.75|
+| 100 |5.00|
++-----------------------+----+
EOF
if [ $? -ne 0 ] ; then fail ; fi
activity="compare output $i"
perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list
diff -b $TEMPDIR/pspp.list - <<EOF
-1.1 FREQUENCIES. X
+1.1 FREQUENCIES. X
+-----------+--------+---------+--------+--------+--------+
| | | | | Valid | Cum |
|Value Label| Value |Frequency| Percent| Percent| Percent|
#===========#========#=========#========#========#========#
-| | 1.00| 1| 10.0| 16.7| 16.7|
-| | 3.00| 2| 20.0| 33.3| 50.0|
-| | 4.00| 1| 10.0| 16.7| 66.7|
-| | 5.00| 2| 20.0| 33.3| 100.0|
-| | 99.00| 4| 40.0| Missing| |
+| | 1.00| 1.00| 10.00| 16.67| 16.67|
+| | 3.00| 2.00| 20.00| 33.33| 50.00|
+| | 4.00| 1.00| 10.00| 16.67| 66.67|
+| | 5.00| 2.00| 20.00| 33.33| 100.00|
+| | 99.00| 4.00| 40.00| Missing| |
#===========#========#=========#========#========#========#
-| Total| 10| 100.0| 100.0| |
+| Total| 10.00| 100.0| 100.0| |
+--------------------+---------+--------+--------+--------+
-+-----------------------+-----+
-|N Valid | 6|
-| Missing | 4|
-|Mean |3.500|
-|Std Dev |1.517|
-|Minimum |1.000|
-|Maximum |5.000|
-|Percentiles 0 |1.000|
-| 25 |3.000|
-| 50 (Median)|3.500|
-| 75 |4.750|
-| 100 |5.000|
-+-----------------------+-----+
++-----------------------+----+
+|N Valid |6.00|
+| Missing |4.00|
+|Mean |3.50|
+|Std Dev |1.52|
+|Minimum |1.00|
+|Maximum |5.00|
+|Percentiles 0 |1.00|
+| 25 |3.00|
+| 50 (Median)|3.50|
+| 75 |4.75|
+| 100 |5.00|
++-----------------------+----+
EOF
if [ $? -ne 0 ] ; then fail ; fi