- vars[i] = cov->vars[i];
- }
- for (i = cov->n_vars; i < cov->dim; i++)
- {
- vars[i] = categoricals_get_variable_by_subscript (cov->categoricals, i - cov->n_vars);
+ const struct interaction *iact =
+ categoricals_get_interaction_by_subscript (cov->categoricals, i);
+
+ struct string str = DS_EMPTY_INITIALIZER;
+ interaction_to_string (iact, &str);
+ struct pivot_category *group = pivot_category_create_group__ (
+ factors->root,
+ pivot_value_new_user_text_nocopy (ds_steal_cstr (&str)));
+
+ int df = categoricals_df (cov->categoricals, n);
+ for (int j = 0; j < df; j++)
+ pivot_category_create_leaf_rc (group, pivot_value_new_integer (j),
+ PIVOT_RC_INTEGER);
+
+ i += df;