combine-files: Eliminate VAR_NAME_LEN restriction from combine_files().
[pspp-builds.git] / src / language / stats / regression.q
index 8f9979ae73306476c8eec5a6c42105a01a951d7a..b6ee6aaada8cb551f95a436fba119621076b620e 100644 (file)
@@ -1,5 +1,5 @@
 /* PSPP - a program for statistical analysis.
-   Copyright (C) 2005, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2005, 2009, 2010 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -206,7 +206,7 @@ reg_stats_coeff (linreg * c, void *aux_)
   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), 1.0);
+  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++)
     {
@@ -752,10 +752,10 @@ regression_custom_variables (struct lexer *lexer, struct dataset *ds,
 {
   const struct dictionary *dict = dataset_dict (ds);
 
-  lex_match (lexer, '=');
+  lex_match (lexer, T_EQUALS);
 
   if ((lex_token (lexer) != T_ID
-       || dict_lookup_var (dict, lex_tokid (lexer)) == NULL)
+       || dict_lookup_var (dict, lex_tokcstr (lexer)) == NULL)
       && lex_token (lexer) != T_ALL)
     return 2;
 
@@ -810,7 +810,7 @@ fill_covariance (gsl_matrix *cov, struct covariance *all_cov,
   size_t dep_subscript;
   size_t *rows;
   const gsl_matrix *ssizes;
-  const gsl_matrix *cm;
+  gsl_matrix *cm;
   const gsl_matrix *mean_matrix;
   const gsl_matrix *ssize_matrix;
   double result = 0.0;