- size_t n_pairs = hmapx_count (&os->hmap);
- struct hmapx_node *node;
- struct pair_stats *pp = NULL;
-
- const int heading_rows = 3;
- const int heading_cols = 2;
- const size_t rows = heading_rows + n_pairs;
- const size_t cols = 10;
- 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);
-
- tab_title (t, _("Paired Samples Test"));
- tab_hline (t, TAL_1, heading_cols, 6, 1);
- tab_vline (t, TAL_2, heading_cols, 0, rows - 1);
-
- tab_box (t, -1, -1, -1, TAL_1, heading_cols, 0, cols - 1, rows - 1);
-
- tab_joint_text (t, 2, 0, 6, 0, TAB_CENTER,
- _("Paired Differences"));
-
- 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, 7, 2, TAB_CENTER | TAT_TITLE, _("t"));
- tab_text (t, 8, 2, TAB_CENTER | TAT_TITLE, _("df"));
- tab_text (t, 9, 2, TAB_CENTER | TAT_TITLE, _("Sig. (2-tailed)"));
- tab_text (t, 4, 2, TAB_CENTER | TAT_TITLE, _("Std. Error Mean"));
- tab_text (t, 3, 2, TAB_CENTER | TAT_TITLE, _("Std. Deviation"));
- tab_text (t, 2, 2, TAB_CENTER | TAT_TITLE, _("Mean"));
-
- tab_text (t, 5, 2, TAB_CENTER | TAT_TITLE, _("Lower"));
- tab_text (t, 6, 2, TAB_CENTER | TAT_TITLE, _("Upper"));
-
- HMAPX_FOR_EACH (pp, node, &os->hmap)
+ struct pivot_table *table = pivot_table_create (N_("Paired Samples 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, N_("Paired Differences"),
+ N_("Mean"), PIVOT_RC_OTHER,
+ N_("Std. Deviation"), PIVOT_RC_OTHER,
+ N_("S.E. Mean"), PIVOT_RC_OTHER);
+ struct pivot_category *interval = pivot_category_create_group__ (
+ group, pivot_value_new_text_format (
+ N_("%g%% Confidence Interval of the Difference"),
+ tt->confidence * 100.0));
+ pivot_category_create_leaves (interval,
+ N_("Lower"), PIVOT_RC_OTHER,
+ N_("Upper"), PIVOT_RC_OTHER);
+ pivot_category_create_leaves (statistics->root,
+ N_("t"), PIVOT_RC_OTHER,
+ N_("df"), PIVOT_RC_COUNT,
+ N_("Sig. (2-tailed)"), PIVOT_RC_SIGNIFICANCE);
+
+ struct pivot_dimension *pairs = pivot_dimension_create (
+ table, PIVOT_AXIS_ROW, N_("Pairs"));
+
+ for (size_t i = 0; i < os->n_ps; i++)