Merge commit 'origin/covariance'
[pspp-builds.git] / src / language / stats / regression.q
index c27d8a40a7e1eb0314d5d8c088d86ec5988d88c1..c7e8179a579086620064f53e0bd6bb5eace213ce 100644 (file)
@@ -24,7 +24,6 @@
 #include <data/case.h>
 #include <data/casegrouper.h>
 #include <data/casereader.h>
-#include <data/category.h>
 #include <data/dictionary.h>
 #include <data/missing-values.h>
 #include <data/procedure.h>
@@ -41,7 +40,7 @@
 #include <math/covariance.h>
 #include <math/linreg.h>
 #include <math/moments.h>
-#include <output/table.h>
+#include <output/tab.h>
 
 #include "xalloc.h"
 
@@ -147,8 +146,7 @@ reg_stats_r (linreg *c, void *aux UNUSED)
   rsq = linreg_ssreg (c) / linreg_sst (c);
   adjrsq = 1.0 - (1.0 - rsq) * (linreg_n_obs (c) - 1.0) / (linreg_n_obs (c) - linreg_n_coeffs (c));
   std_error = sqrt (linreg_mse (c));
-  t = tab_create (n_cols, n_rows, 0);
-  tab_dim (t, tab_natural_dimensions, NULL);
+  t = tab_create (n_cols, n_rows);
   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);
@@ -184,14 +182,13 @@ reg_stats_coeff (linreg * c, void *aux_)
 
   const struct variable *v;
   struct tab_table *t;
+  gsl_matrix *cov = aux_;
 
   assert (c != NULL);
-  gsl_matrix *cov = (gsl_matrix *) aux_;
   n_rows = linreg_n_coeffs (c) + 3;
 
-  t = tab_create (n_cols, n_rows, 0);
+  t = tab_create (n_cols, n_rows);
   tab_headers (t, 2, 0, 1, 0);
-  tab_dim (t, tab_natural_dimensions, NULL);
   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);
@@ -274,9 +271,8 @@ reg_stats_anova (linreg * c, void *aux UNUSED)
   struct tab_table *t;
 
   assert (c != NULL);
-  t = tab_create (n_cols, n_rows, 0);
+  t = tab_create (n_cols, n_rows);
   tab_headers (t, 2, 0, 1, 0);
-  tab_dim (t, tab_natural_dimensions, NULL);
 
   tab_box (t, TAL_2, TAL_2, -1, TAL_1, 0, 0, n_cols - 1, n_rows - 1);
 
@@ -365,9 +361,8 @@ reg_stats_bcov (linreg * c, void *aux UNUSED)
   assert (c != NULL);
   n_cols = c->n_indeps + 1 + 2;
   n_rows = 2 * (c->n_indeps + 1);
-  t = tab_create (n_cols, n_rows, 0);
+  t = tab_create (n_cols, n_rows);
   tab_headers (t, 2, 0, 1, 0);
-  tab_dim (t, tab_natural_dimensions, NULL);
   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);