+/* Displays a table of all the statistics requested. */
+static struct frq_stats_table *
+frq_stats_table_create (const struct frq_proc *frq,
+ const struct dictionary *dict,
+ const struct variable *wv)
+{
+ if (all_string_variables (frq))
+ return NULL;
+
+ struct pivot_table *table = pivot_table_create (N_("Statistics"));
+ pivot_table_set_weight_var (table, wv);
+
+ struct pivot_dimension *variables
+ = pivot_dimension_create (table, PIVOT_AXIS_COLUMN, N_("Variables"));
+ for (size_t i = 0; i < frq->n_vars; i++)
+ if (!var_is_alpha (frq->vars[i].var))
+ pivot_category_create_leaf (variables->root,
+ pivot_value_new_variable (frq->vars[i].var));
+
+ struct pivot_dimension *statistics = pivot_dimension_create (
+ table, PIVOT_AXIS_ROW, N_("Statistics"));
+ struct pivot_category *n = pivot_category_create_group (
+ statistics->root, N_("N"));
+ pivot_category_create_leaves (n,
+ N_("Valid"), PIVOT_RC_COUNT,
+ N_("Missing"), PIVOT_RC_COUNT);
+ for (int i = 0; i < FRQ_ST_count; i++)
+ if (frq->stats & BIT_INDEX (i))
+ pivot_category_create_leaf (statistics->root,
+ pivot_value_new_text (st_name[i]));
+ struct pivot_category *percentiles = NULL;
+ for (size_t i = 0; i < frq->n_percentiles; i++)