}
const struct fmt_spec F_8_0 = {FMT_F, 8, 0};
+const struct fmt_spec F_8_2 = {FMT_F, 8, 2};
+const struct fmt_spec F_4_3 = {FMT_F, 4, 3};
+const struct fmt_spec F_5_1 = {FMT_F, 5, 1};
int fmt_neg_affix_width (const struct fmt_number_style *);
extern const struct fmt_spec F_8_0 ;
+extern const struct fmt_spec F_8_2 ;
+extern const struct fmt_spec F_4_3 ;
+extern const struct fmt_spec F_5_1 ;
#endif /* data/format.h */
var_get_print_format (wvar) : & F_8_0;
struct tab_table *table = tab_create (7, ost->n_vars * 3 + 1);
+ tab_set_format (table, RC_WEIGHT, wfmt);
tab_title (table, _("Binomial Test"));
tab_text (table, 1, 3 + v * 3, TAB_LEFT, _("Total"));
/* Test Prop */
- tab_double (table, 5, 1 + v * 3, TAB_NONE, bst->p, NULL);
+ tab_double (table, 5, 1 + v * 3, TAB_NONE, bst->p, NULL, RC_OTHER);
/* Category labels */
tab_text (table, 2, 1 + v * 3, TAB_NONE, ds_cstr (&catstr[0]));
tab_text (table, 2, 2 + v * 3, TAB_NONE, ds_cstr (&catstr[1]));
/* Observed N */
- tab_double (table, 3, 1 + v * 3, TAB_NONE, cat[0][v].count, wfmt);
- tab_double (table, 3, 2 + v * 3, TAB_NONE, cat[1][v].count, wfmt);
+ tab_double (table, 3, 1 + v * 3, TAB_NONE, cat[0][v].count, NULL, RC_WEIGHT);
+ tab_double (table, 3, 2 + v * 3, TAB_NONE, cat[1][v].count, NULL, RC_WEIGHT);
n_total = cat[0][v].count + cat[1][v].count;
- tab_double (table, 3, 3 + v * 3, TAB_NONE, n_total, wfmt);
+ tab_double (table, 3, 3 + v * 3, TAB_NONE, n_total, NULL, RC_WEIGHT);
/* Observed Proportions */
tab_double (table, 4, 1 + v * 3, TAB_NONE,
- cat[0][v].count / n_total, NULL);
+ cat[0][v].count / n_total, NULL, RC_OTHER);
tab_double (table, 4, 2 + v * 3, TAB_NONE,
- cat[1][v].count / n_total, NULL);
+ cat[1][v].count / n_total, NULL, RC_OTHER);
tab_double (table, 4, 3 + v * 3, TAB_NONE,
- (cat[0][v].count + cat[1][v].count) / n_total, NULL);
+ (cat[0][v].count + cat[1][v].count) / n_total, NULL, RC_OTHER);
/* Significance */
sig = calculate_binomial (cat[0][v].count, cat[1][v].count, bst->p);
- tab_double (table, 6, 1 + v * 3, TAB_NONE, sig, NULL);
+ tab_double (table, 6, 1 + v * 3, TAB_NONE, sig, NULL, RC_PVALUE);
ds_destroy (&catstr[0]);
ds_destroy (&catstr[1]);
struct tab_table *table ;
const struct variable *var = ost->vars[v];
+ const struct variable *wvar = dict_get_weight (dict);
+ const struct fmt_spec *wfmt = wvar ? var_get_print_format (wvar) : & F_8_0;
+
hmap_init (freq_hash);
if (!create_freq_hash (dict, input, var, freq_hash))
{
}
table = tab_create(4, n_cells + 2);
+ tab_set_format (table, RC_WEIGHT, wfmt);
tab_title (table, "%s", var_to_string(var));
tab_text (table, 1, 0, TAB_LEFT, _("Observed N"));
static struct tab_table *
-create_combo_frequency_table (const struct chisquare_test *test)
+create_combo_frequency_table (const struct dictionary *dict, const struct chisquare_test *test)
{
int i;
const struct one_sample_test *ost = (const struct one_sample_test*)test;
struct tab_table *table ;
+ const struct variable *wvar = dict_get_weight (dict);
+ const struct fmt_spec *wfmt = wvar ? var_get_print_format (wvar) : & F_8_0;
+
int n_cells = test->hi - test->lo + 1;
table = tab_create(1 + ost->n_vars * 4, n_cells + 3);
+ tab_set_format (table, RC_WEIGHT, wfmt);
tab_title (table, _("Frequencies"));
for ( i = 0 ; i < ost->n_vars ; ++i )
}
for ( i = test->lo ; i <= test->hi ; ++i )
- tab_fixed (table, 0, 2 + i - test->lo,
- TAB_LEFT, 1 + i - test->lo, 8, 0);
+ tab_double (table, 0, 2 + i - test->lo, TAB_LEFT, 1 + i - test->lo, NULL, RC_INTEGER);
tab_headers (table, 1, 0, 2, 0);
struct one_sample_test *ost = &cst->parent;
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);
&var, 1, exclude,
NULL, NULL);
struct tab_table *freq_table =
- create_variable_frequency_table(dict, reader, cst, v, &freq_hash);
+ create_variable_frequency_table (dict, reader, cst, v, &freq_hash);
struct freq **ff;
/* The observed N */
tab_double (freq_table, 1, i + 1, TAB_NONE,
- ff[i]->count, wfmt);
+ ff[i]->count, NULL, RC_WEIGHT);
if ( cst->n_expected > 0 )
exp = cst->expected[i] * total_obs / total_expected ;
exp = total_obs / (double) n_cells;
tab_double (freq_table, 2, i + 1, TAB_NONE,
- exp, NULL);
+ exp, NULL, RC_OTHER);
/* The residual */
tab_double (freq_table, 3, i + 1, TAB_NONE,
- ff[i]->count - exp, NULL);
+ ff[i]->count - exp, NULL, RC_OTHER);
xsq[v] += (ff[i]->count - exp) * (ff[i]->count - exp) / exp;
}
df[v] = n_cells - 1.0;
tab_double (freq_table, 1, i + 1, TAB_NONE,
- total_obs, wfmt);
+ total_obs, NULL, RC_WEIGHT);
tab_submit (freq_table);
}
else /* ranged == true */
{
- struct tab_table *freq_table = create_combo_frequency_table (cst);
+ struct tab_table *freq_table = create_combo_frequency_table (dict, cst);
n_cells = cst->hi - cst->lo + 1;
/* The observed N */
tab_double (freq_table, v * 4 + 2, i + 2 , TAB_NONE,
- ff[i]->count, wfmt);
+ ff[i]->count, NULL, RC_WEIGHT);
if ( cst->n_expected > 0 )
exp = cst->expected[i] * total_obs / total_expected ;
/* The expected N */
tab_double (freq_table, v * 4 + 3, i + 2 , TAB_NONE,
- exp, NULL);
+ exp, NULL, RC_OTHER);
/* The residual */
tab_double (freq_table, v * 4 + 4, i + 2 , TAB_NONE,
- ff[i]->count - exp, NULL);
+ ff[i]->count - exp, NULL, RC_OTHER);
xsq[v] += (ff[i]->count - exp) * (ff[i]->count - exp) / exp;
}
tab_double (freq_table, v * 4 + 2, tab_nr (freq_table) - 1, TAB_NONE,
- total_obs, wfmt);
+ total_obs, NULL, RC_WEIGHT);
df[v] = n_cells - 1.0;
tab_text (stats_table, 1 + v, 0, TAB_CENTER, var_get_name (var));
- 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_double (stats_table, 1 + v, 1, TAB_NONE, xsq[v], NULL, RC_OTHER);
+ tab_double (stats_table, 1 + v, 2, TAB_NONE, df[v], NULL, RC_INTEGER);
tab_double (stats_table, 1 + v, 3, TAB_NONE,
- gsl_cdf_chisq_Q (xsq[v], df[v]), NULL);
+ gsl_cdf_chisq_Q (xsq[v], df[v]), NULL, RC_PVALUE);
}
tab_submit (stats_table);
}
const int column_headers = 2;
struct tab_table *table =
tab_create (row_headers + 2, column_headers + ost->n_vars);
+ tab_set_format (table, RC_WEIGHT, wfmt);
tab_headers (table, row_headers, 0, column_headers, 0);
TAB_LEFT, var_to_string (ost->vars[i]));
tab_double (table, 1, column_headers + i, 0,
- ct->hits[i], wfmt);
+ ct->hits[i], NULL, RC_WEIGHT);
tab_double (table, 2, column_headers + i, 0,
- ct->misses[i], wfmt);
+ ct->misses[i], NULL, RC_WEIGHT);
}
tab_submit (table);
struct tab_table *table =
tab_create (row_headers + 1, column_headers + 4);
+
+ tab_set_format (table, RC_WEIGHT, wfmt);
+
tab_headers (table, row_headers, 0, column_headers, 0);
tab_title (table, _("Test Statistics"));
tab_vline (table, TAL_2, row_headers, 0, tab_nr (table) - 1);
tab_double (table, 1, column_headers,
- 0, ch->cc, wfmt);
+ 0, ch->cc, NULL, RC_WEIGHT);
tab_double (table, 1, column_headers + 1,
- 0, ch->q, 0);
+ 0, ch->q, NULL, RC_OTHER);
tab_double (table, 1, column_headers + 2,
- 0, ch->df, &F_8_0);
+ 0, ch->df, NULL, RC_INTEGER);
tab_double (table, 1, column_headers + 3,
0, gsl_cdf_chisq_Q (ch->q, ch->df),
- 0);
+ NULL, RC_PVALUE);
tab_submit (table);
}
NOT_REACHED ();
};
- tab_double (t, c, r + heading_rows, 0, x, NULL);
+ tab_double (t, c, r + heading_rows, 0, x, NULL, RC_OTHER);
}
}
nr += heading_rows;
t = tab_create (nc, nr);
+ tab_set_format (t, RC_WEIGHT, wfmt);
tab_title (t, _("Correlations"));
tab_headers (t, heading_columns, 0, heading_rows, 0);
double sig = opts->tails * significance_of_correlation (pearson, w);
if ( opts->missing_type != CORR_LISTWISE )
- tab_double (t, c + heading_columns, row + rows_per_variable - 1, 0, w, wfmt);
+ tab_double (t, c + heading_columns, row + rows_per_variable - 1, 0, w, NULL, RC_WEIGHT);
if ( col_index != r)
- tab_double (t, c + heading_columns, row + 1, 0, sig, NULL);
+ tab_double (t, c + heading_columns, row + 1, 0, sig, NULL, RC_PVALUE);
if ( opts->sig && col_index != r && sig < 0.05)
flags = TAB_EMPH;
- tab_double (t, c + heading_columns, row, flags, pearson, NULL);
+ tab_double (t, c + heading_columns, row, flags, pearson, NULL, RC_OTHER);
if (opts->statistics & STATS_XPROD)
{
const double xprod_dev = cov * w;
cov *= w / (w - 1.0);
- tab_double (t, c + heading_columns, row + 2, 0, xprod_dev, NULL);
- tab_double (t, c + heading_columns, row + 3, 0, cov, NULL);
+ tab_double (t, c + heading_columns, row + 2, 0, xprod_dev, NULL, RC_OTHER);
+ tab_double (t, c + heading_columns, row + 3, 0, cov, NULL, RC_OTHER);
}
}
}
int i;
summary = tab_create (7, 3 + proc->n_pivots);
+ tab_set_format (summary, RC_WEIGHT, &proc->weight_format);
tab_title (summary, _("Summary."));
tab_headers (summary, 1, 0, 3, 0);
tab_joint_text (summary, 1, 0, 6, 0, TAB_CENTER, _("Cases"));
n[2] = n[0] + n[1];
for (i = 0; i < 3; i++)
{
- tab_double (summary, i * 2 + 1, 0, TAB_RIGHT, n[i],
- &proc->weight_format);
+ tab_double (summary, i * 2 + 1, 0, TAB_RIGHT, n[i], NULL, RC_WEIGHT);
tab_text_format (summary, i * 2 + 2, 0, TAB_RIGHT, "%.1f%%",
n[i] / n[2] * 100.);
}
static struct tab_table *create_crosstab_table (struct crosstabs_proc *,
struct pivot_table *);
-static struct tab_table *create_chisq_table (struct pivot_table *);
-static struct tab_table *create_sym_table (struct pivot_table *);
-static struct tab_table *create_risk_table (struct pivot_table *);
-static struct tab_table *create_direct_table (struct pivot_table *);
+static struct tab_table *create_chisq_table (struct crosstabs_proc *proc, struct pivot_table *);
+static struct tab_table *create_sym_table (struct crosstabs_proc *proc, struct pivot_table *);
+static struct tab_table *create_risk_table (struct crosstabs_proc *proc, struct pivot_table *);
+static struct tab_table *create_direct_table (struct crosstabs_proc *proc, struct pivot_table *);
static void display_dimensions (struct crosstabs_proc *, struct pivot_table *,
struct tab_table *, int first_difference);
static void display_crosstabulation (struct crosstabs_proc *,
if (proc->cells)
table = create_crosstab_table (proc, pt);
if (proc->statistics & (1u << CRS_ST_CHISQ))
- chisq = create_chisq_table (pt);
+ chisq = create_chisq_table (proc, pt);
if (proc->statistics & ((1u << CRS_ST_PHI) | (1u << CRS_ST_CC)
| (1u << CRS_ST_BTAU) | (1u << CRS_ST_CTAU)
| (1u << CRS_ST_GAMMA) | (1u << CRS_ST_CORR)
| (1u << CRS_ST_KAPPA)))
- sym = create_sym_table (pt);
+ sym = create_sym_table (proc, pt);
if (proc->statistics & (1u << CRS_ST_RISK))
- risk = create_risk_table (pt);
+ risk = create_risk_table (proc, pt);
if (proc->statistics & ((1u << CRS_ST_LAMBDA) | (1u << CRS_ST_UC)
| (1u << CRS_ST_D) | (1u << CRS_ST_ETA)))
- direct = create_direct_table (pt);
+ direct = create_direct_table (proc, pt);
row0 = row1 = 0;
while (find_crosstab (pt, &row0, &row1))
table = tab_create (x.n_consts + 1 + x.n_cols + 1,
(x.n_entries / x.n_cols) * 3 / 2 * proc->n_cells + 10);
tab_headers (table, x.n_consts + 1, 0, 2, 0);
+ tab_set_format (table, RC_WEIGHT, &proc->weight_format);
/* First header line. */
tab_joint_text (table, x.n_consts + 1, 0,
}
static struct tab_table *
-create_chisq_table (struct pivot_table *pt)
+create_chisq_table (struct crosstabs_proc *proc, struct pivot_table *pt)
{
struct tab_table *chisq;
chisq = tab_create (6 + (pt->n_vars - 2),
pt->n_entries / pt->n_cols * 3 / 2 * N_CHISQ + 10);
tab_headers (chisq, 1 + (pt->n_vars - 2), 0, 1, 0);
+ tab_set_format (chisq, RC_WEIGHT, &proc->weight_format);
tab_title (chisq, _("Chi-square tests."));
/* Symmetric measures. */
static struct tab_table *
-create_sym_table (struct pivot_table *pt)
+create_sym_table (struct crosstabs_proc *proc, struct pivot_table *pt)
{
struct tab_table *sym;
sym = tab_create (6 + (pt->n_vars - 2),
pt->n_entries / pt->n_cols * 7 + 10);
+
+ tab_set_format (sym, RC_WEIGHT, &proc->weight_format);
+
tab_headers (sym, 2 + (pt->n_vars - 2), 0, 1, 0);
tab_title (sym, _("Symmetric measures."));
/* Risk estimate. */
static struct tab_table *
-create_risk_table (struct pivot_table *pt)
+create_risk_table (struct crosstabs_proc *proc, struct pivot_table *pt)
{
struct tab_table *risk;
risk = tab_create (4 + (pt->n_vars - 2), pt->n_entries / pt->n_cols * 4 + 10);
tab_headers (risk, 1 + pt->n_vars - 2, 0, 2, 0);
tab_title (risk, _("Risk estimate."));
+ tab_set_format (risk, RC_WEIGHT, &proc->weight_format);
tab_offset (risk, pt->n_vars - 2, 0);
tab_joint_text_format (risk, 2, 0, 3, 0, TAB_CENTER | TAT_TITLE,
/* Directional measures. */
static struct tab_table *
-create_direct_table (struct pivot_table *pt)
+create_direct_table (struct crosstabs_proc *proc, struct pivot_table *pt)
{
struct tab_table *direct;
pt->n_entries / pt->n_cols * 7 + 10);
tab_headers (direct, 3 + (pt->n_vars - 2), 0, 1, 0);
tab_title (direct, _("Directional measures."));
+ tab_set_format (direct, RC_WEIGHT, &proc->weight_format);
tab_offset (direct, pt->n_vars - 2, 0);
tab_text (direct, 0, 0, TAB_LEFT | TAT_TITLE, _("Category"));
tab_text (chisq, 0, 0, TAB_LEFT, gettext (chisq_stats[i]));
if (i != 2)
{
- tab_double (chisq, 1, 0, TAB_RIGHT, chisq_v[i], NULL);
- tab_double (chisq, 2, 0, TAB_RIGHT, df[i], &pt->weight_format);
+ tab_double (chisq, 1, 0, TAB_RIGHT, chisq_v[i], NULL, RC_OTHER);
+ tab_double (chisq, 2, 0, TAB_RIGHT, df[i], NULL, RC_WEIGHT);
tab_double (chisq, 3, 0, TAB_RIGHT,
- gsl_cdf_chisq_Q (chisq_v[i], df[i]), NULL);
+ gsl_cdf_chisq_Q (chisq_v[i], df[i]), NULL, RC_PVALUE);
}
else
{
*showed_fisher = true;
- tab_double (chisq, 4, 0, TAB_RIGHT, fisher2, NULL);
- tab_double (chisq, 5, 0, TAB_RIGHT, fisher1, NULL);
+ tab_double (chisq, 4, 0, TAB_RIGHT, fisher2, NULL, RC_PVALUE);
+ tab_double (chisq, 5, 0, TAB_RIGHT, fisher1, NULL, RC_PVALUE);
}
tab_next_row (chisq);
}
tab_text (chisq, 0, 0, TAB_LEFT, _("N of Valid Cases"));
- tab_double (chisq, 1, 0, TAB_RIGHT, pt->total, &pt->weight_format);
+ tab_double (chisq, 1, 0, TAB_RIGHT, pt->total, NULL, RC_WEIGHT);
tab_next_row (chisq);
tab_offset (chisq, 0, -1);
}
tab_text (sym, 1, 0, TAB_LEFT, gettext (stats[i]));
- tab_double (sym, 2, 0, TAB_RIGHT, sym_v[i], NULL);
+ tab_double (sym, 2, 0, TAB_RIGHT, sym_v[i], NULL, RC_OTHER);
if (sym_ase[i] != SYSMIS)
- tab_double (sym, 3, 0, TAB_RIGHT, sym_ase[i], NULL);
+ tab_double (sym, 3, 0, TAB_RIGHT, sym_ase[i], NULL, RC_OTHER);
if (sym_t[i] != SYSMIS)
- 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_double (sym, 4, 0, TAB_RIGHT, sym_t[i], NULL, RC_OTHER);
+ /*tab_double (sym, 5, 0, TAB_RIGHT, normal_sig (sym_v[i]), NULL, RC_PVALUE);*/
tab_next_row (sym);
}
tab_text (sym, 0, 0, TAB_LEFT, _("N of Valid Cases"));
- tab_double (sym, 2, 0, TAB_RIGHT, pt->total, &pt->weight_format);
+ tab_double (sym, 2, 0, TAB_RIGHT, pt->total, NULL, RC_WEIGHT);
tab_next_row (sym);
tab_offset (sym, 0, -1);
}
tab_text (risk, 0, 0, TAB_LEFT, buf);
- 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_double (risk, 1, 0, TAB_RIGHT, risk_v[i], NULL, RC_OTHER);
+ tab_double (risk, 2, 0, TAB_RIGHT, lower[i], NULL, RC_OTHER);
+ tab_double (risk, 3, 0, TAB_RIGHT, upper[i], NULL, RC_OTHER);
tab_next_row (risk);
}
tab_text (risk, 0, 0, TAB_LEFT, _("N of Valid Cases"));
- tab_double (risk, 1, 0, TAB_RIGHT, pt->total, &pt->weight_format);
+ tab_double (risk, 1, 0, TAB_RIGHT, pt->total, NULL, RC_WEIGHT);
tab_next_row (risk);
tab_offset (risk, 0, -1);
}
}
- tab_double (direct, 3, 0, TAB_RIGHT, direct_v[i], NULL);
+ tab_double (direct, 3, 0, TAB_RIGHT, direct_v[i], NULL, RC_OTHER);
if (direct_ase[i] != SYSMIS)
- tab_double (direct, 4, 0, TAB_RIGHT, direct_ase[i], NULL);
+ tab_double (direct, 4, 0, TAB_RIGHT, direct_ase[i], NULL, RC_OTHER);
if (direct_t[i] != SYSMIS)
- 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_double (direct, 5, 0, TAB_RIGHT, direct_t[i], NULL, RC_OTHER);
+ /*tab_double (direct, 6, 0, TAB_RIGHT, normal_sig (direct_v[i]), NULL, RC_PVALUE);*/
tab_next_row (direct);
}
for (j = 0; j < DSC_N_STATS; j++)
if (dsc->show_stats & (1ul << j))
- tab_double (t, nc++, i + 1, TAB_NONE, dv->stats[j], NULL);
+ tab_double (t, nc++, i + 1, TAB_NONE, dv->stats[j], NULL, RC_OTHER);
}
tab_title (t, _("Valid cases = %.*g; cases with missing value(s) = %.*g."),
const int nc = heading_columns + cmd->n_percentiles;
t = tab_create (nc, nr);
+
tab_title (t, _("Percentiles"));
tab_headers (t, heading_columns, 0, heading_rows, 0);
heading_rows + v * rows_per_var + i * rows_per_cat,
0,
percentile_calculate (es->percentiles[p], cmd->pc_alg),
- 0);
+ NULL, RC_OTHER);
if (cmd->ptiles[p] == 25.0)
{
heading_rows + v * rows_per_var + i * rows_per_cat + 1,
0,
hinges[0],
- 0);
+ NULL, RC_OTHER);
}
else if (cmd->ptiles[p] == 50.0)
{
heading_rows + v * rows_per_var + i * rows_per_cat + 1,
0,
hinges[1],
- 0);
+ NULL, RC_OTHER);
}
else if (cmd->ptiles[p] == 75.0)
{
heading_rows + v * rows_per_var + i * rows_per_cat + 1,
0,
hinges[2],
- 0);
+ NULL, RC_OTHER);
}
}
const int nc = 2 + heading_columns;
t = tab_create (nc, nr);
+
tab_title (t, _("Descriptives"));
tab_headers (t, heading_columns, 0, heading_rows, 0);
tab_double (t,
1 + iact->n_vars + 2,
heading_rows + v * rows_per_var + i * rows_per_cat,
- 0, m1, 0);
+ 0, m1, NULL, RC_OTHER);
tab_double (t,
1 + iact->n_vars + 3,
heading_rows + v * rows_per_var + i * rows_per_cat,
- 0, calc_semean (m2, m0), 0);
+ 0, calc_semean (m2, m0), NULL, RC_OTHER);
tab_text_format (t,
1 + iact->n_vars,
tab_double (t,
1 + iact->n_vars + 2,
heading_rows + v * rows_per_var + i * rows_per_cat + 1,
- 0, m1 - tval * calc_semean (m2, m0), 0);
+ 0, m1 - tval * calc_semean (m2, m0), NULL, RC_OTHER);
tab_text (t,
tab_double (t,
1 + iact->n_vars + 2,
heading_rows + v * rows_per_var + i * rows_per_cat + 2,
- 0, m1 + tval * calc_semean (m2, m0), 0);
+ 0, m1 + tval * calc_semean (m2, m0), NULL, RC_OTHER);
tab_text (t,
heading_rows + v * rows_per_var + i * rows_per_cat + 3,
0,
trimmed_mean_calculate (es->trimmed_mean),
- 0);
+ NULL, RC_OTHER);
tab_text (t,
1 + iact->n_vars,
heading_rows + v * rows_per_var + i * rows_per_cat + 4,
0,
percentile_calculate (es->quartiles[1], cmd->pc_alg),
- 0);
+ NULL, RC_OTHER);
tab_text (t,
tab_double (t,
1 + iact->n_vars + 2,
heading_rows + v * rows_per_var + i * rows_per_cat + 5,
- 0, m2, 0);
+ 0, m2, NULL, RC_OTHER);
tab_text (t,
1 + iact->n_vars,
tab_double (t,
1 + iact->n_vars + 2,
heading_rows + v * rows_per_var + i * rows_per_cat + 6,
- 0, sqrt (m2), 0);
+ 0, sqrt (m2), NULL, RC_OTHER);
tab_text (t,
1 + iact->n_vars,
heading_rows + v * rows_per_var + i * rows_per_cat + 7,
0,
es->minima[0].val,
- 0);
+ NULL, RC_OTHER);
tab_text (t,
1 + iact->n_vars,
heading_rows + v * rows_per_var + i * rows_per_cat + 8,
0,
es->maxima[0].val,
- 0);
+ NULL, RC_OTHER);
tab_text (t,
1 + iact->n_vars,
heading_rows + v * rows_per_var + i * rows_per_cat + 9,
0,
es->maxima[0].val - es->minima[0].val,
- 0);
+ NULL, RC_OTHER);
tab_text (t,
1 + iact->n_vars,
0,
percentile_calculate (es->quartiles[2], cmd->pc_alg) -
percentile_calculate (es->quartiles[0], cmd->pc_alg),
- 0);
+ NULL, RC_OTHER);
tab_double (t,
1 + iact->n_vars + 2,
heading_rows + v * rows_per_var + i * rows_per_cat + 11,
- 0, m3, 0);
+ 0, m3, NULL, RC_OTHER);
tab_double (t,
1 + iact->n_vars + 3,
heading_rows + v * rows_per_var + i * rows_per_cat + 11,
- 0, calc_seskew (m0), 0);
+ 0, calc_seskew (m0), NULL, RC_OTHER);
tab_text (t,
1 + iact->n_vars,
tab_double (t,
1 + iact->n_vars + 2,
heading_rows + v * rows_per_var + i * rows_per_cat + 12,
- 0, m4, 0);
+ 0, m4, NULL, RC_OTHER);
tab_double (t,
1 + iact->n_vars + 3,
heading_rows + v * rows_per_var + i * rows_per_cat + 12,
- 0, calc_sekurt (m0), 0);
+ 0, calc_sekurt (m0), NULL, RC_OTHER);
}
free (prev_val);
const int nc = 2 + heading_columns;
t = tab_create (nc, nr);
+
tab_title (t, _("Extreme Values"));
tab_headers (t, heading_columns, 0, heading_rows, 0);
heading_rows + v * rows_per_var + i * rows_per_cat + e,
TAB_RIGHT,
e + 1,
- &F_8_0);
+ NULL, RC_INTEGER);
/* The casenumber */
if (cmd->id_var)
heading_rows + v * rows_per_var + i * rows_per_cat + e,
TAB_RIGHT,
es->maxima[e].identity.f,
- &F_8_0);
+ NULL, RC_INTEGER);
tab_double (t,
heading_columns + 1,
heading_rows + v * rows_per_var + i * rows_per_cat + e,
0,
es->maxima[e].val,
- var_get_print_format (cmd->dep_vars[v]));
+ var_get_print_format (cmd->dep_vars[v]), RC_OTHER);
tab_double (t,
heading_rows + v * rows_per_var + i * rows_per_cat + cmd->disp_extremes + e,
TAB_RIGHT,
e + 1,
- &F_8_0);
+ NULL, RC_INTEGER);
/* The casenumber */
if (cmd->id_var)
heading_rows + v * rows_per_var + i * rows_per_cat + cmd->disp_extremes + e,
TAB_RIGHT,
es->minima[e].identity.f,
- &F_8_0);
+ NULL, RC_INTEGER);
tab_double (t,
heading_columns + 1,
heading_rows + v * rows_per_var + i * rows_per_cat + cmd->disp_extremes + e,
0,
es->minima[e].val,
- var_get_print_format (cmd->dep_vars[v]));
+ var_get_print_format (cmd->dep_vars[v]), RC_OTHER);
}
}
free (prev_val);
const int nc = 6 + heading_columns;
t = tab_create (nc, nr);
+ tab_set_format (t, RC_WEIGHT, wfmt);
tab_title (t, _("Case Processing Summary"));
tab_headers (t, heading_columns, 0, heading_rows, 0);
heading_rows + n_cats * v + i,
0,
es[v].non_missing,
- wfmt);
+ NULL, RC_WEIGHT);
tab_text_format (t,
heading_rows + n_cats * v + i,
0,
es[v].missing,
- wfmt);
+ NULL, RC_WEIGHT);
tab_text_format (t,
heading_columns + 3,
heading_rows + n_cats * v + i,
0,
total,
- wfmt);
+ NULL, RC_WEIGHT);
/* This can only be 100% can't it? */
tab_text_format (t,
tab_text (t, c++, i + heading_rows, TAT_TITLE, var_to_string (factor->vars[i]));
if (factor->print & PRINT_INITIAL)
- tab_double (t, c++, i + heading_rows, 0, gsl_vector_get (initial, i), NULL);
+ tab_double (t, c++, i + heading_rows, 0, gsl_vector_get (initial, i), NULL, RC_OTHER);
if (factor->print & PRINT_EXTRACTION)
- tab_double (t, c++, i + heading_rows, 0, gsl_vector_get (extracted, i), NULL);
+ tab_double (t, c++, i + heading_rows, 0, gsl_vector_get (extracted, i), NULL, RC_OTHER);
}
tab_submit (t);
if ( fabs (x) < factor->blank)
continue;
- tab_double (t, heading_columns + j, heading_rows + i, 0, x, NULL);
+ tab_double (t, heading_columns + j, heading_rows + i, 0, x, NULL, RC_OTHER);
}
}
/* Initial Eigenvalues */
if (factor->print & PRINT_INITIAL)
{
- tab_double (t, c++, i + heading_rows, 0, i_lambda, NULL);
- tab_double (t, c++, i + heading_rows, 0, i_percent, NULL);
- tab_double (t, c++, i + heading_rows, 0, i_cum, NULL);
+ tab_double (t, c++, i + heading_rows, 0, i_lambda, NULL, RC_OTHER);
+ tab_double (t, c++, i + heading_rows, 0, i_percent, NULL, RC_OTHER);
+ tab_double (t, c++, i + heading_rows, 0, i_cum, NULL, RC_OTHER);
}
if (i < idata->n_extractions)
{
/* Sums of squared loadings */
- tab_double (t, c++, i + heading_rows, 0, e_lambda, NULL);
- tab_double (t, c++, i + heading_rows, 0, e_percent, NULL);
- tab_double (t, c++, i + heading_rows, 0, e_cum, NULL);
+ tab_double (t, c++, i + heading_rows, 0, e_lambda, NULL, RC_OTHER);
+ tab_double (t, c++, i + heading_rows, 0, e_percent, NULL, RC_OTHER);
+ tab_double (t, c++, i + heading_rows, 0, e_cum, NULL, RC_OTHER);
}
}
if (i < idata->n_extractions)
{
r_cum += r_percent;
- tab_double (t, c++, i + heading_rows, 0, r_lambda, NULL);
- tab_double (t, c++, i + heading_rows, 0, r_percent, NULL);
- tab_double (t, c++, i + heading_rows, 0, r_cum, NULL);
+ tab_double (t, c++, i + heading_rows, 0, r_lambda, NULL, RC_OTHER);
+ tab_double (t, c++, i + heading_rows, 0, r_percent, NULL, RC_OTHER);
+ tab_double (t, c++, i + heading_rows, 0, r_cum, NULL, RC_OTHER);
}
}
}
for (i = 0; i < factor->n_vars; ++i)
{
for (j = 0; j < factor->n_vars; ++j)
- tab_double (t, heading_columns + i, y + j, 0, gsl_matrix_get (idata->corr, i, j), NULL);
+ tab_double (t, heading_columns + i, y + j, 0, gsl_matrix_get (idata->corr, i, j), NULL, RC_OTHER);
}
}
if (i == j)
continue;
- tab_double (t, heading_columns + i, y + j, 0, significance_of_correlation (rho, w), NULL);
+ tab_double (t, heading_columns + i, y + j, 0, significance_of_correlation (rho, w), NULL, RC_PVALUE);
}
}
}
{
tab_text (t, 0, nr, TAB_LEFT | TAT_TITLE, _("Determinant"));
- tab_double (t, 1, nr, 0, idata->detR, NULL);
+ tab_double (t, 1, nr, 0, idata->detR, NULL, RC_OTHER);
}
tab_submit (t);
const int nr = heading_rows + factor->n_vars;
struct tab_table *t = tab_create (nc, nr);
+ tab_set_format (t, RC_WEIGHT, wfmt);
tab_title (t, _("Descriptive Statistics"));
tab_headers (t, heading_columns, 0, heading_rows, 0);
const struct variable *v = factor->vars[i];
tab_text (t, 0, i + heading_rows, TAB_LEFT | TAT_TITLE, var_to_string (v));
- tab_double (t, 1, i + heading_rows, 0, gsl_matrix_get (mean_matrix, i, i), NULL);
- tab_double (t, 2, i + heading_rows, 0, sqrt (gsl_matrix_get (var_matrix, i, i)), NULL);
- tab_double (t, 3, i + heading_rows, 0, gsl_matrix_get (idata->n, i, i), wfmt);
+ tab_double (t, 1, i + heading_rows, 0, gsl_matrix_get (mean_matrix, i, i), NULL, RC_OTHER);
+ tab_double (t, 2, i + heading_rows, 0, sqrt (gsl_matrix_get (var_matrix, i, i)), NULL, RC_OTHER);
+ tab_double (t, 3, i + heading_rows, 0, gsl_matrix_get (idata->n, i, i), NULL, RC_WEIGHT);
}
tab_submit (t);
tab_text (t, 0, 0, TAT_TITLE | TAB_LEFT, _("Kaiser-Meyer-Olkin Measure of Sampling Adequacy"));
- tab_double (t, 2, 0, 0, sum_ssq_r / (sum_ssq_r + sum_ssq_a), NULL);
+ tab_double (t, 2, 0, 0, sum_ssq_r / (sum_ssq_r + sum_ssq_a), NULL, RC_OTHER);
tab_text (t, 0, 1, TAT_TITLE | TAB_LEFT, _("Bartlett's Test of Sphericity"));
xsq = w - 1 - (2 * factor->n_vars + 5) / 6.0;
xsq *= -log (idata->detR);
- tab_double (t, 2, 1, 0, xsq, NULL);
- tab_double (t, 2, 2, 0, df, &F_8_0);
- tab_double (t, 2, 3, 0, gsl_cdf_chisq_Q (xsq, df), NULL);
+ tab_double (t, 2, 1, 0, xsq, NULL, RC_OTHER);
+ tab_double (t, 2, 2, 0, df, NULL, RC_INTEGER);
+ tab_double (t, 2, 3, 0, gsl_cdf_chisq_Q (xsq, df), NULL, RC_PVALUE);
tab_submit (t);
n_categories = ft->n_valid + ft->n_missing;
t = tab_create (6, n_categories + 2);
+ tab_set_format (t, RC_WEIGHT, wfmt);
tab_headers (t, 0, 0, 1, 0);
for (x = 0; x < 6; x++)
tab_text (t, 0, r, TAB_LEFT, label);
tab_value (t, 1, r, TAB_NONE, &f->value, vf->var, NULL);
- tab_double (t, 2, r, TAB_NONE, f->count, wfmt);
- tab_double (t, 3, r, TAB_NONE, percent, NULL);
- tab_double (t, 4, r, TAB_NONE, valid_percent, NULL);
- tab_double (t, 5, r, TAB_NONE, cum_total, NULL);
+ tab_double (t, 2, r, TAB_NONE, f->count, NULL, RC_WEIGHT);
+ tab_double (t, 3, r, TAB_NONE, percent, NULL, RC_OTHER);
+ tab_double (t, 4, r, TAB_NONE, valid_percent, NULL, RC_OTHER);
+ tab_double (t, 5, r, TAB_NONE, cum_total, NULL, RC_OTHER);
r++;
}
for (; f < &ft->valid[n_categories]; f++)
tab_text (t, 0, r, TAB_LEFT, label);
tab_value (t, 1, r, TAB_NONE, &f->value, vf->var, NULL);
- tab_double (t, 2, r, TAB_NONE, f->count, wfmt);
+ tab_double (t, 2, r, TAB_NONE, f->count, NULL, RC_WEIGHT);
tab_double (t, 3, r, TAB_NONE,
- f->count / ft->total_cases * 100.0, NULL);
+ f->count / ft->total_cases * 100.0, NULL, RC_OTHER);
tab_text (t, 4, r, TAB_NONE, _("Missing"));
r++;
}
tab_hline (t, TAL_2, 0, 5, r);
tab_joint_text (t, 0, r, 1, r, TAB_RIGHT | TAT_TITLE, _("Total"));
tab_vline (t, TAL_0, 1, r, r);
- tab_double (t, 2, r, TAB_NONE, cum_freq, wfmt);
- tab_fixed (t, 3, r, TAB_NONE, 100.0, 5, 1);
- tab_fixed (t, 4, r, TAB_NONE, 100.0, 5, 1);
+ tab_double (t, 2, r, TAB_NONE, cum_freq, NULL, RC_WEIGHT);
+ tab_double (t, 3, r, TAB_NONE, 100.0, &F_5_1, RC_OTHER);
+ tab_double (t, 4, r, TAB_NONE, 100.0, &F_5_1, RC_OTHER);
tab_title (t, "%s", var_to_string (vf->var));
tab_submit (t);
t = tab_create (3, ((frq->stats & FRQ_ST_MEDIAN) ? frq->n_stats - 1 : frq->n_stats)
+ frq->n_show_percentiles + 2);
-
+ tab_set_format (t, RC_WEIGHT, wfmt);
tab_box (t, TAL_1, TAL_1, -1, -1 , 0 , 0 , 2, tab_nr(t) - 1) ;
{
tab_text (t, 0, r, TAB_LEFT | TAT_TITLE,
gettext (st_name[i]));
- tab_double (t, 2, r, TAB_NONE, stat_value[i], NULL);
+ tab_double (t, 2, r, TAB_NONE, stat_value[i], NULL, RC_OTHER);
r++;
}
}
tab_text (t, 1, 0, TAB_LEFT | TAT_TITLE, _("Valid"));
tab_text (t, 1, 1, TAB_LEFT | TAT_TITLE, _("Missing"));
- 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);
+ tab_double (t, 2, 0, TAB_NONE, ft->valid_cases, NULL, RC_WEIGHT);
+ tab_double (t, 2, 1, TAB_NONE, ft->total_cases - ft->valid_cases, NULL, RC_WEIGHT);
for (i = 0; i < frq->n_percentiles; i++)
{
if (pc->p == 0.5)
tab_text (t, 1, r, TAB_LEFT, _("50 (Median)"));
else
- tab_fixed (t, 1, r, TAB_LEFT, pc->p * 100, 3, 0);
+ tab_double (t, 1, r, TAB_LEFT, pc->p * 100, NULL, RC_INTEGER);
tab_double (t, 2, r, TAB_NONE, pc->value,
- var_get_print_format (vf->var));
+ var_get_print_format (vf->var), RC_OTHER);
r++;
}
TAB_LEFT, var_to_string (ost->vars[i]));
tab_double (table, 1, row_headers + i,
- 0, fr->rank_sum[i] / fr->cc, 0);
+ 0, fr->rank_sum[i] / fr->cc, NULL, RC_OTHER);
}
tab_submit (table);
const int column_headers = 0;
struct tab_table *table =
tab_create (row_headers + 1, column_headers + (ft->kendalls_w ? 5 : 4));
+ tab_set_format (table, RC_WEIGHT, wfmt);
tab_headers (table, row_headers, 0, column_headers, 0);
row = 0;
tab_double (table, 1, column_headers + row++,
- 0, fr->cc, wfmt);
+ 0, fr->cc, NULL, RC_WEIGHT);
if (ft->kendalls_w)
tab_double (table, 1, column_headers + row++,
- 0, fr->w, 0);
+ 0, fr->w, NULL, RC_OTHER);
tab_double (table, 1, column_headers + row++,
- 0, fr->chi_sq, 0);
+ 0, fr->chi_sq, NULL, RC_OTHER);
tab_double (table, 1, column_headers + row++,
- 0, ost->n_vars - 1, &F_8_0);
+ 0, ost->n_vars - 1, NULL, RC_INTEGER);
tab_double (table, 1, column_headers + row++,
0, gsl_cdf_chisq_Q (fr->chi_sq, ost->n_vars - 1),
- 0);
+ NULL, RC_PVALUE);
tab_submit (table);
}
msg (MW, "GLM is experimental. Do not rely on these results.");
t = tab_create (nc, nr);
+ tab_set_format (t, RC_WEIGHT, wfmt);
tab_title (t, _("Tests of Between-Subjects Effects"));
tab_headers (t, heading_columns, 0, heading_rows, 0);
const double df = 1.0;
const double F = intercept_ssq / df / mse;
tab_text (t, 0, r, TAB_LEFT | TAT_TITLE, _("Intercept"));
- tab_double (t, 1, r, 0, intercept_ssq, NULL);
- tab_double (t, 2, r, 0, 1.00, wfmt);
- tab_double (t, 3, r, 0, intercept_ssq / df, NULL);
- tab_double (t, 4, r, 0, F, NULL);
+ tab_double (t, 1, r, 0, intercept_ssq, NULL, RC_OTHER);
+ tab_double (t, 2, r, 0, 1.00, NULL, RC_WEIGHT);
+ tab_double (t, 3, r, 0, intercept_ssq / df, NULL, RC_OTHER);
+ tab_double (t, 4, r, 0, F, NULL, RC_OTHER);
tab_double (t, 5, r, 0, gsl_cdf_fdist_Q (F, df, n_total - df_corr),
- NULL);
+ NULL, RC_PVALUE);
r++;
}
tab_text (t, 0, r, TAB_LEFT | TAT_TITLE, ds_cstr (&str));
ds_destroy (&str);
- tab_double (t, 1, r, 0, ssq, NULL);
- tab_double (t, 2, r, 0, df, wfmt);
- tab_double (t, 3, r, 0, ssq / df, NULL);
- tab_double (t, 4, r, 0, F, NULL);
+ tab_double (t, 1, r, 0, ssq, NULL, RC_OTHER);
+ tab_double (t, 2, r, 0, df, NULL, RC_WEIGHT);
+ tab_double (t, 3, r, 0, ssq / df, NULL, RC_OTHER);
+ tab_double (t, 4, r, 0, F, NULL, RC_OTHER);
tab_double (t, 5, r, 0, gsl_cdf_fdist_Q (F, df, n_total - df_corr),
- NULL);
+ NULL, RC_PVALUE);
r++;
}
ssq += intercept_ssq;
F = ssq / df / mse;
- tab_double (t, 1, heading_rows, 0, ssq, NULL);
- tab_double (t, 2, heading_rows, 0, df, wfmt);
- tab_double (t, 3, heading_rows, 0, ssq / df, NULL);
- tab_double (t, 4, heading_rows, 0, F, NULL);
+ tab_double (t, 1, heading_rows, 0, ssq, NULL, RC_OTHER);
+ tab_double (t, 2, heading_rows, 0, df, NULL, RC_WEIGHT);
+ tab_double (t, 3, heading_rows, 0, ssq / df, NULL, RC_OTHER);
+ tab_double (t, 4, heading_rows, 0, F, NULL, RC_OTHER);
tab_double (t, 5, heading_rows, 0,
- gsl_cdf_fdist_Q (F, df, n_total - df_corr), NULL);
+ gsl_cdf_fdist_Q (F, df, n_total - df_corr), NULL, RC_PVALUE);
}
{
const double ssq = gsl_vector_get (ws->ssq, 0);
const double mse = ssq / df;
tab_text (t, 0, r, TAB_LEFT | TAT_TITLE, _("Error"));
- tab_double (t, 1, r, 0, ssq, NULL);
- tab_double (t, 2, r, 0, df, wfmt);
- tab_double (t, 3, r++, 0, mse, NULL);
+ tab_double (t, 1, r, 0, ssq, NULL, RC_OTHER);
+ tab_double (t, 2, r, 0, df, NULL, RC_WEIGHT);
+ tab_double (t, 3, r++, 0, mse, NULL, RC_OTHER);
}
{
tab_text (t, 0, r, TAB_LEFT | TAT_TITLE, _("Total"));
- tab_double (t, 1, r, 0, ws->total_ssq + intercept_ssq, NULL);
- tab_double (t, 2, r, 0, n_total, wfmt);
+ tab_double (t, 1, r, 0, ws->total_ssq + intercept_ssq, NULL, RC_OTHER);
+ tab_double (t, 2, r, 0, n_total, NULL, RC_WEIGHT);
r++;
}
if (cmd->intercept)
{
tab_text (t, 0, r, TAB_LEFT | TAT_TITLE, _("Corrected Total"));
- tab_double (t, 1, r, 0, ws->total_ssq, NULL);
- tab_double (t, 2, r, 0, n_total - 1.0, wfmt);
+ tab_double (t, 1, r, 0, ws->total_ssq, NULL, RC_OTHER);
+ tab_double (t, 2, r, 0, n_total - 1.0, NULL, RC_WEIGHT);
}
tab_submit (t);
struct tab_table *table =
tab_create (row_headers + 7, column_headers + nst->n_vars);
+ tab_set_format (table, RC_WEIGHT, wfmt);
tab_headers (table, row_headers, 0, column_headers, 0);
var_to_string (nst->vars[i]) );
tab_double (table, 1, i + row_headers, TAT_TITLE,
- jt[0].levels, &F_8_0);
+ jt[0].levels, NULL, RC_INTEGER);
tab_double (table, 2, i + row_headers, TAT_TITLE,
- jt[0].n, wfmt);
+ jt[0].n, NULL, RC_WEIGHT);
tab_double (table, 3, i + row_headers, TAT_TITLE,
- jt[0].obs, 0);
+ jt[0].obs, NULL, RC_OTHER);
tab_double (table, 4, i + row_headers, TAT_TITLE,
- jt[0].mean, 0);
+ jt[0].mean, NULL, RC_OTHER);
tab_double (table, 5, i + row_headers, TAT_TITLE,
- jt[0].stddev, 0);
+ jt[0].stddev, NULL, RC_OTHER);
std_jt = (jt[0].obs - jt[0].mean) / jt[0].stddev;
tab_double (table, 6, i + row_headers, TAT_TITLE,
- std_jt, 0);
+ std_jt, NULL, RC_OTHER);
tab_double (table, 7, i + row_headers, TAT_TITLE,
- 2.0 * ((std_jt > 0) ? gsl_cdf_ugaussian_Q (std_jt) : gsl_cdf_ugaussian_P (std_jt)), 0);
+ 2.0 * ((std_jt > 0) ? gsl_cdf_ugaussian_Q (std_jt) : gsl_cdf_ugaussian_P (std_jt)), NULL, RC_PVALUE);
}
tab_submit (table);
var_append_value_name (nst->indep_var, &re->group, &str);
tab_text (table, 1, row, TAB_LEFT, ds_cstr (&str));
- tab_double (table, 2, row, TAB_LEFT, re->n, &F_8_0);
- tab_double (table, 3, row, TAB_LEFT, re->sum_of_ranks / re->n, 0);
+ tab_double (table, 2, row, TAB_LEFT, re->n, NULL, RC_INTEGER);
+ tab_double (table, 3, row, TAB_LEFT, re->sum_of_ranks / re->n, NULL, RC_OTHER);
tot += re->n;
row++;
}
tab_double (table, 2, row, TAB_LEFT,
- tot, &F_8_0);
+ tot, NULL, RC_INTEGER);
tab_text (table, 1, row++, TAB_LEFT, _("Total"));
}
);
tab_double (table, column_headers + 1 + i, 1, 0,
- kw[i].h, 0);
+ kw[i].h, NULL, RC_OTHER);
tab_double (table, column_headers + 1 + i, 2, 0,
- df, &F_8_0);
+ df, NULL, RC_INTEGER);
tab_double (table, column_headers + 1 + i, 3, 0,
gsl_cdf_chisq_Q (kw[i].h, df),
- 0);
+ NULL, RC_PVALUE);
}
tab_submit (table);
const int nc = kst->parent.n_vars + column_headers;
const int nr = 8 + row_headers;
struct tab_table *table = tab_create (nc, nr);
-
+ tab_set_format (table, RC_WEIGHT, wfmt);
tab_headers (table, row_headers, 0, column_headers, 0);
tab_title (table, _("One-Sample Kolmogorov-Smirnov Test"));
switch (kst->dist)
{
case KS_UNIFORM:
- tab_double (table, col, 1, 0, ks[i].obs_cc, wfmt);
- tab_double (table, col, 2, 0, ks[i].test_min, NULL);
- tab_double (table, col, 3, 0, ks[i].test_max, NULL);
+ tab_double (table, col, 1, 0, ks[i].obs_cc, NULL, RC_WEIGHT);
+ tab_double (table, col, 2, 0, ks[i].test_min, NULL, RC_OTHER);
+ tab_double (table, col, 3, 0, ks[i].test_max, NULL, RC_OTHER);
break;
case KS_NORMAL:
- tab_double (table, col, 1, 0, ks[i].obs_cc, wfmt);
- tab_double (table, col, 2, 0, ks[i].mu, NULL);
- tab_double (table, col, 3, 0, ks[i].sigma, NULL);
+ tab_double (table, col, 1, 0, ks[i].obs_cc, NULL, RC_WEIGHT);
+ tab_double (table, col, 2, 0, ks[i].mu, NULL, RC_OTHER);
+ tab_double (table, col, 3, 0, ks[i].sigma, NULL, RC_OTHER);
break;
case KS_POISSON:
case KS_EXPONENTIAL:
- tab_double (table, col, 1, 0, ks[i].obs_cc, wfmt);
- tab_double (table, col, 2, 0, ks[i].mu, NULL);
+ tab_double (table, col, 1, 0, ks[i].obs_cc, NULL, RC_WEIGHT);
+ tab_double (table, col, 2, 0, ks[i].mu, NULL, RC_OTHER);
break;
default:
z = sqrt (ks[i].obs_cc) * abs;
- tab_double (table, col, 5, 0, ks[i].diff_pos, NULL);
- tab_double (table, col, 6, 0, ks[i].diff_neg, NULL);
+ tab_double (table, col, 5, 0, ks[i].diff_pos, NULL, RC_OTHER);
+ tab_double (table, col, 6, 0, ks[i].diff_neg, NULL, RC_OTHER);
- tab_double (table, col, 4, 0, abs, NULL);
+ tab_double (table, col, 4, 0, abs, NULL, RC_OTHER);
- tab_double (table, col, 7, 0, z, NULL);
- tab_double (table, col, 8, 0, ks_asymp_sig (z), NULL);
+ tab_double (table, col, 7, 0, z, NULL, RC_OTHER);
+ tab_double (table, col, 8, 0, ks_asymp_sig (z), NULL, RC_PVALUE);
}
tab_text (t, 0, 1 + heading_rows, 0, ds_cstr (&str));
- tab_double (t, 1, 0 + heading_rows, 0, map_dependent_var (cmd, res, &res->y0), &F_8_0);
- tab_double (t, 1, 1 + heading_rows, 0, map_dependent_var (cmd, res, &res->y1), &F_8_0);
+ tab_double (t, 1, 0 + heading_rows, 0, map_dependent_var (cmd, res, &res->y0), NULL, RC_INTEGER);
+ tab_double (t, 1, 1 + heading_rows, 0, map_dependent_var (cmd, res, &res->y1), NULL, RC_INTEGER);
ds_destroy (&str);
tab_submit (t);
gsl_blas_dgemv (CblasTrans, 1.0, subhessian, &vv.vector, 0, temp);
gsl_blas_ddot (temp, &vv.vector, &wald);
- tab_double (t, 4, row, 0, wald, 0);
- tab_double (t, 5, row, 0, df, &F_8_0);
- tab_double (t, 6, row, 0, gsl_cdf_chisq_Q (wald, df), 0);
+ tab_double (t, 4, row, 0, wald, NULL, RC_OTHER);
+ tab_double (t, 5, row, 0, df, NULL, RC_INTEGER);
+ tab_double (t, 6, row, 0, gsl_cdf_chisq_Q (wald, df), NULL, RC_PVALUE);
idx_correction ++;
summary = true;
tab_text (t, 1, row, TAB_LEFT | TAT_TITLE, _("Constant"));
}
- tab_double (t, 2, row, 0, b, 0);
- tab_double (t, 3, row, 0, sqrt (sigma2), 0);
- tab_double (t, 4, row, 0, wald, 0);
- tab_double (t, 5, row, 0, df, &F_8_0);
- tab_double (t, 6, row, 0, gsl_cdf_chisq_Q (wald, df), 0);
- tab_double (t, 7, row, 0, exp (b), 0);
+ tab_double (t, 2, row, 0, b, NULL, RC_OTHER);
+ tab_double (t, 3, row, 0, sqrt (sigma2), NULL, RC_OTHER);
+ tab_double (t, 4, row, 0, wald, NULL, RC_OTHER);
+ tab_double (t, 5, row, 0, df, NULL, RC_INTEGER);
+ tab_double (t, 6, row, 0, gsl_cdf_chisq_Q (wald, df), NULL, RC_PVALUE);
+ tab_double (t, 7, row, 0, exp (b), NULL, RC_OTHER);
if (cmd->print & PRINT_CI)
{
if (row < last_ci)
{
- tab_double (t, 8, row, 0, exp (b - wc), 0);
- tab_double (t, 9, row, 0, exp (b + wc), 0);
+ tab_double (t, 8, row, 0, exp (b - wc), NULL, RC_OTHER);
+ tab_double (t, 9, row, 0, exp (b + wc), NULL, RC_OTHER);
}
}
}
tab_text (t, 0, 0, TAB_LEFT | TAT_TITLE, _("Step 1"));
tab_text (t, 1, 0, TAB_CENTER | TAT_TITLE, _("-2 Log likelihood"));
- tab_double (t, 1, 1, 0, -2 * log_likelihood, 0);
+ tab_double (t, 1, 1, 0, -2 * log_likelihood, NULL, RC_OTHER);
tab_text (t, 2, 0, TAB_CENTER | TAT_TITLE, _("Cox & Snell R Square"));
cox = 1.0 - exp((initial_log_likelihood - log_likelihood) * (2 / res->cc));
- tab_double (t, 2, 1, 0, cox, 0);
+ tab_double (t, 2, 1, 0, cox, NULL, RC_OTHER);
tab_text (t, 3, 0, TAB_CENTER | TAT_TITLE, _("Nagelkerke R Square"));
- tab_double (t, 3, 1, 0, cox / ( 1.0 - exp(initial_log_likelihood * (2 / res->cc))), 0);
+ tab_double (t, 3, 1, 0, cox / ( 1.0 - exp(initial_log_likelihood * (2 / res->cc))), NULL, RC_OTHER);
tab_submit (t);
tab_text (t, 0, 2, TAB_LEFT | TAT_TITLE, _("Missing Cases"));
tab_text (t, 0, 3, TAB_LEFT | TAT_TITLE, _("Total"));
- tab_double (t, 1, 1, 0, res->n_nonmissing, &F_8_0);
- tab_double (t, 1, 2, 0, res->n_missing, &F_8_0);
+ tab_double (t, 1, 1, 0, res->n_nonmissing, NULL, RC_INTEGER);
+ tab_double (t, 1, 2, 0, res->n_missing, NULL, RC_INTEGER);
total = res->n_nonmissing + res->n_missing;
- tab_double (t, 1, 3, 0, total , &F_8_0);
+ tab_double (t, 1, 3, 0, total , NULL, RC_INTEGER);
- tab_double (t, 2, 1, 0, 100 * res->n_nonmissing / (double) total, 0);
- tab_double (t, 2, 2, 0, 100 * res->n_missing / (double) total, 0);
- tab_double (t, 2, 3, 0, 100 * total / (double) total, 0);
+ tab_double (t, 2, 1, 0, 100 * res->n_nonmissing / (double) total, NULL, RC_OTHER);
+ tab_double (t, 2, 2, 0, 100 * res->n_missing / (double) total, NULL, RC_OTHER);
+ tab_double (t, 2, 3, 0, 100 * total / (double) total, NULL, RC_OTHER);
tab_submit (t);
}
nr = heading_rows + total_cats;
t = tab_create (nc, nr);
+ tab_set_format (t, RC_WEIGHT, wfmt);
+
tab_title (t, _("Categorical Variables' Codings"));
tab_headers (t, heading_columns, 0, heading_rows, 0);
tab_text (t, 1, heading_rows + r, 0, ds_cstr (&str));
ds_destroy (&str);
- tab_double (t, 2, heading_rows + r, 0, *freq, wfmt);
+ tab_double (t, 2, heading_rows + r, 0, *freq, NULL, RC_WEIGHT);
for (x = 0; x < df; ++x)
{
- tab_double (t, heading_columns + 1 + x, heading_rows + r, 0, (cat == x), &F_8_0);
+ tab_double (t, heading_columns + 1 + x, heading_rows + r, 0, (cat == x), NULL, RC_INTEGER);
}
++r;
}
const int nr = heading_rows + 3;
struct tab_table *t = tab_create (nc, nr);
+ tab_set_format (t, RC_WEIGHT, wfmt);
ds_init_empty (&sv0);
ds_init_empty (&sv1);
ds_destroy (&sv0);
ds_destroy (&sv1);
- tab_double (t, heading_columns, 3, 0, res->tn, wfmt);
- tab_double (t, heading_columns + 1, 4, 0, res->tp, wfmt);
+ tab_double (t, heading_columns, 3, 0, res->tn, NULL, RC_WEIGHT);
+ tab_double (t, heading_columns + 1, 4, 0, res->tp, NULL, RC_WEIGHT);
- tab_double (t, heading_columns + 1, 3, 0, res->fp, wfmt);
- tab_double (t, heading_columns, 4, 0, res->fn, wfmt);
+ tab_double (t, heading_columns + 1, 3, 0, res->fp, NULL, RC_WEIGHT);
+ tab_double (t, heading_columns, 4, 0, res->fn, NULL, RC_WEIGHT);
- tab_double (t, heading_columns + 2, 3, 0, 100 * res->tn / (res->tn + res->fp), 0);
- tab_double (t, heading_columns + 2, 4, 0, 100 * res->tp / (res->tp + res->fn), 0);
+ tab_double (t, heading_columns + 2, 3, 0, 100 * res->tn / (res->tn + res->fp), NULL, RC_OTHER);
+ tab_double (t, heading_columns + 2, 4, 0, 100 * res->tp / (res->tp + res->fn), NULL, RC_OTHER);
tab_double (t, heading_columns + 2, 5, 0,
- 100 * (res->tp + res->tn) / (res->tp + res->tn + res->fp + res->fn), 0);
+ 100 * (res->tp + res->tn) / (res->tp + res->tn + res->fp + res->fn), NULL, RC_OTHER);
tab_submit (t);
var_to_string (nst->vars[i]));
tab_double (table, 1, column_headers + i, 0,
- mw->n[0], 0);
+ mw->n[0], NULL, RC_OTHER);
tab_double (table, 2, column_headers + i, 0,
- mw->n[1], 0);
+ mw->n[1], NULL, RC_OTHER);
tab_double (table, 3, column_headers + i, 0,
- mw->n[1] + mw->n[0], 0);
+ mw->n[1] + mw->n[0], NULL, RC_OTHER);
/* Mean Ranks */
tab_double (table, 4, column_headers + i, 0,
- mw->rank_sum[0] / mw->n[0], 0);
+ mw->rank_sum[0] / mw->n[0], NULL, RC_OTHER);
tab_double (table, 5, column_headers + i, 0,
- mw->rank_sum[1] / mw->n[1], 0);
+ mw->rank_sum[1] / mw->n[1], NULL, RC_OTHER);
/* Sum of Ranks */
tab_double (table, 6, column_headers + i, 0,
- mw->rank_sum[0], 0);
+ mw->rank_sum[0], NULL, RC_OTHER);
tab_double (table, 7, column_headers + i, 0,
- mw->rank_sum[1], 0);
+ mw->rank_sum[1], NULL, RC_OTHER);
}
tab_submit (table);
var_to_string (nst->vars[i]));
tab_double (table, 1, column_headers + i, 0,
- mw->u, 0);
+ mw->u, NULL, RC_OTHER);
tab_double (table, 2, column_headers + i, 0,
- mw->w, 0);
+ mw->w, NULL, RC_OTHER);
tab_double (table, 3, column_headers + i, 0,
- mw->z, 0);
+ mw->z, NULL, RC_OTHER);
tab_double (table, 4, column_headers + i, 0,
- 2.0 * gsl_cdf_ugaussian_P (mw->z), 0);
+ 2.0 * gsl_cdf_ugaussian_P (mw->z), NULL, RC_PVALUE);
}
tab_submit (table);
struct string val1str ;
struct string val0str ;
+ tab_set_format (table, RC_WEIGHT, wfmt);
+
ds_init_empty (&val0str);
ds_init_empty (&val1str);
tab_text (table, header_cols + 0, 1, TAB_LEFT, ds_cstr (&val0str));
tab_text (table, header_cols + 1, 1, TAB_LEFT, ds_cstr (&val1str));
- tab_double (table, header_cols + 0, header_rows + 0, TAB_RIGHT, param->n00, wfmt);
- tab_double (table, header_cols + 0, header_rows + 1, TAB_RIGHT, param->n01, wfmt);
- tab_double (table, header_cols + 1, header_rows + 0, TAB_RIGHT, param->n10, wfmt);
- tab_double (table, header_cols + 1, header_rows + 1, TAB_RIGHT, param->n11, wfmt);
+ tab_double (table, header_cols + 0, header_rows + 0, TAB_RIGHT, param->n00, NULL, RC_WEIGHT);
+ tab_double (table, header_cols + 0, header_rows + 1, TAB_RIGHT, param->n01, NULL, RC_WEIGHT);
+ tab_double (table, header_cols + 1, header_rows + 0, TAB_RIGHT, param->n10, NULL, RC_WEIGHT);
+ tab_double (table, header_cols + 1, header_rows + 1, TAB_RIGHT, param->n11, NULL, RC_WEIGHT);
tab_submit (table);
const struct fmt_spec *wfmt = wv ? var_get_print_format (wv) : & F_8_0;
tab_title (table, _("Test Statistics"));
+ tab_set_format (table, RC_WEIGHT, wfmt);
tab_headers (table, 0, 1, 0, 1);
tab_text (table, 0, 1 + i, TAB_LEFT, ds_cstr (&pair_name));
ds_destroy (&pair_name);
- tab_double (table, 1, 1 + i, TAB_RIGHT, mc[i].n00 + mc[i].n01 + mc[i].n10 + mc[i].n11, wfmt);
+ tab_double (table, 1, 1 + i, TAB_RIGHT, mc[i].n00 + mc[i].n01 + mc[i].n10 + mc[i].n11, NULL, RC_WEIGHT);
sig = gsl_cdf_binomial_P (mc[i].n01, 0.5, mc[i].n01 + mc[i].n10);
- tab_double (table, 2, 1 + i, TAB_RIGHT, 2 * sig, NULL);
- tab_double (table, 3, 1 + i, TAB_RIGHT, sig, NULL);
+ tab_double (table, 2, 1 + i, TAB_RIGHT, 2 * sig, NULL, RC_PVALUE);
+ tab_double (table, 3, 1 + i, TAB_RIGHT, sig, NULL, RC_PVALUE);
tab_double (table, 4, 1 + i, TAB_RIGHT, gsl_ran_binomial_pdf (mc[i].n01, 0.5, mc[i].n01 + mc[i].n10),
- NULL);
+ NULL, RC_OTHER);
}
tab_submit (table);
table->summary[row].non_missing;
tab_double (t, 1, row + heading_rows,
- 0, table->summary[row].non_missing, &F_8_0);
+ 0, table->summary[row].non_missing, NULL, RC_INTEGER);
tab_text_format (t, 2, row + heading_rows,
0, _("%g%%"),
tab_double (t, 3, row + heading_rows,
- 0, table->summary[row].missing, &F_8_0);
+ 0, table->summary[row].missing, NULL, RC_INTEGER);
tab_text_format (t, 4, row + heading_rows,
tab_double (t, 5, row + heading_rows,
0, table->summary[row].missing +
- table->summary[row].non_missing, &F_8_0);
+ table->summary[row].non_missing, NULL, RC_INTEGER);
tab_text_format (t, 6, row + heading_rows,
0, _("%g%%"),
tab_double (t, heading_columns + i,
heading_rows + grp + dv * n_cats,
- 0, result, 0);
+ 0, result, NULL, RC_OTHER);
}
}
}
const int nr = column_headers + nst->n_vars * 2;
struct tab_table *table = tab_create (nc, nr);
+ tab_set_format (table, RC_WEIGHT, wfmt);
tab_headers (table, row_headers, 0, column_headers, 0);
{
const struct val_node *vn = rs->sorted_array[i];
tab_double (table, row_headers + i, column_headers + v * 2,
- 0, vn->gt, wfmt);
+ 0, vn->gt, NULL, RC_WEIGHT);
tab_double (table, row_headers + i, column_headers + v * 2 + 1,
- 0, vn->le, wfmt);
+ 0, vn->le, NULL, RC_WEIGHT);
}
}
const int nr = column_headers + nst->n_vars;
struct tab_table *table = tab_create (nc, nr);
+ tab_set_format (table, RC_WEIGHT, wfmt);
tab_headers (table, row_headers, 0, column_headers, 0);
tab_double (table, row_headers + 0, column_headers + v,
- 0, rs->n, wfmt);
+ 0, rs->n, NULL, RC_WEIGHT);
tab_double (table, row_headers + 1, column_headers + v,
- 0, rs->median, NULL);
+ 0, rs->median, NULL, RC_OTHER);
tab_double (table, row_headers + 2, column_headers + v,
- 0, rs->chisq, NULL);
+ 0, rs->chisq, NULL, RC_OTHER);
tab_double (table, row_headers + 3, column_headers + v,
- 0, df, wfmt);
+ 0, df, NULL, RC_WEIGHT);
tab_double (table, row_headers + 4, column_headers + v,
- 0, gsl_cdf_chisq_Q (rs->chisq, df), NULL);
+ 0, gsl_cdf_chisq_Q (rs->chisq, df), NULL, RC_PVALUE);
}
tab_submit (table);
col = 1;
if (desc != NULL)
{
- tab_double (table, col++, 2 + v, 0, desc[v].n, fmt);
- tab_double (table, col++, 2 + v, 0, desc[v].mean, fmt);
- tab_double (table, col++, 2 + v, 0, desc[v].std_dev, fmt);
- tab_double (table, col++, 2 + v, 0, desc[v].min, fmt);
- tab_double (table, col++, 2 + v, 0, desc[v].max, fmt);
+ tab_double (table, col++, 2 + v, 0, desc[v].n, fmt, RC_OTHER);
+ tab_double (table, col++, 2 + v, 0, desc[v].mean, fmt, RC_OTHER);
+ tab_double (table, col++, 2 + v, 0, desc[v].std_dev, fmt, RC_OTHER);
+ tab_double (table, col++, 2 + v, 0, desc[v].min, fmt, RC_OTHER);
+ tab_double (table, col++, 2 + v, 0, desc[v].max, fmt, RC_OTHER);
}
}
/* Sums of Squares */
- tab_double (t, 2, i * 3 + 1, 0, pvw->ssa, NULL);
- tab_double (t, 2, i * 3 + 3, 0, pvw->sst, NULL);
- tab_double (t, 2, i * 3 + 2, 0, pvw->sse, NULL);
+ tab_double (t, 2, i * 3 + 1, 0, pvw->ssa, NULL, RC_OTHER);
+ tab_double (t, 2, i * 3 + 3, 0, pvw->sst, NULL, RC_OTHER);
+ tab_double (t, 2, i * 3 + 2, 0, pvw->sse, NULL, RC_OTHER);
/* Degrees of freedom */
- 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, n - 1, 4, 0);
+ tab_double (t, 3, i * 3 + 1, 0, df1, NULL, RC_INTEGER);
+ tab_double (t, 3, i * 3 + 2, 0, df2, NULL, RC_INTEGER);
+ tab_double (t, 3, i * 3 + 3, 0, n - 1, NULL, RC_INTEGER);
/* Mean Squares */
- tab_double (t, 4, i * 3 + 1, TAB_RIGHT, msa, NULL);
- tab_double (t, 4, i * 3 + 2, TAB_RIGHT, pvw->mse, NULL);
+ tab_double (t, 4, i * 3 + 1, TAB_RIGHT, msa, NULL, RC_OTHER);
+ tab_double (t, 4, i * 3 + 2, TAB_RIGHT, pvw->mse, NULL, RC_OTHER);
{
const double F = msa / pvw->mse ;
/* The F value */
- tab_double (t, 5, i * 3 + 1, 0, F, NULL);
+ tab_double (t, 5, i * 3 + 1, 0, F, NULL, RC_OTHER);
/* The significance */
- tab_double (t, 6, i * 3 + 1, 0, gsl_cdf_fdist_Q (F, df1, df2), NULL);
+ tab_double (t, 6, i * 3 + 1, 0, gsl_cdf_fdist_Q (F, df1, df2), NULL, RC_PVALUE);
}
}
n_rows += ws->actual_number_of_groups + 1;
t = tab_create (n_cols, n_rows);
+ tab_set_format (t, RC_WEIGHT, wfmt);
tab_headers (t, 2, 0, 2, 0);
/* Put a frame around the entire box, and vertical lines inside */
/* Now fill in the numbers ... */
- tab_double (t, 2, row + count, 0, n, wfmt);
+ tab_double (t, 2, row + count, 0, n, NULL, RC_WEIGHT);
- tab_double (t, 3, row + count, 0, mean, NULL);
+ tab_double (t, 3, row + count, 0, mean, NULL, RC_OTHER);
- tab_double (t, 4, row + count, 0, std_dev, NULL);
+ tab_double (t, 4, row + count, 0, std_dev, NULL, RC_OTHER);
- tab_double (t, 5, row + count, 0, std_error, NULL);
+ tab_double (t, 5, row + count, 0, std_error, NULL, RC_OTHER);
/* Now the confidence interval */
T = gsl_cdf_tdist_Qinv (q, n - 1);
tab_double (t, 6, row + count, 0,
- mean - T * std_error, NULL);
+ mean - T * std_error, NULL, RC_OTHER);
tab_double (t, 7, row + count, 0,
- mean + T * std_error, NULL);
+ mean + T * std_error, NULL, RC_OTHER);
/* Min and Max */
- tab_double (t, 8, row + count, 0, dd->minimum, fmt);
- tab_double (t, 9, row + count, 0, dd->maximum, fmt);
+ tab_double (t, 8, row + count, 0, dd->minimum, fmt, RC_OTHER);
+ tab_double (t, 9, row + count, 0, dd->maximum, fmt, RC_OTHER);
}
if (categoricals_is_complete (cats))
tab_text (t, 1, row + count,
TAB_LEFT | TAT_TITLE, _("Total"));
- tab_double (t, 2, row + count, 0, n, wfmt);
+ tab_double (t, 2, row + count, 0, n, NULL, RC_WEIGHT);
- tab_double (t, 3, row + count, 0, mean, NULL);
+ tab_double (t, 3, row + count, 0, mean, NULL, RC_OTHER);
- tab_double (t, 4, row + count, 0, std_dev, NULL);
+ tab_double (t, 4, row + count, 0, std_dev, NULL, RC_OTHER);
- tab_double (t, 5, row + count, 0, std_error, NULL);
+ tab_double (t, 5, row + count, 0, std_error, NULL, RC_OTHER);
/* Now the confidence interval */
T = gsl_cdf_tdist_Qinv (q, n - 1);
tab_double (t, 6, row + count, 0,
- mean - T * std_error, NULL);
+ mean - T * std_error, NULL, RC_OTHER);
tab_double (t, 7, row + count, 0,
- mean + T * std_error, NULL);
+ mean + T * std_error, NULL, RC_OTHER);
/* Min and Max */
- tab_double (t, 8, row + count, 0, ws->dd_total[v]->minimum, fmt);
- tab_double (t, 9, row + count, 0, ws->dd_total[v]->maximum, fmt);
+ tab_double (t, 8, row + count, 0, ws->dd_total[v]->minimum, fmt, RC_OTHER);
+ tab_double (t, 9, row + count, 0, ws->dd_total[v]->maximum, fmt, RC_OTHER);
}
row += categoricals_n_total (cats) + 1;
tab_text (t, 0, v + 1, TAB_LEFT | TAT_TITLE, s);
- 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);
+ tab_double (t, 1, v + 1, TAB_RIGHT, F, NULL, RC_OTHER);
+ tab_double (t, 2, v + 1, TAB_RIGHT, df1, NULL, RC_INTEGER);
+ tab_double (t, 3, v + 1, TAB_RIGHT, df2, NULL, RC_INTEGER);
/* Now the significance */
- tab_double (t, 4, v + 1, TAB_RIGHT, gsl_cdf_fdist_Q (F, df1, df2), NULL);
+ tab_double (t, 4, v + 1, TAB_RIGHT, gsl_cdf_fdist_Q (F, df1, df2), NULL, RC_PVALUE);
}
tab_submit (t);
df_numerator = pow2 (df_numerator);
tab_double (t, 3, (v * lines_per_variable) + i + 1,
- TAB_RIGHT, contrast_value, NULL);
+ TAB_RIGHT, contrast_value, NULL, RC_OTHER);
tab_double (t, 3, (v * lines_per_variable) + i + 1 +
n_contrasts,
- TAB_RIGHT, contrast_value, NULL);
+ TAB_RIGHT, contrast_value, NULL, RC_OTHER);
std_error_contrast = sqrt (pvw->mse * coef_msq);
/* Std. Error */
tab_double (t, 4, (v * lines_per_variable) + i + 1,
TAB_RIGHT, std_error_contrast,
- NULL);
+ NULL, RC_OTHER);
T = fabs (contrast_value / std_error_contrast);
tab_double (t, 5, (v * lines_per_variable) + i + 1,
TAB_RIGHT, T,
- NULL);
+ NULL, RC_OTHER);
/* Degrees of Freedom */
- tab_fixed (t, 6, (v * lines_per_variable) + i + 1,
- TAB_RIGHT, df,
- 8, 0);
+ tab_double (t, 6, (v * lines_per_variable) + i + 1,
+ TAB_RIGHT, df, NULL, RC_INTEGER);
/* Significance TWO TAILED !!*/
tab_double (t, 7, (v * lines_per_variable) + i + 1,
TAB_RIGHT, 2 * gsl_cdf_tdist_Q (T, df),
- NULL);
+ NULL, RC_PVALUE);
/* Now for the Variances NOT Equal case */
tab_double (t, 4,
(v * lines_per_variable) + i + 1 + n_contrasts,
TAB_RIGHT, sec_vneq,
- NULL);
+ NULL, RC_OTHER);
T = contrast_value / sec_vneq;
tab_double (t, 5,
(v * lines_per_variable) + i + 1 + n_contrasts,
TAB_RIGHT, T,
- NULL);
+ NULL, RC_OTHER);
df = df_numerator / df_denominator;
tab_double (t, 6,
(v * lines_per_variable) + i + 1 + n_contrasts,
TAB_RIGHT, df,
- NULL);
+ NULL, RC_OTHER);
{
double p = gsl_cdf_tdist_P (T, df);
/* The Significance */
tab_double (t, 7, (v * lines_per_variable) + i + 1 + n_contrasts,
TAB_RIGHT, 2 * ((T > 0) ? q : p),
- NULL);
+ NULL, RC_PVALUE);
}
}
moments1_calculate (dd_j->mom, &weight_j, &mean_j, &var_j, 0, 0);
- tab_double (t, 3, r + rx, 0, mean_i - mean_j, 0);
+ tab_double (t, 3, r + rx, 0, mean_i - mean_j, NULL, RC_OTHER);
std_err = pvw->mse;
std_err *= weight_i + weight_j;
std_err /= weight_i * weight_j;
std_err = sqrt (std_err);
- tab_double (t, 4, r + rx, 0, std_err, 0);
+ tab_double (t, 4, r + rx, 0, std_err, NULL, RC_OTHER);
- tab_double (t, 5, r + rx, 0, 2 * multiple_comparison_sig (std_err, pvw, dd_i, dd_j, ph), 0);
+ tab_double (t, 5, r + rx, 0, 2 * multiple_comparison_sig (std_err, pvw, dd_i, dd_j, ph), NULL, RC_PVALUE);
half_range = mc_half_range (cmd, pvw, std_err, dd_i, dd_j, ph);
tab_double (t, 6, r + rx, 0,
- (mean_i - mean_j) - half_range, 0 );
+ (mean_i - mean_j) - half_range, NULL, RC_OTHER);
tab_double (t, 7, r + rx, 0,
- (mean_i - mean_j) + half_range, 0 );
+ (mean_i - mean_j) + half_range, NULL, RC_OTHER);
rx++;
}
tab_double (t, i + 1, j + 4, TAB_CENTER,
gsl_matrix_get (kmeans->centers,
kmeans->group_order->data[i], j),
- var_get_print_format (qc->vars[j]));
+ var_get_print_format (qc->vars[j]), RC_OTHER);
}
else
{
tab_double (t, i + 1, j + 4, TAB_CENTER,
gsl_matrix_get (kmeans->initial_centers,
kmeans->group_order->data[i], j),
- var_get_print_format (qc->vars[j]));
+ var_get_print_format (qc->vars[j]), RC_OTHER);
}
}
}
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_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_double (t, 1, 1, TAB_RIGHT, sqrt (rsq), NULL, RC_OTHER);
+ tab_double (t, 2, 1, TAB_RIGHT, rsq, NULL, RC_OTHER);
+ tab_double (t, 3, 1, TAB_RIGHT, adjrsq, NULL, RC_OTHER);
+ tab_double (t, 4, 1, TAB_RIGHT, std_error, NULL, RC_OTHER);
tab_title (t, _("Model Summary (%s)"), var_to_string (var));
tab_submit (t);
}
tab_text (t, 5, 1, TAB_CENTER | TAT_TITLE, _("t"));
tab_text (t, 6, 1, TAB_CENTER | TAT_TITLE, _("Sig."));
tab_text (t, 1, heading_rows, TAB_LEFT | TAT_TITLE, _("(Constant)"));
- tab_double (t, 2, heading_rows, 0, linreg_intercept (c), NULL);
+ tab_double (t, 2, heading_rows, 0, linreg_intercept (c), NULL, RC_OTHER);
std_err = sqrt (gsl_matrix_get (linreg_cov (c), 0, 0));
if (cmd->stats & STATS_CI)
{
double lower = linreg_intercept (c) - tval * std_err ;
double upper = linreg_intercept (c) + tval * std_err ;
- tab_double (t, 7, heading_rows, 0, lower, NULL);
- tab_double (t, 8, heading_rows, 0, upper, NULL);
+ tab_double (t, 7, heading_rows, 0, lower, NULL, RC_OTHER);
+ tab_double (t, 8, heading_rows, 0, upper, NULL, RC_OTHER);
tab_joint_text_format (t, 7, 0, 8, 0, TAB_CENTER | TAT_TITLE, _("%g%% Confidence Interval for B"), cmd->ci * 100);
tab_hline (t, TAL_1, 7, 8, 1);
tab_text (t, 7, 1, TAB_CENTER | TAT_TITLE, _("Lower Bound"));
tab_text (t, 8, 1, TAB_CENTER | TAT_TITLE, _("Upper Bound"));
}
- tab_double (t, 3, heading_rows, 0, std_err, NULL);
- tab_double (t, 4, heading_rows, 0, 0.0, NULL);
+ tab_double (t, 3, heading_rows, 0, std_err, NULL, RC_OTHER);
+ tab_double (t, 4, heading_rows, 0, 0.0, NULL, RC_OTHER);
t_stat = linreg_intercept (c) / std_err;
- tab_double (t, 5, heading_rows, 0, t_stat, NULL);
+ tab_double (t, 5, heading_rows, 0, t_stat, NULL, RC_OTHER);
pval =
2 * gsl_cdf_tdist_Q (fabs (t_stat),
(double) (linreg_n_obs (c) - linreg_n_coeffs (c)));
- tab_double (t, 6, heading_rows, 0, pval, NULL);
+ tab_double (t, 6, heading_rows, 0, pval, NULL, RC_PVALUE);
for (j = 0; j < linreg_n_coeffs (c); j++)
{
/*
Regression coefficients.
*/
- tab_double (t, 2, this_row, 0, linreg_coeff (c, j), NULL);
+ tab_double (t, 2, this_row, 0, linreg_coeff (c, j), NULL, RC_OTHER);
/*
Standard error of the coefficients.
*/
std_err = sqrt (gsl_matrix_get (linreg_cov (c), j + 1, j + 1));
- tab_double (t, 3, this_row, 0, std_err, NULL);
+ tab_double (t, 3, this_row, 0, std_err, NULL, RC_OTHER);
/*
Standardized coefficient, i.e., regression coefficient
if all variables had unit variance.
beta = sqrt (gsl_matrix_get (cov, j, j));
beta *= linreg_coeff (c, j) /
sqrt (gsl_matrix_get (cov, cov->size1 - 1, cov->size2 - 1));
- tab_double (t, 4, this_row, 0, beta, NULL);
+ tab_double (t, 4, this_row, 0, beta, NULL, RC_OTHER);
/*
Test statistic for H0: coefficient is 0.
*/
t_stat = linreg_coeff (c, j) / std_err;
- tab_double (t, 5, this_row, 0, t_stat, NULL);
+ tab_double (t, 5, this_row, 0, t_stat, NULL, RC_OTHER);
/*
P values for the test statistic above.
*/
pval = 2 * gsl_cdf_tdist_Q (fabs (t_stat), df);
- tab_double (t, 6, this_row, 0, pval, NULL);
+ tab_double (t, 6, this_row, 0, pval, NULL, RC_PVALUE);
ds_destroy (&tstr);
if (cmd->stats & STATS_CI)
double lower = linreg_coeff (c, j) - tval * std_err ;
double upper = linreg_coeff (c, j) + tval * std_err ;
- tab_double (t, 7, this_row, 0, lower, NULL);
- tab_double (t, 8, this_row, 0, upper, NULL);
+ tab_double (t, 7, this_row, 0, lower, NULL, RC_OTHER);
+ tab_double (t, 8, this_row, 0, upper, NULL, RC_OTHER);
}
}
tab_title (t, _("Coefficients (%s)"), var_to_string (var));
tab_text (t, 1, 3, TAB_LEFT | TAT_TITLE, _("Total"));
/* Sums of Squares */
- tab_double (t, 2, 1, 0, linreg_ssreg (c), NULL);
- tab_double (t, 2, 3, 0, linreg_sst (c), NULL);
- tab_double (t, 2, 2, 0, linreg_sse (c), NULL);
+ tab_double (t, 2, 1, 0, linreg_ssreg (c), NULL, RC_OTHER);
+ tab_double (t, 2, 3, 0, linreg_sst (c), NULL, RC_OTHER);
+ tab_double (t, 2, 2, 0, linreg_sse (c), NULL, RC_OTHER);
/* Degrees of freedom */
tab_text_format (t, 3, 3, TAB_RIGHT, "%.*g", DBL_DIG + 1, c->dft);
/* Mean Squares */
- tab_double (t, 4, 1, TAB_RIGHT, msm, NULL);
- tab_double (t, 4, 2, TAB_RIGHT, mse, NULL);
+ tab_double (t, 4, 1, TAB_RIGHT, msm, NULL, RC_OTHER);
+ tab_double (t, 4, 2, TAB_RIGHT, mse, NULL, RC_OTHER);
- tab_double (t, 5, 1, 0, F, NULL);
+ tab_double (t, 5, 1, 0, F, NULL, RC_OTHER);
- tab_double (t, 6, 1, 0, pval, NULL);
+ tab_double (t, 6, 1, 0, pval, NULL, RC_OTHER);
tab_title (t, _("ANOVA (%s)"), var_to_string (var));
tab_submit (t);
col = (i <= k) ? k : i;
row = (i <= k) ? i : k;
tab_double (t, k + 2, i, TAB_CENTER,
- gsl_matrix_get (c->cov, row, col), NULL);
+ gsl_matrix_get (c->cov, row, col), NULL, RC_OTHER);
}
}
tab_title (t, _("Coefficient Correlations (%s)"), var_to_string (var));
int heading_rows = 1;
struct tab_table *tbl;
tbl = tab_create (n_cols, n_rows);
+ tab_set_format (tbl, RC_WEIGHT, wfmt);
tab_headers (tbl, heading_columns, 0, heading_rows, 0);
tab_title (tbl, _("Case Processing Summary"));
total = n_missing + n_valid;
tab_double (tbl, 2, heading_rows, TAB_RIGHT,
- n_valid, wfmt);
+ n_valid, NULL, RC_WEIGHT);
tab_double (tbl, 2, heading_rows + 1, TAB_RIGHT,
- n_missing, wfmt);
+ n_missing, NULL, RC_WEIGHT);
tab_double (tbl, 2, heading_rows + 2, TAB_RIGHT,
- total, wfmt);
+ total, NULL, RC_WEIGHT);
tab_double (tbl, 3, heading_rows, TAB_RIGHT,
- 100 * n_valid / (double) total, NULL);
+ 100 * n_valid / (double) total, NULL, RC_OTHER);
tab_double (tbl, 3, heading_rows + 1, TAB_RIGHT,
- 100 * n_missing / (double) total, NULL);
+ 100 * n_missing / (double) total, NULL, RC_OTHER);
tab_double (tbl, 3, heading_rows + 2, TAB_RIGHT,
- 100 * total / (double) total, NULL);
+ 100 * total / (double) total, NULL, RC_OTHER);
tab_submit (tbl);
const int heading_columns = 1;
const int heading_rows = 1;
const int n_rows = rel->sc[0].n_items + heading_rows ;
-
+ const struct variable *wv = rel->wv;
+ const struct fmt_spec *wfmt = wv ? var_get_print_format (wv) : & F_8_0;
struct tab_table *tbl = tab_create (n_cols, n_rows);
+ tab_set_format (tbl, RC_WEIGHT, wfmt);
tab_headers (tbl, heading_columns, 0, heading_rows, 0);
tab_title (tbl, _("Item-Total Statistics"));
moments1_calculate (s->total, &weight, &mean, &var, 0, 0);
tab_double (tbl, 1, heading_rows + i, TAB_RIGHT,
- mean, NULL);
+ mean, NULL, RC_OTHER);
tab_double (tbl, 2, heading_rows + i, TAB_RIGHT,
- s->variance_of_sums, NULL);
+ s->variance_of_sums, NULL, RC_OTHER);
tab_double (tbl, 4, heading_rows + i, TAB_RIGHT,
- s->alpha, NULL);
+ s->alpha, NULL, RC_OTHER);
moments1_calculate (rel->sc[0].m[i], &weight, &mean, &var, 0,0);
tab_double (tbl, 3, heading_rows + i, TAB_RIGHT,
- item_to_total_r, NULL);
+ item_to_total_r, NULL, RC_OTHER);
}
int n_rows = rol[rel->model].n_rows;
int heading_columns = rol[rel->model].heading_cols;
int heading_rows = rol[rel->model].heading_rows;
-
+ const struct variable *wv = rel->wv;
+ const struct fmt_spec *wfmt = wv ? var_get_print_format (wv) : & F_8_0;
struct tab_table *tbl = tab_create (n_cols, n_rows);
+ tab_set_format (tbl, RC_WEIGHT, wfmt);
+
tab_headers (tbl, heading_columns, 0, heading_rows, 0);
tab_title (tbl, _("Reliability Statistics"));
reliability_statistics_model_alpha (struct tab_table *tbl,
const struct reliability *rel)
{
- const struct variable *wv = rel->wv;
- const struct fmt_spec *wfmt = wv ? var_get_print_format (wv) : & F_8_0;
-
const struct cronbach *s = &rel->sc[0];
tab_text (tbl, 0, 0, TAB_CENTER | TAT_TITLE,
tab_text (tbl, 1, 0, TAB_CENTER | TAT_TITLE,
_("N of Items"));
- tab_double (tbl, 0, 1, TAB_RIGHT, s->alpha, NULL);
+ tab_double (tbl, 0, 1, TAB_RIGHT, s->alpha, NULL, RC_OTHER);
- tab_double (tbl, 1, 1, TAB_RIGHT, s->n_items, wfmt);
+ tab_double (tbl, 1, 1, TAB_RIGHT, s->n_items, NULL, RC_WEIGHT);
}
reliability_statistics_model_split (struct tab_table *tbl,
const struct reliability *rel)
{
- const struct variable *wv = rel->wv;
- const struct fmt_spec *wfmt = wv ? var_get_print_format (wv) : & F_8_0;
-
tab_text (tbl, 0, 0, TAB_LEFT,
_("Cronbach's Alpha"));
tab_text (tbl, 2, 1, TAB_LEFT,
_("N of Items"));
-
-
tab_text (tbl, 1, 2, TAB_LEFT,
_("Part 2"));
tab_text (tbl, 2, 3, TAB_LEFT,
_("N of Items"));
-
-
tab_text (tbl, 1, 4, TAB_LEFT,
_("Total N of Items"));
tab_text (tbl, 0, 5, TAB_LEFT,
_("Correlation Between Forms"));
-
tab_text (tbl, 0, 6, TAB_LEFT,
_("Spearman-Brown Coefficient"));
- tab_double (tbl, 3, 0, TAB_RIGHT, rel->sc[1].alpha, NULL);
- tab_double (tbl, 3, 2, TAB_RIGHT, rel->sc[2].alpha, NULL);
+ tab_double (tbl, 3, 0, TAB_RIGHT, rel->sc[1].alpha, NULL, RC_OTHER);
+ tab_double (tbl, 3, 2, TAB_RIGHT, rel->sc[2].alpha, NULL, RC_OTHER);
- tab_double (tbl, 3, 1, TAB_RIGHT, rel->sc[1].n_items, wfmt);
- tab_double (tbl, 3, 3, TAB_RIGHT, rel->sc[2].n_items, wfmt);
+ tab_double (tbl, 3, 1, TAB_RIGHT, rel->sc[1].n_items, NULL, RC_WEIGHT);
+ tab_double (tbl, 3, 3, TAB_RIGHT, rel->sc[2].n_items, NULL, RC_WEIGHT);
tab_double (tbl, 3, 4, TAB_RIGHT,
- rel->sc[1].n_items + rel->sc[2].n_items, wfmt);
+ rel->sc[1].n_items + rel->sc[2].n_items, NULL, RC_WEIGHT);
{
/* R is the correlation between the two parts */
r /= sqrt (rel->sc[2].variance_of_sums);
r /= 2.0;
- tab_double (tbl, 3, 5, TAB_RIGHT, r, NULL);
+ tab_double (tbl, 3, 5, TAB_RIGHT, r, NULL, RC_OTHER);
/* Equal length Spearman-Brown Coefficient */
- tab_double (tbl, 3, 6, TAB_RIGHT, 2 * r / (1.0 + r), NULL);
+ tab_double (tbl, 3, 6, TAB_RIGHT, 2 * r / (1.0 + r), NULL, RC_OTHER);
- tab_double (tbl, 3, 8, TAB_RIGHT, g, NULL);
+ tab_double (tbl, 3, 8, TAB_RIGHT, g, NULL, RC_OTHER);
tmp = (1.0 - r*r) * rel->sc[1].n_items * rel->sc[2].n_items /
pow2 (rel->sc[0].n_items);
uly -= pow2 (r);
uly /= 2 * tmp;
- tab_double (tbl, 3, 7, TAB_RIGHT, uly, NULL);
+ tab_double (tbl, 3, 7, TAB_RIGHT, uly, NULL, RC_OTHER);
}
}
{
tab_text (tbl, 0, 2 + i, TAT_TITLE, var_to_string (roc->vars[i]));
- tab_double (tbl, n_cols - n_fields, 2 + i, 0, rs[i].auc, NULL);
+ tab_double (tbl, n_cols - n_fields, 2 + i, 0, rs[i].auc, NULL, RC_OTHER);
if ( roc->print_se )
{
tab_double (tbl, n_cols - 4, 2 + i, 0,
se,
- NULL);
+ NULL, RC_OTHER);
ci = 1 - roc->ci / 100.0;
yy = gsl_cdf_gaussian_Qinv (ci, se) ;
tab_double (tbl, n_cols - 2, 2 + i, 0,
rs[i].auc - yy,
- NULL);
+ NULL, RC_OTHER);
tab_double (tbl, n_cols - 1, 2 + i, 0,
rs[i].auc + yy,
- NULL);
+ NULL, RC_OTHER);
tab_double (tbl, n_cols - 3, 2 + i, 0,
2.0 * gsl_cdf_ugaussian_Q (fabs ((rs[i].auc - 0.5 ) / sd_0_5)),
- NULL);
+ NULL, RC_PVALUE);
}
}
tab_text (tbl, 0, 3, TAB_LEFT, _("Negative"));
- tab_double (tbl, 1, 2, 0, roc->pos, &F_8_0);
- tab_double (tbl, 1, 3, 0, roc->neg, &F_8_0);
+ tab_double (tbl, 1, 2, 0, roc->pos, NULL, RC_INTEGER);
+ tab_double (tbl, 1, 3, 0, roc->neg, NULL, RC_INTEGER);
- tab_double (tbl, 2, 2, 0, roc->pos_weighted, 0);
- tab_double (tbl, 2, 3, 0, roc->neg_weighted, 0);
+ tab_double (tbl, 2, 2, 0, roc->pos_weighted, NULL, RC_OTHER);
+ tab_double (tbl, 2, 3, 0, roc->neg_weighted, NULL, RC_OTHER);
tab_submit (tbl);
}
);
tab_double (tbl, n_cols - 3, x, 0, case_data_idx (cc, ROC_CUTPOINT)->f,
- var_get_print_format (roc->vars[i]));
+ var_get_print_format (roc->vars[i]), RC_OTHER);
- tab_double (tbl, n_cols - 2, x, 0, se, NULL);
- tab_double (tbl, n_cols - 1, x, 0, 1 - sp, NULL);
+ tab_double (tbl, n_cols - 2, x, 0, se, NULL, RC_OTHER);
+ tab_double (tbl, n_cols - 1, x, 0, 1 - sp, NULL, RC_OTHER);
}
casereader_destroy (r);
const int column_headers = 1;
struct tab_table *table =
tab_create (row_headers + otp->n_vars, column_headers + 7);
+ tab_set_format (table, RC_WEIGHT, wfmt);
tab_headers (table, row_headers, 0, column_headers, 0);
var_to_string (otp->vars[i]));
tab_double (table, row_headers +i, 1, 0,
- run->cutpoint, 0);
+ run->cutpoint, NULL, RC_OTHER);
tab_double (table, row_headers +i, 2, 0,
- run->nn, wfmt);
+ run->nn, NULL, RC_WEIGHT);
tab_double (table, row_headers +i, 3, 0,
- run->np, wfmt);
+ run->np, NULL, RC_WEIGHT);
tab_double (table, row_headers +i, 4, 0,
- run->n, wfmt);
+ run->n, NULL, RC_WEIGHT);
tab_double (table, row_headers +i, 5, 0,
- run->runs, &F_8_0);
+ run->runs, NULL, RC_INTEGER);
tab_double (table, row_headers +i, 6, 0,
- z, 0);
+ z, NULL, RC_OTHER);
tab_double (table, row_headers +i, 7, 0,
- 2.0 * gsl_cdf_ugaussian_P (z), 0);
+ 2.0 * gsl_cdf_ugaussian_P (z), NULL, RC_PVALUE);
}
switch ( rt->cp_mode)
const struct variable *wv = dict_get_weight (dict);
const struct fmt_spec *wfmt = wv ? var_get_print_format (wv) : & F_8_0;
+ tab_set_format (table, RC_WEIGHT, wfmt);
tab_title (table, _("Frequencies"));
tab_headers (table, 2, 0, 1, 0);
tab_text (table, 1, 3 + i * 4, TAB_LEFT, _("Ties"));
tab_text (table, 1, 4 + i * 4, TAB_LEFT, _("Total"));
- tab_double (table, 2, 1 + i * 4, TAB_RIGHT, param[i].neg, wfmt);
- tab_double (table, 2, 2 + i * 4, TAB_RIGHT, param[i].pos, wfmt);
- tab_double (table, 2, 3 + i * 4, TAB_RIGHT, param[i].ties, wfmt);
+ tab_double (table, 2, 1 + i * 4, TAB_RIGHT, param[i].neg, NULL, RC_WEIGHT);
+ tab_double (table, 2, 2 + i * 4, TAB_RIGHT, param[i].pos, NULL, RC_WEIGHT);
+ tab_double (table, 2, 3 + i * 4, TAB_RIGHT, param[i].ties, NULL, RC_WEIGHT);
tab_double (table, 2, 4 + i * 4, TAB_RIGHT,
- param[i].ties + param[i].neg + param[i].pos, wfmt);
+ param[i].ties + param[i].neg + param[i].pos, NULL, RC_WEIGHT);
}
tab_submit (table);
ds_destroy (&pair_name);
tab_double (table, 1 + i, 1, TAB_RIGHT,
- param[i].one_tailed_sig * 2, NULL);
+ param[i].one_tailed_sig * 2, NULL, RC_PVALUE);
- tab_double (table, 1 + i, 2, TAB_RIGHT, param[i].one_tailed_sig, NULL);
- tab_double (table, 1 + i, 3, TAB_RIGHT, param[i].point_prob, NULL);
+ tab_double (table, 1 + i, 2, TAB_RIGHT, param[i].one_tailed_sig, NULL, RC_PVALUE);
+ tab_double (table, 1 + i, 3, TAB_RIGHT, param[i].point_prob, NULL, RC_PVALUE);
}
tab_submit (table);
struct string vallab0 ;
struct string vallab1 ;
struct tab_table *t = tab_create (cols, rows);
-
+ tab_set_format (t, RC_WEIGHT, wfmt);
ds_init_empty (&vallab0);
ds_init_empty (&vallab1);
double cc, mean, sigma;
moments_calculate (ps[v].mom[i], &cc, &mean, &sigma, NULL, NULL);
- tab_double (t, 2, v * 2 + i + heading_rows, TAB_RIGHT, cc, wfmt);
- tab_double (t, 3, v * 2 + i + heading_rows, TAB_RIGHT, mean, NULL);
- tab_double (t, 4, v * 2 + i + heading_rows, TAB_RIGHT, sqrt (sigma), NULL);
- tab_double (t, 5, v * 2 + i + heading_rows, TAB_RIGHT, sqrt (sigma / cc), NULL);
+ tab_double (t, 2, v * 2 + i + heading_rows, TAB_RIGHT, cc, NULL, RC_WEIGHT);
+ tab_double (t, 3, v * 2 + i + heading_rows, TAB_RIGHT, mean, NULL, RC_OTHER);
+ tab_double (t, 4, v * 2 + i + heading_rows, TAB_RIGHT, sqrt (sigma), NULL, RC_OTHER);
+ tab_double (t, 5, v * 2 + i + heading_rows, TAB_RIGHT, sqrt (sigma / cc), NULL, RC_OTHER);
}
}
tab_text (t, 1, v * 2 + heading_rows, TAB_LEFT, _("Equal variances assumed"));
df = cc0 + cc1 - 2.0;
- tab_double (t, 5, v * 2 + heading_rows, TAB_RIGHT, df, NULL);
+ tab_double (t, 5, v * 2 + heading_rows, TAB_RIGHT, df, NULL, RC_OTHER);
pooled_variance = ((cc0 - 1)* sigma0 + (cc1 - 1) * sigma1) / df ;
tval = (mean0 - mean1) / sqrt (pooled_variance);
tval /= sqrt ((cc0 + cc1) / (cc0 * cc1));
- tab_double (t, 4, v * 2 + heading_rows, TAB_RIGHT, tval, NULL);
+ tab_double (t, 4, v * 2 + heading_rows, TAB_RIGHT, tval, NULL, RC_OTHER);
p = gsl_cdf_tdist_P (tval, df);
q = gsl_cdf_tdist_Q (tval, df);
mean_diff = mean0 - mean1;
- tab_double (t, 6, v * 2 + heading_rows, TAB_RIGHT, 2.0 * (tval > 0 ? q : p), NULL);
- tab_double (t, 7, v * 2 + heading_rows, TAB_RIGHT, mean_diff, NULL);
+ tab_double (t, 6, v * 2 + heading_rows, TAB_RIGHT, 2.0 * (tval > 0 ? q : p), NULL, RC_PVALUE);
+ tab_double (t, 7, v * 2 + heading_rows, TAB_RIGHT, mean_diff, NULL, RC_OTHER);
std_err_diff = sqrt (pooled_variance * (1.0/cc0 + 1.0/cc1));
- tab_double (t, 8, v * 2 + heading_rows, TAB_RIGHT, std_err_diff, NULL);
+ tab_double (t, 8, v * 2 + heading_rows, TAB_RIGHT, std_err_diff, NULL, RC_OTHER);
/* Now work out the confidence interval */
q = (1 - tt->confidence)/2.0; /* 2-tailed test */
tval = gsl_cdf_tdist_Qinv (q, df);
- tab_double (t, 9, v * 2 + heading_rows, TAB_RIGHT, mean_diff - tval * std_err_diff, NULL);
- tab_double (t, 10, v * 2 + heading_rows, TAB_RIGHT, mean_diff + tval * std_err_diff, NULL);
+ tab_double (t, 9, v * 2 + heading_rows, TAB_RIGHT, mean_diff - tval * std_err_diff, NULL, RC_OTHER);
+ tab_double (t, 10, v * 2 + heading_rows, TAB_RIGHT, mean_diff + tval * std_err_diff, NULL, RC_OTHER);
/* Equal variances not assumed */
tab_text (t, 1, v * 2 + heading_rows + 1, TAB_LEFT, _("Equal variances not assumed"));
se2 = sigma0 / cc0 + sigma1 / cc1;
tval = mean_diff / sqrt (se2);
- tab_double (t, 4, v * 2 + heading_rows + 1, TAB_RIGHT, tval, NULL);
+ tab_double (t, 4, v * 2 + heading_rows + 1, TAB_RIGHT, tval, NULL, RC_OTHER);
{
double p, q;
double df = pow2 (s0 + s1) ;
df /= pow2 (s0) / (cc0 - 1) + pow2 (s1) / (cc1 - 1);
- tab_double (t, 5, v * 2 + heading_rows + 1, TAB_RIGHT, df, NULL);
+ tab_double (t, 5, v * 2 + heading_rows + 1, TAB_RIGHT, df, NULL, RC_OTHER);
p = gsl_cdf_tdist_P (tval, df);
q = gsl_cdf_tdist_Q (tval, df);
- tab_double (t, 6, v * 2 + heading_rows + 1, TAB_RIGHT, 2.0 * (tval > 0 ? q : p), NULL);
+ tab_double (t, 6, v * 2 + heading_rows + 1, TAB_RIGHT, 2.0 * (tval > 0 ? q : p), NULL, RC_PVALUE);
/* Now work out the confidence interval */
q = (1 - tt->confidence) / 2.0; /* 2-tailed test */
tval = gsl_cdf_tdist_Qinv (q, df);
}
- tab_double (t, 7, v * 2 + heading_rows + 1, TAB_RIGHT, mean_diff, NULL);
- tab_double (t, 8, v * 2 + heading_rows + 1, TAB_RIGHT, std_err_diff, NULL);
- tab_double (t, 9, v * 2 + heading_rows + 1, TAB_RIGHT, mean_diff - tval * std_err_diff, NULL);
- tab_double (t, 10, v * 2 + heading_rows + 1, TAB_RIGHT, mean_diff + tval * std_err_diff, NULL);
+ tab_double (t, 7, v * 2 + heading_rows + 1, TAB_RIGHT, mean_diff, NULL, RC_OTHER);
+ tab_double (t, 8, v * 2 + heading_rows + 1, TAB_RIGHT, std_err_diff, NULL, RC_OTHER);
+ tab_double (t, 9, v * 2 + heading_rows + 1, TAB_RIGHT, mean_diff - tval * std_err_diff, NULL, RC_OTHER);
+ tab_double (t, 10, v * 2 + heading_rows + 1, TAB_RIGHT, mean_diff + tval * std_err_diff, NULL, RC_OTHER);
- tab_double (t, 2, v * 2 + heading_rows, TAB_CENTER, ps[v].lev, NULL);
+ tab_double (t, 2, v * 2 + heading_rows, TAB_CENTER, ps[v].lev, NULL, RC_OTHER);
{
double df1 = 1;
double df2 = cc0 + cc1 - 2;
double q = gsl_cdf_fdist_Q (ps[v].lev, df1, df2);
- tab_double (t, 3, v * 2 + heading_rows, TAB_CENTER, q, NULL);
+ tab_double (t, 3, v * 2 + heading_rows, TAB_CENTER, q, NULL, RC_OTHER);
}
}
const struct fmt_spec *wfmt = tt->wv ? var_get_print_format (tt->wv) : & F_8_0;
struct tab_table *t = tab_create (cols, rows);
+ tab_set_format (t, RC_WEIGHT, wfmt);
tab_headers (t, 0, 0, heading_rows, 0);
tab_box (t, TAL_2, TAL_2, TAL_0, TAL_0, 0, 0, cols - 1, rows - 1);
q = gsl_cdf_tdist_Q (tval, df);
tab_text (t, 0, v + heading_rows, TAB_LEFT, var_to_string (per_var_stats->var));
- tab_double (t, 1, v + heading_rows, TAB_RIGHT, tval, NULL);
- tab_double (t, 2, v + heading_rows, TAB_RIGHT, df, wfmt);
+ tab_double (t, 1, v + heading_rows, TAB_RIGHT, tval, NULL, RC_OTHER);
+ tab_double (t, 2, v + heading_rows, TAB_RIGHT, df, NULL, RC_WEIGHT);
/* Multiply by 2 to get 2-tailed significance, makeing sure we've got
the correct tail*/
- tab_double (t, 3, v + heading_rows, TAB_RIGHT, 2.0 * (tval > 0 ? q : p), NULL);
+ tab_double (t, 3, v + heading_rows, TAB_RIGHT, 2.0 * (tval > 0 ? q : p), NULL, RC_PVALUE);
- tab_double (t, 4, v + heading_rows, TAB_RIGHT, mean_diff, NULL);
+ tab_double (t, 4, v + heading_rows, TAB_RIGHT, mean_diff, NULL, RC_OTHER);
tval = gsl_cdf_tdist_Qinv ( (1.0 - tt->confidence) / 2.0, df);
- tab_double (t, 5, v + heading_rows, TAB_RIGHT, mean_diff - tval * se_mean, NULL);
- tab_double (t, 6, v + heading_rows, TAB_RIGHT, mean_diff + tval * se_mean, NULL);
+ tab_double (t, 5, v + heading_rows, TAB_RIGHT, mean_diff - tval * se_mean, NULL, RC_OTHER);
+ tab_double (t, 6, v + heading_rows, TAB_RIGHT, mean_diff + tval * se_mean, NULL, RC_OTHER);
}
tab_submit (t);
const int rows = tt->n_vars + heading_rows;
struct tab_table *t = tab_create (cols, rows);
const struct fmt_spec *wfmt = tt->wv ? var_get_print_format (tt->wv) : & F_8_0;
-
+ tab_set_format (t, RC_WEIGHT, wfmt);
tab_headers (t, 0, 0, heading_rows, 0);
tab_box (t, TAL_2, TAL_2, TAL_0, TAL_1, 0, 0, cols - 1, rows - 1);
tab_hline (t, TAL_2, 0, cols - 1, 1);
moments_calculate (m, &cc, &mean, &sigma, NULL, NULL);
tab_text (t, 0, v + heading_rows, TAB_LEFT, var_to_string (per_var_stats->var));
- tab_double (t, 1, v + heading_rows, TAB_RIGHT, cc, wfmt);
- tab_double (t, 2, v + heading_rows, TAB_RIGHT, mean, NULL);
- tab_double (t, 3, v + heading_rows, TAB_RIGHT, sqrt (sigma), NULL);
- tab_double (t, 4, v + heading_rows, TAB_RIGHT, sqrt (sigma / cc), NULL);
+ tab_double (t, 1, v + heading_rows, TAB_RIGHT, cc, NULL, RC_WEIGHT);
+ tab_double (t, 2, v + heading_rows, TAB_RIGHT, mean, NULL, RC_OTHER);
+ tab_double (t, 3, v + heading_rows, TAB_RIGHT, sqrt (sigma), NULL, RC_OTHER);
+ tab_double (t, 4, v + heading_rows, TAB_RIGHT, sqrt (sigma / cc), NULL, RC_OTHER);
}
tab_submit (t);
const int rows = n_pairs * 2 + heading_rows;
struct tab_table *t = tab_create (cols, rows);
const struct fmt_spec *wfmt = tt->wv ? var_get_print_format (tt->wv) : & F_8_0;
-
+ tab_set_format (t, RC_WEIGHT, wfmt);
tab_headers (t, 0, 0, heading_rows, 0);
tab_box (t, TAL_2, TAL_2, TAL_0, TAL_0, 0, 0, cols - 1, rows - 1);
tab_box (t, -1, -1, TAL_0, TAL_1, heading_cols, 0, cols - 1, rows - 1);
/* first var */
moments_calculate (pp->mom0, &cc, &mean, &sigma, NULL, NULL);
tab_text (t, 1, v * 2 + heading_rows, TAB_LEFT, var_to_string (pp->var0));
- tab_double (t, 3, v * 2 + heading_rows, TAB_RIGHT, cc, wfmt);
- tab_double (t, 2, v * 2 + heading_rows, TAB_RIGHT, mean, NULL);
- tab_double (t, 4, v * 2 + heading_rows, TAB_RIGHT, sqrt (sigma), NULL);
- tab_double (t, 5, v * 2 + heading_rows, TAB_RIGHT, sqrt (sigma / cc), NULL);
+ tab_double (t, 3, v * 2 + heading_rows, TAB_RIGHT, cc, NULL, RC_WEIGHT);
+ tab_double (t, 2, v * 2 + heading_rows, TAB_RIGHT, mean, NULL, RC_OTHER);
+ tab_double (t, 4, v * 2 + heading_rows, TAB_RIGHT, sqrt (sigma), NULL, RC_OTHER);
+ tab_double (t, 5, v * 2 + heading_rows, TAB_RIGHT, sqrt (sigma / cc), NULL, RC_OTHER);
/* second var */
moments_calculate (pp->mom1, &cc, &mean, &sigma, NULL, NULL);
tab_text (t, 1, v * 2 + 1 + heading_rows, TAB_LEFT, var_to_string (pp->var1));
- tab_double (t, 3, v * 2 + 1 + heading_rows, TAB_RIGHT, cc, wfmt);
- tab_double (t, 2, v * 2 + 1 + heading_rows, TAB_RIGHT, mean, NULL);
- tab_double (t, 4, v * 2 + 1 + heading_rows, TAB_RIGHT, sqrt (sigma), NULL);
- tab_double (t, 5, v * 2 + 1 + heading_rows, TAB_RIGHT, sqrt (sigma / cc), NULL);
+ tab_double (t, 3, v * 2 + 1 + heading_rows, TAB_RIGHT, cc, NULL, RC_WEIGHT);
+ tab_double (t, 2, v * 2 + 1 + heading_rows, TAB_RIGHT, mean, NULL, RC_OTHER);
+ tab_double (t, 4, v * 2 + 1 + heading_rows, TAB_RIGHT, sqrt (sigma), NULL, RC_OTHER);
+ tab_double (t, 5, v * 2 + 1 + heading_rows, TAB_RIGHT, sqrt (sigma / cc), NULL, RC_OTHER);
}
tab_submit (t);
const int rows = n_pairs + heading_rows;
struct tab_table *t = tab_create (cols, rows);
const struct fmt_spec *wfmt = tt->wv ? var_get_print_format (tt->wv) : & F_8_0;
-
+ tab_set_format (t, RC_WEIGHT, wfmt);
tab_headers (t, 0, 0, heading_rows, 0);
tab_box (t, TAL_2, TAL_2, TAL_0, TAL_1, 0, 0, cols - 1, rows - 1);
/* If this fails, then we're not dealing with missing values properly */
assert (cc0 == cc1);
- tab_double (t, 2, v + heading_rows, TAB_RIGHT, cc0, wfmt);
+ tab_double (t, 2, v + heading_rows, TAB_RIGHT, cc0, NULL, RC_WEIGHT);
corr = pp->sum_of_prod / cc0 - (mean0 * mean1);
corr /= sqrt (sigma0 * sigma1);
corr *= cc0 / (cc0 - 1);
- tab_double (t, 3, v + heading_rows, TAB_RIGHT, corr, NULL);
+ tab_double (t, 3, v + heading_rows, TAB_RIGHT, corr, NULL, RC_OTHER);
tab_double (t, 4, v + heading_rows, TAB_RIGHT,
- 2.0 * significance_of_correlation (corr, cc0), NULL);
+ 2.0 * significance_of_correlation (corr, cc0), NULL, RC_OTHER);
}
tab_submit (t);
const struct fmt_spec *wfmt = tt->wv ? var_get_print_format (tt->wv) : & F_8_0;
struct tab_table *t = tab_create (cols, rows);
-
+ tab_set_format (t, RC_WEIGHT, wfmt);
tab_headers (t, 0, 0, heading_rows, 0);
tab_box (t, TAL_2, TAL_2, TAL_0, TAL_0, 0, 0, cols - 1, rows - 1);
tab_hline (t, TAL_2, 0, cols - 1, 3);
tval = mean * sqrt (cc / sigma);
se_mean = sqrt (sigma / cc);
- tab_double (t, 2, v + heading_rows, TAB_RIGHT, mean, NULL);
- tab_double (t, 3, v + heading_rows, TAB_RIGHT, sqrt (sigma), NULL);
- tab_double (t, 4, v + heading_rows, TAB_RIGHT, se_mean, NULL);
+ tab_double (t, 2, v + heading_rows, TAB_RIGHT, mean, NULL, RC_OTHER);
+ tab_double (t, 3, v + heading_rows, TAB_RIGHT, sqrt (sigma), NULL, RC_OTHER);
+ tab_double (t, 4, v + heading_rows, TAB_RIGHT, se_mean, NULL, RC_OTHER);
- tab_double (t, 7, v + heading_rows, TAB_RIGHT, tval, NULL);
- tab_double (t, 8, v + heading_rows, TAB_RIGHT, df, wfmt);
+ tab_double (t, 7, v + heading_rows, TAB_RIGHT, tval, NULL, RC_OTHER);
+ tab_double (t, 8, v + heading_rows, TAB_RIGHT, df, NULL, RC_WEIGHT);
p = gsl_cdf_tdist_P (tval, df);
q = gsl_cdf_tdist_Q (tval, df);
- tab_double (t, 9, v + heading_rows, TAB_RIGHT, 2.0 * (tval > 0 ? q : p), NULL);
+ tab_double (t, 9, v + heading_rows, TAB_RIGHT, 2.0 * (tval > 0 ? q : p), NULL, RC_PVALUE);
tval = gsl_cdf_tdist_Qinv ( (1.0 - tt->confidence) / 2.0, df);
- tab_double (t, 5, v + heading_rows, TAB_RIGHT, mean - tval * se_mean, NULL);
- tab_double (t, 6, v + heading_rows, TAB_RIGHT, mean + tval * se_mean, NULL);
+ tab_double (t, 5, v + heading_rows, TAB_RIGHT, mean - tval * se_mean, NULL, RC_OTHER);
+ tab_double (t, 6, v + heading_rows, TAB_RIGHT, mean + tval * se_mean, NULL, RC_OTHER);
}
tab_submit (t);
const struct fmt_spec *wfmt = wv ? var_get_print_format (wv) : & F_8_0;
struct tab_table *table = tab_create (5, 1 + 4 * t2s->n_pairs);
+ tab_set_format (table, RC_WEIGHT, wfmt);
tab_title (table, _("Ranks"));
/* N */
- tab_double (table, 2, 1 + i * 4, TAB_RIGHT, ws[i].negatives.n, wfmt);
- tab_double (table, 2, 2 + i * 4, TAB_RIGHT, ws[i].positives.n, wfmt);
- tab_double (table, 2, 3 + i * 4, TAB_RIGHT, ws[i].n_zeros, wfmt);
+ tab_double (table, 2, 1 + i * 4, TAB_RIGHT, ws[i].negatives.n, NULL, RC_WEIGHT);
+ tab_double (table, 2, 2 + i * 4, TAB_RIGHT, ws[i].positives.n, NULL, RC_WEIGHT);
+ tab_double (table, 2, 3 + i * 4, TAB_RIGHT, ws[i].n_zeros, NULL, RC_WEIGHT);
tab_double (table, 2, 4 + i * 4, TAB_RIGHT,
- ws[i].n_zeros + ws[i].positives.n + ws[i].negatives.n, wfmt);
+ ws[i].n_zeros + ws[i].positives.n + ws[i].negatives.n, NULL, RC_WEIGHT);
/* Sums */
- tab_double (table, 4, 1 + i * 4, TAB_RIGHT, ws[i].negatives.sum, NULL);
- tab_double (table, 4, 2 + i * 4, TAB_RIGHT, ws[i].positives.sum, NULL);
+ tab_double (table, 4, 1 + i * 4, TAB_RIGHT, ws[i].negatives.sum, NULL, RC_OTHER);
+ tab_double (table, 4, 2 + i * 4, TAB_RIGHT, ws[i].positives.sum, NULL, RC_OTHER);
/* Means */
tab_double (table, 3, 1 + i * 4, TAB_RIGHT,
- ws[i].negatives.sum / (double) ws[i].negatives.n, NULL);
+ ws[i].negatives.sum / (double) ws[i].negatives.n, NULL, RC_OTHER);
tab_double (table, 3, 2 + i * 4, TAB_RIGHT,
- ws[i].positives.sum / (double) ws[i].positives.n, NULL);
+ ws[i].positives.sum / (double) ws[i].positives.n, NULL, RC_OTHER);
}
z /= sqrt (n * (n + 1) * (2*n + 1)/24.0 - ws[i].tiebreaker / 48.0);
- tab_double (table, 1 + i, 1, TAB_RIGHT, z, NULL);
+ tab_double (table, 1 + i, 1, TAB_RIGHT, z, NULL, RC_OTHER);
tab_double (table, 1 + i, 2, TAB_RIGHT,
2.0 * gsl_cdf_ugaussian_P (z),
- NULL);
+ NULL, RC_PVALUE);
if (exact)
{
}
else
{
- tab_double (table, 1 + i, 3, TAB_RIGHT, p, NULL);
- tab_double (table, 1 + i, 4, TAB_RIGHT, p / 2.0, NULL);
+ tab_double (table, 1 + i, 3, TAB_RIGHT, p, NULL, RC_PVALUE);
+ tab_double (table, 1 + i, 4, TAB_RIGHT, p / 2.0, NULL, RC_PVALUE);
}
}
}
for (i = 0 ; i < cov->dim; ++i)
{
double v = get_val (cov, i, c);
- tab_double (t, i, row, 0, v, i < cov->n_vars ? NULL : &F_8_0);
+ tab_double (t, i, row, 0, v, i < cov->n_vars ? NULL : &F_8_0, RC_OTHER);
}
}
/* PSPP - a program for statistical analysis.
- Copyright (C) 1997-9, 2000, 2006, 2009, 2010, 2011, 2013 Free Software Foundation, Inc.
+ Copyright (C) 1997-9, 2000, 2006, 2009, 2010, 2011, 2013, 2014 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
memset (t->rh, 0, nc * (nr + 1));
t->rv = pool_nmalloc (t->container, nr, nc + 1);
+ memset (t->fmtmap, 0, sizeof (*t->fmtmap) * n_RC);
+
memset (t->rv, TAL_GAP, nr * (nc + 1));
+ t->fmtmap[RC_PVALUE] = &F_4_3;
+ t->fmtmap[RC_INTEGER] = &F_8_0;
+ t->fmtmap[RC_OTHER] = settings_get_format ();
+
t->col_ofs = t->row_ofs = 0;
return t;
}
+
+void
+tab_set_format (struct tab_table *t, enum result_class rc, const struct fmt_spec *fmt)
+{
+ t->fmtmap[rc] = fmt;
+}
+
+
/* Sets the width and height of a table, in columns and rows,
respectively. Use only to reduce the size of a table, since it
does not change the amount of allocated memory.
table->ct[c + r * table->cf] = opt;
}
-/* Sets cell (C,R) in TABLE, with options OPT, to have value VAL
- with NDEC decimal places. */
-void
-tab_fixed (struct tab_table *table, int c, int r, unsigned char opt,
- double val, int w, int d)
-{
- struct fmt_spec f;
- union value double_value;
- char *s;
-
- assert (c >= 0);
- assert (c < tab_nc (table));
- assert (r >= 0);
- assert (r < tab_nr (table));
-
- f = fmt_for_output (FMT_F, w, d);
-
-#if DEBUGGING
- if (c + table->col_ofs < 0 || r + table->row_ofs < 0
- || c + table->col_ofs >= tab_nc (table)
- || r + table->row_ofs >= tab_nr (table))
- {
- 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,
- tab_nc (table), tab_nr (table));
- return;
- }
-#endif
-
- double_value.f = val;
- s = data_out_stretchy (&double_value, C_ENCODING, &f, table->container);
-
- table->cc[c + r * table->cf] = s + strspn (s, " ");
- table->ct[c + r * table->cf] = opt;
-}
-
/* 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)
+ double val, const struct fmt_spec *fmt, enum result_class rc)
{
union value double_value ;
char *s;
assert (r >= 0);
assert (r < tab_nr (table));
- if ( fmt == NULL)
- fmt = settings_get_format ();
-
+ if (fmt == NULL)
+ fmt = table->fmtmap[rc];
+
fmt_check_output (fmt);
#if DEBUGGING
#include "libpspp/compiler.h"
#include "output/table.h"
+enum result_class
+ {
+ RC_INTEGER,
+ RC_WEIGHT,
+ RC_PVALUE,
+ RC_OTHER,
+ n_RC
+ };
+
/* A table. */
struct tab_table
{
/* X and Y offsets. */
int col_ofs, row_ofs;
+
+ const struct fmt_spec *fmtmap [n_RC];
};
struct tab_table *tab_cast (const struct table *);
/* Obsolete cell options. */
#define TAT_TITLE TAB_EMPH /* Title attributes. */
+void tab_set_format (struct tab_table *, enum result_class, const struct fmt_spec *);
+
+
/* Cells. */
struct fmt_spec;
struct dictionary;
const union value *, const struct variable *,
const struct fmt_spec *);
-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 *);
+ double v, const struct fmt_spec *, enum result_class );
void tab_text (struct tab_table *, int c, int r, unsigned opt, const char *);
void tab_text_format (struct tab_table *, int c, int r, unsigned opt,
[Table: Correlations
,,var4,var5
var1,Pearson Correlation,.5693,-.0519
-,Sig. (2-tailed),.0000,.6232
+,Sig. (2-tailed),.000,.623
,N,93,92
var2,Pearson Correlation,.3792,-.0407
-,Sig. (2-tailed),.0002,.6985
+,Sig. (2-tailed),.000,.698
,N,95,93
var3,Pearson Correlation,.3699,-.0543
-,Sig. (2-tailed),.0002,.6029
+,Sig. (2-tailed),.000,.603
,N,95,94
Table: Correlations
,,var1,var2
var3,Pearson Correlation,.6964,.5615
-,Sig. (2-tailed),.0000,.0000
+,Sig. (2-tailed),.000,.000
,N,96,97
var4,Pearson Correlation,.5693,.3792
-,Sig. (2-tailed),.0000,.0002
+,Sig. (2-tailed),.000,.000
,N,93,95
var5,Pearson Correlation,-.0519,-.0407
-,Sig. (2-tailed),.6232,.6985
+,Sig. (2-tailed),.623,.698
,N,92,93
])
Table: Chi-square tests.
Statistic,Value,df,Asymp. Sig. (2-tailed)
-Pearson Chi-Square,2.00,2,.37
-Likelihood Ratio,2.77,2,.25
-Linear-by-Linear Association,.27,1,.60
+Pearson Chi-Square,2.00,2,.368
+Likelihood Ratio,2.77,2,.250
+Linear-by-Linear Association,.27,1,.602
N of Valid Cases,4,,
]])
AT_CLEANUP
/STATISTICS=CHISQ
/CELLS=COUNT ROW COLUMN TOTAL.
])
+
AT_CHECK([pspp -O format=csv crosstabs.sps], [0],
[[Variable,Value,Label
v0,a ,
Table: Chi-square tests.
Statistic,Value,df,Asymp. Sig. (2-tailed),Exact Sig. (2-tailed),Exact Sig. (1-tailed)
-Pearson Chi-Square,.38,1,.54,,
-Likelihood Ratio,.37,1,.54,,
-Fisher's Exact Test,,,,1.00,.60
-Continuity Correction,.00,1,1.00,,
+Pearson Chi-Square,.38,1,.540,,
+Likelihood Ratio,.37,1,.545,,
+Fisher's Exact Test,,,,1.000,.600
+Continuity Correction,.00,1,1.000,,
N of Valid Cases,6,,,,
Variable,Value,Label
Table: Chi-square tests.
Statistic,Value,df,Asymp. Sig. (2-tailed),Exact Sig. (2-tailed),Exact Sig. (1-tailed)
-Pearson Chi-Square,.44,1,.50,,
-Likelihood Ratio,.68,1,.41,,
-Fisher's Exact Test,,,,1.00,.75
-Continuity Correction,.00,1,1.00,,
+Pearson Chi-Square,.44,1,.505,,
+Likelihood Ratio,.68,1,.410,,
+Fisher's Exact Test,,,,1.000,.750
+Continuity Correction,.00,1,1.000,,
N of Valid Cases,4,,,,
]])
AT_CLEANUP
Table: Chi-square tests.
z,Statistic,Value,df,Asymp. Sig. (2-tailed)
-1,Pearson Chi-Square,5.00,4,.29
-,Likelihood Ratio,5.00,4,.29
-,Linear-by-Linear Association,.01,1,.94
+1,Pearson Chi-Square,5.00,4,.287
+,Likelihood Ratio,5.00,4,.287
+,Linear-by-Linear Association,.01,1,.938
,N of Valid Cases,5,,
-2,Pearson Chi-Square,4.00,3,.26
-,Likelihood Ratio,4.50,3,.21
-,Linear-by-Linear Association,1.58,1,.21
+2,Pearson Chi-Square,4.00,3,.261
+,Likelihood Ratio,4.50,3,.212
+,Linear-by-Linear Association,1.58,1,.209
,N of Valid Cases,4,,
Table: Symmetric measures.
/EXTRACTION=PC
/PRINT=DEFAULT DET UNIVARIATE ROTATION SIG CORRELATION.
])
+
AT_CHECK([pspp -O format=csv factor-norotate.sps], [0], [dnl
Table: Descriptive Statistics
,Mean,Std. Deviation,Analysis N
,TRAIT3,.88,-.02,1.00,.87,.13
,TRAIT4,1.00,.33,.87,1.00,.54
,TRAIT5,.54,.84,.13,.54,1.00
-Sig. (1-tailed),TRAIT1,,.26,.00,.00,.10
-,TRAIT2,.26,,.48,.24,.01
-,TRAIT3,.00,.48,,.01,.39
-,TRAIT4,.00,.24,.01,,.10
-,TRAIT5,.10,.01,.39,.10,
+Sig. (1-tailed),TRAIT1,,.260,.004,.000,.103
+,TRAIT2,.260,,.482,.238,.009
+,TRAIT3,.004,.482,,.006,.390
+,TRAIT4,.000,.238,.006,,.103
+,TRAIT5,.103,.009,.390,.103,
Determinant,.00,,,,,
Table: Communalities
/EXPECTED = 6 10 3
.
])
+
AT_CHECK([pspp -O format=csv npar.sps], [0], [dnl
Table: x
,Observed N,Expected N,Residual
,x,y
Chi-Square,3.14,6.00
df,5,3
-Asymp. Sig.,.68,.11
+Asymp. Sig.,.678,.112
Table: y
,Observed N,Expected N,Residual
,y
Chi-Square,10.61
df,3
-Asymp. Sig.,.01
+Asymp. Sig.,.014
Table: Frequencies
,x,,,,y,,,
,x,y
Chi-Square,.13,4.13
df,2,2
-Asymp. Sig.,.94,.13
+Asymp. Sig.,.936,.127
])
+
AT_CLEANUP
AT_SETUP([NPAR TESTS CHISQUARE expected values missing])
/EXPECTED = 3 4 5 4 3 1
.
])
+
AT_CHECK([pspp -O format=csv npar.sps], [1], [dnl
"error: CHISQUARE test specified 6 expected values, but 4 distinct values were encountered in variable y."
,y
Chi-Square,.00
df,0
-Asymp. Sig.,1.00
+Asymp. Sig.,1.000
])
+
AT_CLEANUP
AT_SETUP([NPAR TESTS CHISQUARE with DESCRIPTIVES])
/STATISTICS=DESCRIPTIVES
.
])
+
AT_CHECK([pspp -O format=csv npar.sps], [0], [dnl
Table: Frequencies
,x,,,,y,,,
,x,y
Chi-Square,17.33,22.87
df,7,7
-Asymp. Sig.,.02,.00
+Asymp. Sig.,.015,.002
Table: Descriptive Statistics
,N,Mean,Std. Deviation,Minimum,Maximum
/STATISTICS=DESCRIPTIVES
.
])
+
AT_CHECK([pspp -O format=csv npar.sps], [0], [dnl
Table: Frequencies
,x,,,,y,,,
,x,y
Chi-Square,13.43,26.00
df,7,7
-Asymp. Sig.,.06,.00
+Asymp. Sig.,.062,.001
Table: Descriptive Statistics
,N,Mean,Std. Deviation,Minimum,Maximum
/missing analysis
/method=exact.
])
-AT_CHECK([pspp -o pspp.csv npar.sps])
-AT_CHECK([cat pspp.csv], [0], [dnl
+
+AT_CHECK([pspp -O format=csv npar.sps], [0], [dnl
Table: Ranks
,,N,Mean Rank,Sum of Ranks
first - second,Negative Ranks,8,6.00,48.00
Table: Test Statistics
,first - second
Z,-.18
-Asymp. Sig. (2-tailed),.86
-Exact Sig. (2-tailed),.89
-Exact Sig. (1-tailed),.45
+Asymp. Sig. (2-tailed),.861
+Exact Sig. (2-tailed),.893
+Exact Sig. (1-tailed),.446
])
+
AT_CLEANUP
AT_SETUP([NPAR TESTS WILCOXON with missing values])
/wilcoxon=foo with bar (paired)
/missing analysis
/method=exact.
-
])
-AT_CHECK([pspp -o pspp.csv npar.sps])
+
dnl This is the same output as the previous test.
-AT_CHECK([cat pspp.csv], [0], [dnl
+AT_CHECK([pspp -O format=csv npar.sps], [0], [dnl
Table: Ranks
,,N,Mean Rank,Sum of Ranks
first - second,Negative Ranks,8,6.00,48.00
Table: Test Statistics
,first - second
Z,-.18
-Asymp. Sig. (2-tailed),.86
-Exact Sig. (2-tailed),.89
-Exact Sig. (1-tailed),.45
+Asymp. Sig. (2-tailed),.861
+Exact Sig. (2-tailed),.893
+Exact Sig. (1-tailed),.446
])
AT_CLEANUP
.
])
-AT_CHECK([pspp -o pspp.csv npar-runs.sps])
-
-AT_CHECK([cat pspp.csv], [0], [dnl
-Table: Runs Test
+AT_CHECK([pspp -O format=csv npar-runs.sps], [0],
+[Table: Runs Test
,score
Test Value (median),3.0000
Cases < Test Value,177.0000
Total Cases,486.0000
Number of Runs,12
Z,-20.9931
-Asymp. Sig. (2-tailed),.0000
+Asymp. Sig. (2-tailed),.000
Table: Runs Test
,score
Total Cases,486.0000
Number of Runs,12
Z,-21.0650
-Asymp. Sig. (2-tailed),.0000
+Asymp. Sig. (2-tailed),.000
Table: Runs Test
,score
Total Cases,486.0000
Number of Runs,11
Z,-21.0742
-Asymp. Sig. (2-tailed),.0000
+Asymp. Sig. (2-tailed),.000
])
AT_CLEANUP
/friedman = x y z.
])
-AT_CHECK([pspp -o pspp.csv npar-friedman.sps])
-
-AT_CHECK([cat pspp.csv], [0], [dnl
+AT_CHECK([pspp -O format=csv npar-friedman.sps], [0], [dnl
Table: Ranks
,Mean Rank
x,2.6500
N,10
Chi-Square,10.4737
df,2
-Asymp. Sig.,.0053
+Asymp. Sig.,.005
])
AT_CLEANUP
/M-W = height BY sex (0,1).
])
-AT_CHECK([pspp -o pspp.csv npar-mann-whitney.sps])
-
-AT_CHECK([cat pspp.csv], [0], [dnl
+AT_CHECK([pspp -O format=csv npar-mann-whitney.sps], [0], [dnl
Table: Ranks
,N,,,Mean Rank,,Sum of Ranks,
,0,1,Total,0,1,0,1
Table: Test Statistics
,Mann-Whitney U,Wilcoxon W,Z,Asymp. Sig. (2-tailed)
-height,98.0000,218.0000,-.6020,.5472
+height,98.0000,218.0000,-.6020,.547
])
.
])
-AT_CHECK([pspp -O format=csv oneway.sps], [0],
-[Table: Descriptives
+AT_CHECK([pspp -O format=csv oneway.sps], [0], [dnl
+Table: Descriptives
,,,,,,95% Confidence Interval for Mean,,,
,,N,Mean,Std. Deviation,Std. Error,Lower Bound,Upper Bound,Minimum,Maximum
Breaking Strain,Aspeger,5,2.20,1.30,.58,.58,3.82,1.00,4.00
Table: Test of Homogeneity of Variances
,Levene Statistic,df1,df2,Sig.
-Breaking Strain,.09,2,12,.91
+Breaking Strain,.09,2,12,.913
Table: ANOVA
,,Sum of Squares,df,Mean Square,F,Sig.
-Breaking Strain,Between Groups,20.13,2,10.07,5.12,.02
+Breaking Strain,Between Groups,20.13,2,10.07,5.12,.025
,Within Groups,23.60,12,1.97,,
,Total,43.73,14,,,
Table: Contrast Tests
,,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
+Breaking Strain,Assume equal variances,1,3.80,1.54,2.47,12,.029
+,,2,1.80,.89,2.03,12,.065
+,Does not assume equal,1,3.80,1.48,2.56,8.74,.031
+,,2,1.80,.92,1.96,7.72,.086
])
AT_CLEANUP
Table: Test of Homogeneity of Variances
,Levene Statistic,df1,df2,Sig.
-Breaking Strain,1.09,1,5,.35
+Breaking Strain,1.09,1,5,.345
Table: ANOVA
,,Sum of Squares,df,Mean Square,F,Sig.
-Breaking Strain,Between Groups,2.41,1,2.41,1.07,.35
+Breaking Strain,Between Groups,2.41,1,2.41,1.07,.349
,Within Groups,11.30,5,2.26,,
,Total,13.71,6,,,
Table: Contrast Tests
,,Contrast,Value of Contrast,Std. Error,t,df,Sig. (2-tailed)
-Breaking Strain,Assume equal variances,1,2.60,2.52,1.03,5,.35
-,,2,1.30,1.26,1.03,5,.35
-,Does not assume equal,1,2.60,3.22,.81,1.32,.54
-,,2,1.30,1.61,.81,1.32,.54
+Breaking Strain,Assume equal variances,1,2.60,2.52,1.03,5,.349
+,,2,1.30,1.26,1.03,5,.349
+,Does not assume equal,1,2.60,3.22,.81,1.32,.539
+,,2,1.30,1.61,.81,1.32,.539
Variable,Value,Label
S,2.00,
Table: Test of Homogeneity of Variances
,Levene Statistic,df1,df2,Sig.
-Breaking Strain,.92,1,6,.37
+Breaking Strain,.92,1,6,.374
Table: ANOVA
,,Sum of Squares,df,Mean Square,F,Sig.
-Breaking Strain,Between Groups,7.50,1,7.50,3.75,.10
+Breaking Strain,Between Groups,7.50,1,7.50,3.75,.101
,Within Groups,12.00,6,2.00,,
,Total,19.50,7,,,
Table: Contrast Tests
,,Contrast,Value of Contrast,Std. Error,t,df,Sig. (2-tailed)
-Breaking Strain,Assume equal variances,1,4.00,2.07,1.94,6,.10
-,,2,2.00,1.03,1.94,6,.10
-,Does not assume equal,1,4.00,1.83,2.19,5.88,.07
-,,2,2.00,.91,2.19,5.88,.07
+Breaking Strain,Assume equal variances,1,4.00,2.07,1.94,6,.101
+,,2,2.00,1.03,1.94,6,.101
+,Does not assume equal,1,4.00,1.83,2.19,5.88,.072
+,,2,2.00,.91,2.19,5.88,.072
])
AT_CLEANUP
Table: ANOVA
,,Sum of Squares,df,Mean Square,F,Sig.
-QUALITY,Between Groups,20.13,2,10.07,5.12,.02
+QUALITY,Between Groups,20.13,2,10.07,5.12,.025
,Within Groups,23.60,12,1.97,,
,Total,43.73,14,,,
])
AT_CHECK([pspp -O format=csv oneway-homogeneity.sps], [0],
[Table: Test of Homogeneity of Variances
,Levene Statistic,df1,df2,Sig.
-QUALITY,.09,2,12,.91
+QUALITY,.09,2,12,.913
Table: ANOVA
,,Sum of Squares,df,Mean Square,F,Sig.
-QUALITY,Between Groups,20.13,2,10.07,5.12,.02
+QUALITY,Between Groups,20.13,2,10.07,5.12,.025
,Within Groups,23.60,12,1.97,,
,Total,43.73,14,,,
])
/CONTRAST 2 -9 7 0
.
])
+
AT_CHECK([pspp -o pspp.csv multivar.sps])
+
dnl Some machines return 3.88 instead of 3.87 below (see bug #31611).
-AT_CHECK([sed 's/^,Within Groups,3.88/,Within Groups,3.87/' pspp.csv], [0],
-[Table: Descriptives
+AT_CHECK([sed 's/^,Within Groups,3.88/,Within Groups,3.87/' pspp.csv], [0], [dnl
+Table: Descriptives
,,,,,,95% Confidence Interval for Mean,,,
,,N,Mean,Std. Deviation,Std. Error,Lower Bound,Upper Bound,Minimum,Maximum
x,10.00,3,3.67,4.62,2.67,-7.81,15.14,1.00,9.00
Table: Test of Homogeneity of Variances
,Levene Statistic,df1,df2,Sig.
-x,18.76,3,20,.00
-y,71.41,3,20,.00
-z,.89,3,20,.46
+x,18.76,3,20,.000
+y,71.41,3,20,.000
+z,.89,3,20,.463
Table: ANOVA
,,Sum of Squares,df,Mean Square,F,Sig.
-x,Between Groups,56.16,3,18.72,2.92,.06
+x,Between Groups,56.16,3,18.72,2.92,.059
,Within Groups,128.34,20,6.42,,
,Total,184.50,23,,,
-y,Between Groups,7.75,3,2.58,13.33,.00
+y,Between Groups,7.75,3,2.58,13.33,.000
,Within Groups,3.87,20,.19,,
,Total,11.63,23,,,
-z,Between Groups,17.47,3,5.82,.62,.61
+z,Between Groups,17.47,3,5.82,.62,.610
,Within Groups,187.87,20,9.39,,
,Total,205.33,23,,,
Table: Contrast Tests
,,Contrast,Value of Contrast,Std. Error,t,df,Sig. (2-tailed)
-x,Assume equal variances,1,-7.40,6.67,1.11,20,.28
-,,2,6.26,12.32,.51,20,.62
-,Does not assume equal,1,-7.40,10.04,-.74,4.53,.50
-,,2,6.26,5.85,1.07,2.87,.37
-y,Assume equal variances,1,-6.88,1.16,5.94,20,.00
-,,2,3.50,2.14,1.63,20,.12
-,Does not assume equal,1,-6.88,.91,-7.51,7.00,.00
-,,2,3.50,1.32,2.65,7.00,.03
-z,Assume equal variances,1,-9.70,8.07,1.20,20,.24
-,,2,11.73,14.91,.79,20,.44
-,Does not assume equal,1,-9.70,9.57,-1.01,3.64,.37
-,,2,11.73,14.53,.81,9.88,.44
+x,Assume equal variances,1,-7.40,6.67,1.11,20,.280
+,,2,6.26,12.32,.51,20,.617
+,Does not assume equal,1,-7.40,10.04,-.74,4.53,.497
+,,2,6.26,5.85,1.07,2.87,.366
+y,Assume equal variances,1,-6.88,1.16,5.94,20,.000
+,,2,3.50,2.14,1.63,20,.118
+,Does not assume equal,1,-6.88,.91,-7.51,7.00,.000
+,,2,3.50,1.32,2.65,7.00,.033
+z,Assume equal variances,1,-9.70,8.07,1.20,20,.243
+,,2,11.73,14.91,.79,20,.440
+,Does not assume equal,1,-9.70,9.57,-1.01,3.64,.373
+,,2,11.73,14.53,.81,9.88,.438
])
AT_CLEANUP
AT_CHECK([pspp -O format=csv oneway-sidak.sps], [0],
[Table: ANOVA
,,Sum of Squares,df,Mean Square,F,Sig.
-score,Between Groups,54.9500,3,18.3167,7.0449,.0031
+score,Between Groups,54.9500,3,18.3167,7.0449,.003
,Within Groups,41.6000,16,2.6000,,
,Total,96.5500,19,,,
Table: Multiple Comparisons (score)
,,,Mean Difference,,,95% Confidence Interval,
,(I) program,(J) program,(I - J),Std. Error,Sig.,Lower Bound,Upper Bound
-Šidák,1.0000,2.0000,3.0000,1.0198,.0561,-.0575,6.0575
-,,3.0000,-.4000,1.0198,.9993,-3.4575,2.6575
-,,4.0000,3.2000,1.0198,.0375,.1425,6.2575
-,2.0000,1.0000,-3.0000,1.0198,.0561,-6.0575,.0575
-,,3.0000,-3.4000,1.0198,.0250,-6.4575,-.3425
-,,4.0000,.2000,1.0198,1.0000,-2.8575,3.2575
-,3.0000,1.0000,.4000,1.0198,.9993,-2.6575,3.4575
-,,2.0000,3.4000,1.0198,.0250,.3425,6.4575
-,,4.0000,3.6000,1.0198,.0166,.5425,6.6575
-,4.0000,1.0000,-3.2000,1.0198,.0375,-6.2575,-.1425
-,,2.0000,-.2000,1.0198,1.0000,-3.2575,2.8575
-,,3.0000,-3.6000,1.0198,.0166,-6.6575,-.5425
+Šidák,1.0000,2.0000,3.0000,1.0198,.056,-.0575,6.0575
+,,3.0000,-.4000,1.0198,.999,-3.4575,2.6575
+,,4.0000,3.2000,1.0198,.038,.1425,6.2575
+,2.0000,1.0000,-3.0000,1.0198,.056,-6.0575,.0575
+,,3.0000,-3.4000,1.0198,.025,-6.4575,-.3425
+,,4.0000,.2000,1.0198,1.000,-2.8575,3.2575
+,3.0000,1.0000,.4000,1.0198,.999,-2.6575,3.4575
+,,2.0000,3.4000,1.0198,.025,.3425,6.4575
+,,4.0000,3.6000,1.0198,.017,.5425,6.6575
+,4.0000,1.0000,-3.2000,1.0198,.038,-6.2575,-.1425
+,,2.0000,-.2000,1.0198,1.000,-3.2575,2.8575
+,,3.0000,-3.6000,1.0198,.017,-6.6575,-.5425
])
AT_CLEANUP
Table: ANOVA
,,Sum of Squares,df,Mean Square,F,Sig.
-height,Between Groups,92629.63,1,92629.63,120.77,.00
+height,Between Groups,92629.63,1,92629.63,120.77,.000
,Within Groups,4601.87,6,766.98,,
,Total,97231.50,7,,,
-weight,Between Groups,2451.65,1,2451.65,174.59,.00
+weight,Between Groups,2451.65,1,2451.65,174.59,.000
,Within Groups,84.25,6,14.04,,
,Total,2535.90,7,,,
-temperature,Between Groups,1.80,1,1.80,.13,.73
+temperature,Between Groups,1.80,1,1.80,.13,.733
,Within Groups,84.55,6,14.09,,
,Total,86.36,7,,,
Table: Contrast Tests
,,Contrast,Value of Contrast,Std. Error,t,df,Sig. (2-tailed)
-height,Assume equal variances,1,-222.27,20.23,10.99,6,.00
-,,2,-666.80,60.68,10.99,6,.00
-,,3,-2000.40,182.03,10.99,6,.00
-,Does not assume equal,1,-222.27,27.67,-8.03,2.00,.02
-,,2,-666.80,83.02,-8.03,2.00,.02
-,,3,-2000.40,249.07,-8.03,2.00,.02
-weight,Assume equal variances,1,-36.16,2.74,13.21,6,.00
-,,2,-108.48,8.21,13.21,6,.00
-,,3,-325.44,24.63,13.21,6,.00
-,Does not assume equal,1,-36.16,2.19,-16.48,5.42,.00
-,,2,-108.48,6.58,-16.48,5.42,.00
-,,3,-325.44,19.75,-16.48,5.42,.00
-temperature,Assume equal variances,1,-.98,2.74,.36,6,.73
-,,2,-2.94,8.22,.36,6,.73
-,,3,-8.83,24.67,.36,6,.73
-,Does not assume equal,1,-.98,2.07,-.47,4.19,.66
-,,2,-2.94,6.22,-.47,4.19,.66
-,,3,-8.83,18.66,-.47,4.19,.66
+height,Assume equal variances,1,-222.27,20.23,10.99,6,.000
+,,2,-666.80,60.68,10.99,6,.000
+,,3,-2000.40,182.03,10.99,6,.000
+,Does not assume equal,1,-222.27,27.67,-8.03,2.00,.015
+,,2,-666.80,83.02,-8.03,2.00,.015
+,,3,-2000.40,249.07,-8.03,2.00,.015
+weight,Assume equal variances,1,-36.16,2.74,13.21,6,.000
+,,2,-108.48,8.21,13.21,6,.000
+,,3,-325.44,24.63,13.21,6,.000
+,Does not assume equal,1,-36.16,2.19,-16.48,5.42,.000
+,,2,-108.48,6.58,-16.48,5.42,.000
+,,3,-325.44,19.75,-16.48,5.42,.000
+temperature,Assume equal variances,1,-.98,2.74,.36,6,.733
+,,2,-2.94,8.22,.36,6,.733
+,,3,-8.83,24.67,.36,6,.733
+,Does not assume equal,1,-.98,2.07,-.47,4.19,.660
+,,2,-2.94,6.22,-.47,4.19,.660
+,,3,-8.83,18.66,-.47,4.19,.660
])
AT_CLEANUP
end data
regression /variables=v0 v1 /statistics defaults /dependent=v0 /method=enter.
])
-AT_CHECK([pspp -o pspp.csv regression.sps])
-AT_CHECK([cat pspp.csv], [0], [dnl
+AT_CHECK([pspp -O format=csv regression.sps], [0], [dnl
Table: Reading free-form data from INLINE.
Variable,Format
v0,F8.0
Table: Coefficients (v0)
,,Unstandardized Coefficients,,Standardized Coefficients,,
,,B,Std. Error,Beta,t,Sig.
-,(Constant),1.24,.42,.00,2.95,.00
-,v1,1.37,.72,.05,1.89,.06
+,(Constant),1.24,.42,.00,2.95,.003
+,v1,1.37,.72,.05,1.89,.059
])
+
AT_CLEANUP
AT_SETUP([LINEAR REGRESSION no crash on all missing])
-/AT_BANNER([T-TEST])
+AT_BANNER([T-TEST])
AT_SETUP([T-TEST /PAIRS])
AT_DATA([t-test.sps], [dnl
t-test /PAIRS a with b (PAIRED).
])
-AT_CHECK([pspp -o pspp.csv t-test.sps])
-AT_CHECK([cat pspp.csv], [0], [dnl
+
+AT_CHECK([pspp -O format=csv t-test.sps], [0], [dnl
Table: Reading free-form data from INLINE.
Variable,Format
ID,F8.0
,,Paired Differences,,,,,,,
,,,,,95% Confidence Interval of the Difference,,,,
,,Mean,Std. Deviation,Std. Error Mean,Lower,Upper,t,df,Sig. (2-tailed)
-Pair 1,A - B,-2.00,.94,.42,-3.16,-.84,-4.78,4,.01
+Pair 1,A - B,-2.00,.94,.42,-3.16,-.84,-4.78,4,.009
])
+
AT_CLEANUP
+
AT_SETUP([T-TEST /PAIRS with per-analysis missing values])
+
AT_DATA([ref.sps], [dnl
data list list /id * a * b * c * d *.
begin data.
t-test /PAIRS a c with b d (PAIRED).
])
+
AT_DATA([expout], [dnl
Table: Reading free-form data from INLINE.
Variable,Format
,,Paired Differences,,,,,,,
,,,,,95% Confidence Interval of the Difference,,,,
,,Mean,Std. Deviation,Std. Error Mean,Lower,Upper,t,df,Sig. (2-tailed)
-Pair 1,a - b,-2.00,.94,.42,-3.16,-.84,-4.78,4,.01
-Pair 2,c - d,1.30,.84,.37,.26,2.34,3.47,4,.03
+Pair 1,a - b,-2.00,.94,.42,-3.16,-.84,-4.78,4,.009
+Pair 2,c - d,1.30,.84,.37,.26,2.34,3.47,4,.025
])
+
AT_CHECK([pspp -o ref.csv ref.sps])
AT_CHECK([cat ref.csv], [0], [expout])
AT_DATA([missing.sps], [dnl
t-test /MISSING=analysis /PAIRS a c with b d (PAIRED) /CRITERIA=CIN(0.95).
])
+
AT_CHECK([pspp -o missing.csv missing.sps])
AT_CHECK([cat missing.csv], [0], [expout])
AT_CLEANUP
,,Paired Differences,,,,,,,
,,,,,95% Confidence Interval of the Difference,,,,
,,Mean,Std. Deviation,Std. Error Mean,Lower,Upper,t,df,Sig. (2-tailed)
-Pair 1,a - c,-3.10,.76,.34,-4.04,-2.16,-9.14,4,.00
-Pair 2,b - d,.20,1.68,.75,-1.89,2.29,.27,4,.80
+Pair 1,a - c,-3.10,.76,.34,-4.04,-2.16,-9.14,4,.001
+Pair 2,b - d,.20,1.68,.75,-1.89,2.29,.27,4,.803
])
+
AT_CHECK([pspp -o ref.csv ref.sps])
+
AT_CHECK([cat ref.csv], [0], [expout])
+
AT_DATA([missing.sps], [dnl
data list list /id * a * b * c * d *.
begin data.
t-test /GROUPS=indep(1.1,2.1) /var=dep1 dep2.
])
-AT_CHECK([pspp -o pspp.csv t-test.sps])
-AT_CHECK([cat pspp.csv], [0], [dnl
+
+AT_CHECK([pspp -O format=csv t-test.sps], [0], [dnl
Table: Reading free-form data from INLINE.
Variable,Format
ID,F8.0
,,Levene's Test for Equality of Variances,,t-test for Equality of Means,,,,,,
,,,,,,,,,95% Confidence Interval of the Difference,
,,F,Sig.,t,df,Sig. (2-tailed),Mean Difference,Std. Error Difference,Lower,Upper
-DEP1,Equal 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
-DEP2,Equal 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
+DEP1,Equal variances assumed,.00,1.00,-4.47,8.00,.002,-2.00,.45,-3.03,-.97
+,Equal variances not assumed,,,-4.47,8.00,.002,-2.00,.45,-3.03,-.97
+DEP2,Equal variances assumed,.00,1.00,4.47,8.00,.002,2.00,.45,.97,3.03
+,Equal variances not assumed,,,4.47,8.00,.002,2.00,.45,.97,3.03
])
+
AT_CLEANUP
AT_SETUP([T-TEST /GROUPS with one value for independent variable])
end data.
t-test /groups=indep(1.514) /var=dep.
])
-AT_CHECK([pspp -o pspp.csv t-test.sps])
-AT_CHECK([cat pspp.csv], [0], [dnl
+AT_CHECK([pspp -O format=csv t-test.sps], [0], [dnl
Table: Reading free-form data from INLINE.
Variable,Format
INDEP,F8.0
,,Levene's Test for Equality of Variances,,t-test for Equality of Means,,,,,,
,,,,,,,,,95% Confidence Interval of the Difference,
,,F,Sig.,t,df,Sig. (2-tailed),Mean Difference,Std. Error Difference,Lower,Upper
-DEP,Equal variances assumed,.17,.68,.69,20.00,.50,1.00,1.44,-2.00,4.00
-,Equal variances not assumed,,,.69,18.54,.50,1.00,1.44,-2.02,4.02
+DEP,Equal variances assumed,.17,.68,.69,20.00,.495,1.00,1.44,-2.00,4.00
+,Equal variances not assumed,,,.69,18.54,.496,1.00,1.44,-2.02,4.02
])
AT_CLEANUP
,,Levene's Test for Equality of Variances,,t-test for Equality of Means,,,,,,
,,,,,,,,,95% Confidence Interval of the Difference,
,,F,Sig.,t,df,Sig. (2-tailed),Mean Difference,Std. Error Difference,Lower,Upper
-dep1,Equal variances assumed,3.75,.15,-1.12,3.00,.35,-.75,.67,-2.89,1.39
-,Equal variances not assumed,,,-1.34,2.78,.28,-.75,.56,-2.61,1.11
-dep2,Equal variances assumed,.60,.50,2.85,3.00,.07,3.00,1.05,-.35,6.35
-,Equal variances not assumed,,,2.60,1.68,.14,3.00,1.15,-2.98,8.98
+dep1,Equal variances assumed,3.75,.15,-1.12,3.00,.346,-.75,.67,-2.89,1.39
+,Equal variances not assumed,,,-1.34,2.78,.279,-.75,.56,-2.61,1.11
+dep2,Equal variances assumed,.60,.50,2.85,3.00,.065,3.00,1.05,-.35,6.35
+,Equal variances not assumed,,,2.60,1.68,.144,3.00,1.15,-2.98,8.98
])
AT_CHECK([pspp -o ref.csv ref.sps])
AT_CHECK([cat ref.csv], [0], [expout])
t-test /group=indep /var=dep1 dep2.
])
+
AT_DATA([expout], [dnl
Table: Reading free-form data from INLINE.
Variable,Format
,,Levene's Test for Equality of Variances,,t-test for Equality of Means,,,,,,
,,,,,,,,,95% Confidence Interval of the Difference,
,,F,Sig.,t,df,Sig. (2-tailed),Mean Difference,Std. Error Difference,Lower,Upper
-dep1,Equal variances assumed,2.00,.23,-1.73,4.00,.16,-1.00,.58,-2.60,.60
-,Equal variances not assumed,,,-1.73,3.20,.18,-1.00,.58,-2.77,.77
-dep2,Equal variances assumed,.00,1.00,3.67,4.00,.02,3.00,.82,.73,5.27
-,Equal variances not assumed,,,3.67,4.00,.02,3.00,.82,.73,5.27
+dep1,Equal variances assumed,2.00,.23,-1.73,4.00,.158,-1.00,.58,-2.60,.60
+,Equal variances not assumed,,,-1.73,3.20,.176,-1.00,.58,-2.77,.77
+dep2,Equal variances assumed,.00,1.00,3.67,4.00,.021,3.00,.82,.73,5.27
+,Equal variances not assumed,,,3.67,4.00,.021,3.00,.82,.73,5.27
])
+
AT_CHECK([pspp -o ref.csv ref.sps])
AT_CHECK([cat ref.csv], [0], [expout])
AT_DATA([missing.sps], [dnl
t-test /testval=2.0 /var=abc.
])
-AT_CHECK([pspp -o pspp.csv t-test.sps])
-AT_CHECK([cat pspp.csv], [0], [dnl
+AT_CHECK([pspp -O format=csv t-test.sps], [0], [dnl
Table: Reading free-form data from INLINE.
Variable,Format
ID,F8.0
,Test Value = 2.000000,,,,,
,,,,,95% Confidence Interval of the Difference,
,t,df,Sig. (2-tailed),Mean Difference,Lower,Upper
-ABC,2.93,5,.03,1.00,.12,1.88
+ABC,2.93,5,.033,1.00,.12,1.88
])
AT_CLEANUP
,Test Value = 3.000000,,,,,
,,,,,95% Confidence Interval of the Difference,
,t,df,Sig. (2-tailed),Mean Difference,Lower,Upper
-x1,.00,5,1.00,.00,-.88,.88
-x2,2.18,5,.08,29.67,-5.39,64.72
+x1,.00,5,1.000,.00,-.88,.88
+x2,2.18,5,.082,29.67,-5.39,64.72
])
AT_CHECK([pspp -o ref.csv ref.sps])
AT_CHECK([cat ref.csv], [0], [expout])
,Test Value = 3.000000,,,,,
,,,,,95% Confidence Interval of the Difference,
,t,df,Sig. (2-tailed),Mean Difference,Lower,Upper
-x1,-.59,4,.59,-.20,-1.14,.74
-x2,2.22,4,.09,34.60,-8.63,77.83
+x1,-.59,4,.587,-.20,-1.14,.74
+x2,2.22,4,.090,34.60,-8.63,77.83
])
AT_CHECK([pspp -o ref.csv ref.sps])
AT_CHECK([cat ref.csv], [0], [expout])
,,Levene's Test for Equality of Variances,,t-test for Equality of Means,,,,,,
,,,,,,,,,95% Confidence Interval of the Difference,
,,F,Sig.,t,df,Sig. (2-tailed),Mean Difference,Std. Error Difference,Lower,Upper
-x,Equal variances assumed,2.00,.23,-1.73,4.00,.16,-1.00,.58,-2.60,.60
-,Equal variances not assumed,,,-1.73,3.20,.18,-1.00,.58,-2.77,.77
+x,Equal variances assumed,2.00,.23,-1.73,4.00,.158,-1.00,.58,-2.60,.60
+,Equal variances not assumed,,,-1.73,3.20,.176,-1.00,.58,-2.77,.77
])
AT_CHECK([pspp -o ref.csv ref.sps])
AT_CHECK([cat ref.csv], [0], [expout])
t-test /GROUPS=indep('a','b') /var=dep1 dep2.
])
-AT_CHECK([pspp -o pspp.csv t-test.sps])
-AT_CHECK([cat pspp.csv], [0], [dnl
+
+AT_CHECK([pspp -O format=csv t-test.sps], [0], [dnl
Table: Reading free-form data from INLINE.
Variable,Format
ID,F8.0
,,Levene's Test for Equality of Variances,,t-test for Equality of Means,,,,,,
,,,,,,,,,95% Confidence Interval of the Difference,
,,F,Sig.,t,df,Sig. (2-tailed),Mean Difference,Std. Error Difference,Lower,Upper
-DEP1,Equal 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
-DEP2,Equal 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
+DEP1,Equal variances assumed,.00,1.00,-4.47,8.00,.002,-2.00,.45,-3.03,-.97
+,Equal variances not assumed,,,-4.47,8.00,.002,-2.00,.45,-3.03,-.97
+DEP2,Equal variances assumed,.00,1.00,4.47,8.00,.002,2.00,.45,.97,3.03
+,Equal variances not assumed,,,4.47,8.00,.002,2.00,.45,.97,3.03
])
AT_CLEANUP
t-test group=gv('One', 'Two')
/variables = x.
])
-AT_CHECK([pspp -o pspp.csv t-test.sps])
-AT_CHECK([cat pspp.csv], [0], [dnl
+AT_CHECK([pspp -O format=csv t-test.sps], [0], [dnl
Table: Reading free-form data from INLINE.
Variable,Format
x,F8.0
,,Levene's Test for Equality of Variances,,t-test for Equality of Means,,,,,,
,,,,,,,,,95% Confidence Interval of the Difference,
,,F,Sig.,t,df,Sig. (2-tailed),Mean Difference,Std. Error Difference,Lower,Upper
-x,Equal variances assumed,1.13,.33,-2.32,6.00,.06,-.90,.39,-1.85,.05
-,Equal variances not assumed,,,-2.38,4.70,.07,-.90,.38,-1.89,.09
+x,Equal variances assumed,1.13,.33,-2.32,6.00,.060,-.90,.39,-1.85,.05
+,Equal variances not assumed,,,-2.38,4.70,.067,-.90,.38,-1.89,.09
])
AT_CLEANUP