- int i;
- const int row_headers = 1;
- const int column_headers = 1;
- const struct fmt_spec *wfmt = wv ? var_get_print_format (wv) : & F_8_0;
-
- struct tab_table *table =
- tab_create (row_headers + 7, column_headers + nst->n_vars);
- tab_set_format (table, RC_WEIGHT, wfmt);
-
- tab_headers (table, row_headers, 0, column_headers, 0);
-
- tab_title (table, _("Jonckheere-Terpstra Test"));
-
- /* Vertical lines inside the box */
- tab_box (table, 1, 0, -1, TAL_1,
- row_headers, 0, tab_nc (table) - 1, tab_nr (table) - 1 );
-
- /* Box around the table */
- tab_box (table, TAL_2, TAL_2, -1, -1,
- 0, 0, tab_nc (table) - 1, tab_nr (table) - 1 );
-
- tab_hline (table, TAL_2, 0, tab_nc (table) -1, column_headers);
- tab_vline (table, TAL_2, row_headers, 0, tab_nr (table) - 1);
-
- tab_text_format (table, 1, 0, TAT_TITLE | TAB_CENTER,
- _("Number of levels in %s"),
- var_to_string (nst->indep_var));
- tab_text (table, 2, 0, TAT_TITLE | TAB_CENTER, _("N"));
- tab_text (table, 3, 0, TAT_TITLE | TAB_CENTER, _("Observed J-T Statistic"));
- tab_text (table, 4, 0, TAT_TITLE | TAB_CENTER, _("Mean J-T Statistic"));
- tab_text (table, 5, 0, TAT_TITLE | TAB_CENTER, _("Std. Deviation of J-T Statistic"));
- tab_text (table, 6, 0, TAT_TITLE | TAB_CENTER, _("Std. J-T Statistic"));
- tab_text (table, 7, 0, TAT_TITLE | TAB_CENTER, _("Asymp. Sig. (2-tailed)"));
-
-
- for (i = 0; i < nst->n_vars; ++i)
+ struct pivot_table *table = pivot_table_create (
+ N_("Jonckheere-Terpstra Test"));
+ pivot_table_set_weight_format (table, wfmt);
+
+ struct pivot_dimension *statistics = pivot_dimension_create (
+ table, PIVOT_AXIS_COLUMN, N_("Statistics"));
+ pivot_category_create_leaf_rc (
+ statistics->root,
+ pivot_value_new_text_format (N_("Number of levels in %s"),
+ var_to_string (nst->indep_var)),
+ PIVOT_RC_INTEGER);
+ pivot_category_create_leaves (
+ statistics->root,
+ N_("N"), PIVOT_RC_COUNT,
+ N_("Observed J-T Statistic"), PIVOT_RC_OTHER,
+ N_("Mean J-T Statistic"), PIVOT_RC_OTHER,
+ N_("Std. Deviation of J-T Statistic"), PIVOT_RC_OTHER,
+ N_("Std. J-T Statistic"), PIVOT_RC_OTHER,
+ N_("Asymp. Sig. (2-tailed)"), PIVOT_RC_SIGNIFICANCE);
+
+ struct pivot_dimension *variables = pivot_dimension_create (
+ table, PIVOT_AXIS_ROW, N_("Variable"));
+
+ for (size_t i = 0; i < nst->n_vars; ++i)