- int r, c;
- struct tab_table *t;
- int matrix_cols;
- int nr = corr->n_vars1;
- int nc = matrix_cols = corr->n_vars_total > corr->n_vars1 ?
- corr->n_vars_total - corr->n_vars1 : corr->n_vars1;
-
- const struct fmt_spec *wfmt = opts->wv ? var_get_print_format (opts->wv) : & F_8_0;
-
- const int heading_columns = 2;
- const int heading_rows = 1;
-
- int rows_per_variable = opts->missing_type == CORR_LISTWISE ? 2 : 3;
-
- if (opts->statistics & STATS_XPROD)
- rows_per_variable += 2;
-
- /* Two header columns */
- nc += heading_columns;
-
- /* Three data per variable */
- nr *= rows_per_variable;
-
- /* One header row */
- nr += heading_rows;
-
- t = tab_create (nc, nr, 0);
- tab_title (t, _("Correlations"));
- tab_dim (t, tab_natural_dimensions, NULL);
-
- tab_headers (t, heading_columns, 0, heading_rows, 0);
-
- /* Outline the box */
- tab_box (t,
- TAL_2, TAL_2,
- -1, -1,
- 0, 0,
- nc - 1, nr - 1);
-
- /* Vertical lines */
- tab_box (t,
- -1, -1,
- -1, TAL_1,
- heading_columns, 0,
- nc - 1, nr - 1);
-
- tab_vline (t, TAL_2, heading_columns, 0, nr - 1);
- tab_vline (t, TAL_1, 1, heading_rows, nr - 1);
-
- for (r = 0 ; r < corr->n_vars1 ; ++r)
- {
- tab_text (t, 0, 1 + r * rows_per_variable, TAB_LEFT | TAT_TITLE,
- var_to_string (corr->vars[r]));
-
- tab_text (t, 1, 1 + r * rows_per_variable, TAB_LEFT | TAT_TITLE, _("Pearson Correlation"));
- tab_text (t, 1, 2 + r * rows_per_variable, TAB_LEFT | TAT_TITLE,
- (opts->tails == 2) ? _("Sig. (2-tailed)") : _("Sig. (1-tailed)"));