- /*
- Now that we know the number of coefficients, allocate space
- and store pointers to the variables that correspond to the
- coefficients.
- */
- lcache->coeff = xnmalloc (X->m->size2 + 1, sizeof (*lcache->coeff));
- for (i = 0; i < X->m->size2; i++)
- {
- j = i + 1; /* The first coeff is the intercept. */
- lcache->coeff[j].v =
- (const struct variable *) design_matrix_col_to_var (X, i);
- assert (lcache->coeff[j].v != NULL);
- }
- /*
- For large data sets, use QR decomposition.
- */
- if (n_data > sqrt (n_indep) && n_data > REG_LARGE_DATA)
- {
- lcache->method = PSPP_LINREG_SVD;
- }
- /*
- Find the least-squares estimates and other statistics.
- */
- pspp_linreg ((const gsl_vector *) Y, X->m, &lopts, lcache);
- subcommand_statistics (cmd.a_statistics, lcache);
- subcommand_export (cmd.sbc_export, lcache);
- gsl_vector_free (Y);
- design_matrix_destroy (X);
- pspp_linreg_cache_free (lcache);
- free (lopts.get_indep_mean_std);