- for (v = 0; v < cmd->n_dep_vars; ++v)
- {
- int ivar_idx;
- const union value **prev_values = previous_value_alloc (iact);
-
- if ( v > 0 )
- tab_hline (t, TAL_1, 0, nc - 1, heading_rows + v * n_cats);
-
- tab_text (t,
- 0, heading_rows + n_cats * v,
- TAT_TITLE,
- var_to_string (cmd->dep_vars[v])
- );
-
-
- for (i = 0; i < n_cats; ++i)
- {
- double total;
- const struct exploratory_stats *es;
-
- const struct ccase *c =
- categoricals_get_case_by_category_real (cmd->cats,
- iact_idx, i);
- if (c)
- {
- int diff_idx = previous_value_record (iact, c, prev_values);
-
- if ( diff_idx != -1 && diff_idx < iact->n_vars - 1)
- tab_hline (t, TAL_1, 1 + diff_idx, nc - 1,
- heading_rows + n_cats * v + i );
-
- for (ivar_idx = 0; ivar_idx < iact->n_vars; ++ivar_idx)
- {
- const struct variable *ivar = iact->vars[ivar_idx];
- const union value *val = case_data (c, ivar);
-
- if (( diff_idx != -1 && diff_idx <= ivar_idx)
- || i == 0)
- {
- struct string str;
- ds_init_empty (&str);
- var_append_value_name (ivar, val, &str);
-
- tab_text (t,
- 1 + ivar_idx, heading_rows + n_cats * v + i,
- TAT_TITLE | TAB_LEFT,
- ds_cstr (&str)
- );
-
- ds_destroy (&str);
- }
- }
- }
-
-
- es = categoricals_get_user_data_by_category_real (cmd->cats, iact_idx, i);
-
-
- total = es[v].missing + es[v].non_missing;
- tab_double (t,
- heading_columns + 0,
- heading_rows + n_cats * v + i,
- 0,
- es[v].non_missing,
- wfmt);
-
-
- tab_text_format (t,
- heading_columns + 1,
- heading_rows + n_cats * v + i,
- 0,
- "%g%%",
- 100.0 * es[v].non_missing / total
- );
-
-
- tab_double (t,
- heading_columns + 2,
- heading_rows + n_cats * v + i,
- 0,
- es[v].missing,
- wfmt);
-
- tab_text_format (t,
- heading_columns + 3,
- heading_rows + n_cats * v + i,
- 0,
- "%g%%",
- 100.0 * es[v].missing / total
- );
- tab_double (t,
- heading_columns + 4,
- heading_rows + n_cats * v + i,
- 0,
- total,
- wfmt);
-
- /* This can only be 100% can't it? */
- tab_text_format (t,
- heading_columns + 5,
- heading_rows + n_cats * v + i,
- 0,
- "%g%%",
- 100.0 * (es[v].missing + es[v].non_missing)/ total
- );
- }
- free (prev_values);
- }
+ for (v = 0; v < cmd->n_dep_vars; ++v)
+ {
+ int ivar_idx;
+ const union value **prev_values = previous_value_alloc (iact);
+
+ if ( v > 0 )
+ tab_hline (t, TAL_1, 0, nc - 1, heading_rows + v * n_cats);
+
+ tab_text (t,
+ 0, heading_rows + n_cats * v,
+ TAT_TITLE,
+ var_to_string (cmd->dep_vars[v])
+ );
+
+
+ for (i = 0; i < n_cats; ++i)
+ {
+ double total;
+ const struct exploratory_stats *es;
+
+ const struct ccase *c =
+ categoricals_get_case_by_category_real (cmd->cats,
+ iact_idx, i);
+ if (c)
+ {
+ int diff_idx = previous_value_record (iact, c, prev_values);
+
+ if ( diff_idx != -1 && diff_idx < iact->n_vars - 1)
+ tab_hline (t, TAL_1, 1 + diff_idx, nc - 1,
+ heading_rows + n_cats * v + i );
+
+ for (ivar_idx = 0; ivar_idx < iact->n_vars; ++ivar_idx)
+ {
+ const struct variable *ivar = iact->vars[ivar_idx];
+ const union value *val = case_data (c, ivar);
+
+ if (( diff_idx != -1 && diff_idx <= ivar_idx)
+ || i == 0)
+ {
+ struct string str;
+ ds_init_empty (&str);
+ append_value_name (ivar, val, &str);
+
+ tab_text (t,
+ 1 + ivar_idx, heading_rows + n_cats * v + i,
+ TAT_TITLE | TAB_LEFT,
+ ds_cstr (&str)
+ );
+
+ ds_destroy (&str);
+ }
+ }
+ }
+
+
+ es = categoricals_get_user_data_by_category_real (cmd->cats, iact_idx, i);
+
+
+ total = es[v].missing + es[v].non_missing;
+ tab_double (t,
+ heading_columns + 0,
+ heading_rows + n_cats * v + i,
+ 0,
+ es[v].non_missing,
+ NULL, RC_WEIGHT);
+
+
+ tab_text_format (t,
+ heading_columns + 1,
+ heading_rows + n_cats * v + i,
+ 0,
+ "%g%%",
+ 100.0 * es[v].non_missing / total
+ );
+
+
+ tab_double (t,
+ heading_columns + 2,
+ heading_rows + n_cats * v + i,
+ 0,
+ es[v].missing,
+ NULL, RC_WEIGHT);
+
+ tab_text_format (t,
+ heading_columns + 3,
+ heading_rows + n_cats * v + i,
+ 0,
+ "%g%%",
+ 100.0 * es[v].missing / total
+ );
+ tab_double (t,
+ heading_columns + 4,
+ heading_rows + n_cats * v + i,
+ 0,
+ total,
+ NULL, RC_WEIGHT);
+
+ /* This can only be 100% can't it? */
+ tab_text_format (t,
+ heading_columns + 5,
+ heading_rows + n_cats * v + i,
+ 0,
+ "%g%%",
+ 100.0 * (es[v].missing + es[v].non_missing)/ total
+ );
+ }
+ free (prev_values);
+ }