+ for (int r = 0; r < corr->n_vars1; r++)
+ for (int c = 0; c < matrix_cols; c++)
+ {
+ const int col_index = (corr->n_vars_total > corr->n_vars1
+ ? corr->n_vars1 + c
+ : c);
+ double pearson = gsl_matrix_get (cm, r, col_index);
+ double w = gsl_matrix_get (samples, r, col_index);
+ double sig = opts->tails * significance_of_correlation (pearson, w);
+
+ double entries[5];
+ int n = 0;
+ entries[n++] = pearson;
+ entries[n++] = col_index != r ? sig : SYSMIS;
+ if (opts->statistics & STATS_XPROD)
+ {
+ double cov = gsl_matrix_get (cv, r, col_index);
+ const double xprod_dev = cov * w;
+ cov *= w / (w - 1.0);
+
+ entries[n++] = xprod_dev;
+ entries[n++] = cov;
+ }
+ if (opts->missing_type != CORR_LISTWISE)
+ entries[n++] = w;
+
+ for (int i = 0; i < n; i++)
+ if (entries[i] != SYSMIS)
+ {
+ struct pivot_value *v = pivot_value_new_number (entries[i]);
+ if (!i && opts->sig && col_index != r && sig < 0.05)
+ pivot_value_add_footnote (v, sig_footnote);
+ pivot_table_put3 (table, c, i, r, v);
+ }
+ }