- tab_title (t, "%s: %s", v->name, v->label ? v->label : "");
- tab_submit (t);
-
-}
-
-/* Sets the widths of all the columns and heights of all the rows in
- table T for driver D. */
-static void
-condensed_dim (struct tab_table *t, struct outp_driver *d)
-{
- int cum_w = max (outp_string_width (d, _("Cum"), OUTP_PROPORTIONAL),
- max (outp_string_width (d, _("Cum"), OUTP_PROPORTIONAL),
- outp_string_width (d, "000", OUTP_PROPORTIONAL)));
-
- int i;
-
- for (i = 0; i < 2; i++)
- t->w[i] = max (tab_natural_width (t, d, i), d->prop_em_width * 8);
- for (i = 2; i < 4; i++)
- t->w[i] = cum_w;
- for (i = 0; i < t->nr; i++)
- t->h[i] = d->font_height;
-}
-
-/* Display condensed frequency table for variable V. */
-static void
-dump_condensed (struct variable *v)
-{
- int n_categories;
- struct freq_tab *ft;
- struct freq *f;
- struct tab_table *t;
- int r;
- double cum_total = 0.0;
-
- ft = &get_var_freqs (v)->tab;
- n_categories = ft->n_valid + ft->n_missing;
- t = tab_create (4, n_categories + 2, 0);
-
- tab_headers (t, 0, 0, 2, 0);
- tab_text (t, 0, 1, TAB_CENTER | TAT_TITLE, _("Value"));
- tab_text (t, 1, 1, TAB_CENTER | TAT_TITLE, _("Freq"));
- tab_text (t, 2, 1, TAB_CENTER | TAT_TITLE, _("Pct"));
- tab_text (t, 3, 0, TAB_CENTER | TAT_TITLE, _("Cum"));
- tab_text (t, 3, 1, TAB_CENTER | TAT_TITLE, _("Pct"));
- tab_dim (t, condensed_dim);
-
- r = 2;
- for (f = ft->valid; f < ft->missing; f++)
- {
- double percent;
-
- percent = f->c / ft->total_cases * 100.0;
- cum_total += f->c / ft->valid_cases * 100.0;
-
- tab_value (t, 0, r, TAB_NONE, &f->v, &v->print);
- tab_float (t, 1, r, TAB_NONE, f->c, 8, 0);
- tab_float (t, 2, r, TAB_NONE, percent, 3, 0);
- tab_float (t, 3, r, TAB_NONE, cum_total, 3, 0);
- r++;
- }
- for (; f < &ft->valid[n_categories]; f++)
- {
- tab_value (t, 0, r, TAB_NONE, &f->v, &v->print);
- tab_float (t, 1, r, TAB_NONE, f->c, 8, 0);
- tab_float (t, 2, r, TAB_NONE,
- f->c / ft->total_cases * 100.0, 3, 0);
- r++;
- }
-
- tab_box (t, TAL_1, TAL_1,
- cmd.spaces == FRQ_SINGLE ? -1 : TAL_GAP, TAL_1,
- 0, 0, 3, r - 1);
- tab_hline (t, TAL_2, 0, 3, 2);
- tab_title (t, "%s: %s", v->name, v->label ? v->label : "");
- tab_columns (t, SOM_COL_DOWN, 1);