- int i;
- const int row_headers = 1;
- const int column_headers = 2;
- struct tab_table *table =
- tab_create (row_headers + 7, column_headers + nst->n_vars);
-
- struct string g1str, g2str;;
- ds_init_empty (&g1str);
- var_append_value_name (nst->indep_var, &nst->val1, &g1str);
-
- ds_init_empty (&g2str);
- var_append_value_name (nst->indep_var, &nst->val2, &g2str);
-
- tab_headers (table, row_headers, 0, column_headers, 0);
-
- tab_title (table, _("Ranks"));
-
- /* 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_hline (table, TAL_1, row_headers, tab_nc (table) -1, 1);
-
- tab_text (table, 1, 1, TAT_TITLE | TAB_CENTER, ds_cstr (&g1str));
- tab_text (table, 2, 1, TAT_TITLE | TAB_CENTER, ds_cstr (&g2str));
- tab_text (table, 3, 1, TAT_TITLE | TAB_CENTER, _("Total"));
- tab_joint_text (table, 1, 0, 3, 0,
- TAT_TITLE | TAB_CENTER, _("N"));
- tab_vline (table, TAL_2, 4, 0, tab_nr (table) - 1);
-
- tab_text (table, 4, 1, TAT_TITLE | TAB_CENTER, ds_cstr (&g1str));
- tab_text (table, 5, 1, TAT_TITLE | TAB_CENTER, ds_cstr (&g2str));
- tab_joint_text (table, 4, 0, 5, 0,
- TAT_TITLE | TAB_CENTER, _("Mean Rank"));
- tab_vline (table, TAL_2, 6, 0, tab_nr (table) - 1);
-
- tab_text (table, 6, 1, TAT_TITLE | TAB_CENTER, ds_cstr (&g1str));
- tab_text (table, 7, 1, TAT_TITLE | TAB_CENTER, ds_cstr (&g2str));
- tab_joint_text (table, 6, 0, 7, 0,
- TAT_TITLE | TAB_CENTER, _("Sum of Ranks"));
-
- ds_destroy (&g1str);
- ds_destroy (&g2str);
-
- for (i = 0 ; i < nst->n_vars ; ++i)
+ struct pivot_table *table = pivot_table_create (N_("Ranks"));
+
+ pivot_dimension_create (table, PIVOT_AXIS_COLUMN, N_("Statistics"),
+ N_("N"), PIVOT_RC_COUNT,
+ N_("Mean Rank"), PIVOT_RC_OTHER,
+ N_("Sum of Ranks"), PIVOT_RC_OTHER);
+
+ struct pivot_dimension *indep = pivot_dimension_create__ (
+ table, PIVOT_AXIS_ROW, pivot_value_new_variable (nst->indep_var));
+ pivot_category_create_leaf (indep->root,
+ pivot_value_new_var_value (nst->indep_var,
+ &nst->val1));
+ pivot_category_create_leaf (indep->root,
+ pivot_value_new_var_value (nst->indep_var,
+ &nst->val2));
+ pivot_category_create_leaves (indep->root, N_("Total"));
+
+ struct pivot_dimension *dep = pivot_dimension_create (
+ table, PIVOT_AXIS_ROW, N_("Dependent Variables"));
+
+ for (size_t i = 0 ; i < nst->n_vars ; ++i)