- struct hmapx_node *node;
- struct per_var_stats *per_var_stats;
-
- const int heading_rows = 3;
- const size_t rows = heading_rows + tt->n_vars;
- const size_t cols = 7;
- 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_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);
-
- tab_title (t, _("One-Sample Test"));
- tab_hline (t, TAL_1, 1, cols - 1, 1);
- tab_vline (t, TAL_2, 1, 0, rows - 1);
-
- tab_joint_text_format (t, 1, 0, cols - 1, 0, TAB_CENTER,
- _("Test Value = %f"), os->testval);
-
- tab_box (t, -1, -1, -1, TAL_1, 1, 1, cols - 1, rows - 1);
-
- tab_joint_text_format (t, 5, 1, 6, 1, TAB_CENTER,
- _("%g%% Confidence Interval of the Difference"),
- tt->confidence * 100.0);
-
- tab_vline (t, TAL_GAP, 6, 1, 1);
- tab_hline (t, TAL_1, 5, 6, 2);
- tab_text (t, 1, 2, TAB_CENTER | TAT_TITLE, _("t"));
- tab_text (t, 2, 2, TAB_CENTER | TAT_TITLE, _("df"));
- tab_text (t, 3, 2, TAB_CENTER | TAT_TITLE, _("Sig. (2-tailed)"));
- tab_text (t, 4, 2, TAB_CENTER | TAT_TITLE, _("Mean Difference"));
- tab_text (t, 5, 2, TAB_CENTER | TAT_TITLE, _("Lower"));
- tab_text (t, 6, 2, TAB_CENTER | TAT_TITLE, _("Upper"));
-
- HMAPX_FOR_EACH (per_var_stats, node, &os->hmap)
+ struct pivot_table *table = pivot_table_create (N_("One-Sample Test"));
+ pivot_table_set_weight_var (table, tt->wv);
+
+ struct pivot_dimension *statistics = pivot_dimension_create (
+ table, PIVOT_AXIS_COLUMN, N_("Statistics"));
+ struct pivot_category *group = pivot_category_create_group__ (
+ statistics->root, pivot_value_new_user_text_nocopy (
+ xasprintf (_("Test Value = %.*g"), DBL_DIG + 1, os->testval)));
+ pivot_category_create_leaves (
+ group,
+ N_("t"), PIVOT_RC_OTHER,
+ N_("df"), PIVOT_RC_COUNT,
+ N_("Sig. (2-tailed)"), PIVOT_RC_SIGNIFICANCE,
+ N_("Mean Difference"), PIVOT_RC_OTHER);
+ struct pivot_category *subgroup = pivot_category_create_group__ (
+ group, pivot_value_new_user_text_nocopy (
+ xasprintf (_("%g%% Confidence Interval of the Difference"),
+ tt->confidence * 100.0)));
+ pivot_category_create_leaves (subgroup,
+ N_("Lower"), PIVOT_RC_OTHER,
+ N_("Upper"), PIVOT_RC_OTHER);
+
+ struct pivot_dimension *dep_vars = pivot_dimension_create (
+ table, PIVOT_AXIS_ROW, N_("Dependent Variables"));
+
+ for (size_t i = 0; i < os->n_stats; i++)