- struct tab_table *direct;
-
- direct = tab_create (7 + (pt->n_vars - 2),
- pt->n_entries / pt->n_cols * 7 + 10);
- tab_headers (direct, 3 + (pt->n_vars - 2), 0, 1, 0);
- tab_title (direct, _("Directional measures."));
-
- tab_offset (direct, pt->n_vars - 2, 0);
- tab_text (direct, 0, 0, TAB_LEFT | TAT_TITLE, _("Category"));
- tab_text (direct, 1, 0, TAB_LEFT | TAT_TITLE, _("Statistic"));
- tab_text (direct, 2, 0, TAB_LEFT | TAT_TITLE, _("Type"));
- tab_text (direct, 3, 0, TAB_RIGHT | TAT_TITLE, _("Value"));
- tab_text (direct, 4, 0, TAB_RIGHT | TAT_TITLE, _("Asymp. Std. Error"));
- tab_text (direct, 5, 0, TAB_RIGHT | TAT_TITLE, _("Approx. T"));
- tab_text (direct, 6, 0, TAB_RIGHT | TAT_TITLE, _("Approx. Sig."));
- tab_offset (direct, 0, 1);
+ struct pivot_table *direct = pivot_table_create (N_("Directional Measures"));
+ pivot_table_set_weight_format (direct, &xt->weight_format);
+ direct->omit_empty = true;
+
+ pivot_dimension_create (
+ direct, PIVOT_AXIS_COLUMN, N_("Values"),
+ N_("Value"), PIVOT_RC_OTHER,
+ N_("Asymp. Std. Error"), PIVOT_RC_OTHER,
+ N_("Approx. T"), PIVOT_RC_OTHER,
+ N_("Approx. Sig."), PIVOT_RC_SIGNIFICANCE);
+
+ struct pivot_dimension *statistics = pivot_dimension_create (
+ direct, PIVOT_AXIS_ROW, N_("Statistics"));
+ struct pivot_category *nn = pivot_category_create_group (
+ statistics->root, N_("Nominal by Nominal"));
+ create_direct_stat (nn, xt, N_("Lambda"), true);
+ create_direct_stat (nn, xt, N_("Goodman and Kruskal tau"), false);
+ create_direct_stat (nn, xt, N_("Uncertainty Coefficient"), true);
+ struct pivot_category *oo = pivot_category_create_group (
+ statistics->root, N_("Ordinal by Ordinal"));
+ create_direct_stat (oo, xt, N_("Somers' d"), true);
+ struct pivot_category *ni = pivot_category_create_group (
+ statistics->root, N_("Nominal by Interval"));
+ create_direct_stat (ni, xt, N_("Eta"), false);
+
+ for (size_t i = 2; i < xt->n_vars; i++)
+ add_var_dimension (direct, &xt->vars[i], PIVOT_AXIS_ROW, false);