- size_t j;
- int n_cols = 7;
- int n_rows;
- int this_row;
- double t_stat;
- double pval;
- double std_err;
- double beta;
- const char *label;
-
- const struct variable *v;
- struct tab_table *t;
-
- assert (c != NULL);
- n_rows = linreg_n_coeffs (c) + 3;
-
- t = tab_create (n_cols, n_rows);
- tab_headers (t, 2, 0, 1, 0);
- tab_box (t, TAL_2, TAL_2, -1, TAL_1, 0, 0, n_cols - 1, n_rows - 1);
- tab_hline (t, TAL_2, 0, n_cols - 1, 1);
- tab_vline (t, TAL_2, 2, 0, n_rows - 1);
- tab_vline (t, TAL_0, 1, 0, 0);
-
- tab_text (t, 2, 0, TAB_CENTER | TAT_TITLE, _("B"));
- tab_text (t, 3, 0, TAB_CENTER | TAT_TITLE, _("Std. Error"));
- tab_text (t, 4, 0, TAB_CENTER | TAT_TITLE, _("Beta"));
- tab_text (t, 5, 0, TAB_CENTER | TAT_TITLE, _("t"));
- tab_text (t, 6, 0, TAB_CENTER | TAT_TITLE, _("Significance"));
- tab_text (t, 1, 1, TAB_LEFT | TAT_TITLE, _("(Constant)"));
- tab_double (t, 2, 1, 0, linreg_intercept (c), NULL);
- std_err = sqrt (gsl_matrix_get (linreg_cov (c), 0, 0));
- tab_double (t, 3, 1, 0, std_err, NULL);
- tab_double (t, 4, 1, 0, 0.0, NULL);
- t_stat = linreg_intercept (c) / std_err;
- tab_double (t, 5, 1, 0, t_stat, NULL);
- pval =
- 2 * gsl_cdf_tdist_Q (fabs (t_stat),
- (double) (linreg_n_obs (c) - linreg_n_coeffs (c)));
- tab_double (t, 6, 1, 0, pval, NULL);
- for (j = 0; j < linreg_n_coeffs (c); j++)
+ struct pivot_table *table = pivot_table_create__ (
+ pivot_value_new_text_format (N_("Coefficients (%s)"), var_to_string (var)),
+ "Coefficients");
+
+ struct pivot_dimension *statistics = pivot_dimension_create (
+ table, PIVOT_AXIS_COLUMN, N_("Statistics"));
+ pivot_category_create_group (statistics->root,
+ N_("Unstandardized Coefficients"),
+ N_("B"), N_("Std. Error"));
+ pivot_category_create_group (statistics->root,
+ N_("Standardized Coefficients"), N_("Beta"));
+ pivot_category_create_leaves (statistics->root, N_("t"),
+ N_("Sig."), PIVOT_RC_SIGNIFICANCE);
+ if (cmd->stats & STATS_CI)