- tab_double (t, 3, heading_rows, 0, std_err, NULL, RC_OTHER);
- tab_double (t, 4, heading_rows, 0, 0.0, NULL, RC_OTHER);
- t_stat = linreg_intercept (c) / std_err;
- tab_double (t, 5, heading_rows, 0, t_stat, NULL, RC_OTHER);
- pval =
- 2 * gsl_cdf_tdist_Q (fabs (t_stat),
- (double) (linreg_n_obs (c) - linreg_n_coeffs (c)));
- tab_double (t, 6, heading_rows, 0, pval, NULL, RC_PVALUE);
-
- for (j = 0; j < linreg_n_coeffs (c); j++)
- {
- struct string tstr;
- ds_init_empty (&tstr);
- this_row = j + heading_rows + 1;
-
- v = linreg_indep_var (c, j);
- label = var_to_string (v);
- /* Do not overwrite the variable's name. */
- ds_put_cstr (&tstr, label);
- tab_text (t, 1, this_row, TAB_LEFT, ds_cstr (&tstr));
- /*
- Regression coefficients.
- */
- tab_double (t, 2, this_row, 0, linreg_coeff (c, j), NULL, RC_OTHER);
- /*
- Standard error of the coefficients.
- */
- std_err = sqrt (gsl_matrix_get (linreg_cov (c), j + 1, j + 1));
- tab_double (t, 3, this_row, 0, std_err, NULL, RC_OTHER);
- /*
- Standardized coefficient, i.e., regression coefficient
- if all variables had unit variance.
- */
- beta = sqrt (gsl_matrix_get (cov, j, j));
- beta *= linreg_coeff (c, j) /
- sqrt (gsl_matrix_get (cov, cov->size1 - 1, cov->size2 - 1));
- tab_double (t, 4, this_row, 0, beta, NULL, RC_OTHER);