Continue reforming procedure execution. In this phase, get rid of the
[pspp-builds.git] / src / language / stats / t-test.q
index fac23714fe577496155c169b129a4ed216c7f652..7c2352c4cf26dbf88c20b317da38a113f8b4884a 100644 (file)
    02110-1301, USA. */
 
 #include <config.h>
+
 #include <gsl/gsl_cdf.h>
-#include "message.h"
+#include <math.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <math.h>
-#include "alloc.h"
-#include "case.h"
-#include "casefile.h"
-#include "command.h"
-#include "compiler.h"
-#include "dictionary.h"
-#include "message.h"
-#include "group-proc.h"
-#include "hash.h"
-#include "levene.h"
-#include "lexer.h"
-#include "magic.h"
-#include "misc.h"
+
+#include <data/case.h>
+#include <data/casefile.h>
+#include <data/dictionary.h>
+#include <data/procedure.h>
+#include <data/value-labels.h>
+#include <data/variable.h>
+#include <language/command.h>
+#include <language/dictionary/split-file.h>
+#include <language/lexer/lexer.h>
+#include <libpspp/alloc.h>
+#include <libpspp/compiler.h>
+#include <libpspp/hash.h>
+#include <libpspp/magic.h>
+#include <libpspp/message.h>
+#include <libpspp/message.h>
+#include <libpspp/misc.h>
+#include <libpspp/str.h>
+#include <math/group-proc.h>
+#include <math/levene.h>
+#include <output/manager.h>
+#include <output/table.h>
+
 #include "size_max.h"
-#include "manager.h"
-#include "str.h"
-#include "table.h"
-#include "value-labels.h"
-#include "variable.h"
-#include "procedure.h"
 
 #include "gettext.h"
 #define _(msgid) gettext (msgid)
@@ -230,7 +234,8 @@ static int  group_calc (const struct ccase *, struct cmd_t_test *);
 static void group_postcalc (struct cmd_t_test *);
 
 
-static bool calculate(const struct casefile *cf, void *_mode);
+static bool calculate(const struct ccase *first,
+                      const struct casefile *cf, void *_mode);
 
 static  int mode;
 
@@ -677,7 +682,7 @@ ssbox_one_sample_init(struct ssbox *this,
   this->populate = ssbox_one_sample_populate;
 
   ssbox_base_init(this, hsize,vsize);
-  tab_title (this->t, 0, _("One-Sample Statistics"));
+  tab_title (this->t, _("One-Sample Statistics"));
   tab_vline(this->t, TAL_2, 1,0,vsize - 1);
   tab_text (this->t, 1, 0, TAB_CENTER | TAT_TITLE, _("N"));
   tab_text (this->t, 2, 0, TAB_CENTER | TAT_TITLE, _("Mean"));
@@ -699,8 +704,8 @@ ssbox_independent_samples_init(struct ssbox *this,
   this->populate = ssbox_independent_samples_populate;
 
   ssbox_base_init(this, hsize,vsize);
-  tab_title (this->t, 0, _("Group Statistics"));
-  tab_vline(this->t,0,1,0,vsize - 1);
+  tab_vline (this->t, TAL_GAP, 1, 0,vsize - 1);
+  tab_title (this->t, _("Group Statistics"));
   tab_text (this->t, 1, 0, TAB_CENTER | TAT_TITLE, indep_var->name);
   tab_text (this->t, 2, 0, TAB_CENTER | TAT_TITLE, _("N"));
   tab_text (this->t, 3, 0, TAB_CENTER | TAT_TITLE, _("Mean"));
@@ -823,8 +828,8 @@ ssbox_paired_init(struct ssbox *this, struct cmd_t_test *cmd UNUSED)
   this->populate = ssbox_paired_populate;
 
   ssbox_base_init(this, hsize,vsize);
-  tab_title (this->t, 0, _("Paired Sample Statistics"));
-  tab_vline(this->t,TAL_0,1,0,vsize-1);
+  tab_title (this->t, _("Paired Sample Statistics"));
+  tab_vline(this->t,TAL_GAP,1,0,vsize-1);
   tab_vline(this->t,TAL_2,2,0,vsize-1);
   tab_text (this->t, 2, 0, TAB_CENTER | TAT_TITLE, _("Mean"));
   tab_text (this->t, 3, 0, TAB_CENTER | TAT_TITLE, _("N"));
@@ -962,7 +967,7 @@ trbox_independent_samples_init(struct trbox *self,
   self->populate = trbox_independent_samples_populate;
 
   trbox_base_init(self,cmd->n_variables*2,hsize);
-  tab_title(self->t,0,_("Independent Samples Test"));
+  tab_title(self->t,_("Independent Samples Test"));
   tab_hline(self->t,TAL_1,2,hsize-1,1);
   tab_vline(self->t,TAL_2,2,0,vsize-1);
   tab_vline(self->t,TAL_1,4,0,vsize-1);
@@ -1150,14 +1155,14 @@ trbox_paired_init(struct trbox *self,
   self->populate = trbox_paired_populate;
 
   trbox_base_init(self,n_pairs,hsize);
-  tab_title (self->t, 0, _("Paired Samples Test"));
+  tab_title (self->t, _("Paired Samples Test"));
   tab_hline(self->t,TAL_1,2,6,1);
   tab_vline(self->t,TAL_2,2,0,vsize - 1);
   tab_joint_text(self->t,2,0,6,0,TAB_CENTER,_("Paired Differences"));
   tab_box(self->t,-1,-1,-1,TAL_1, 2,1,6,vsize-1);
   tab_box(self->t,-1,-1,-1,TAL_1, 6,0,hsize-1,vsize-1);
   tab_hline(self->t,TAL_1,5,6, 2);
-  tab_vline(self->t,TAL_0,6,0,1);
+  tab_vline(self->t,TAL_GAP,6,0,1);
 
   tab_joint_text(self->t, 5, 1, 6, 1, TAB_CENTER | TAT_PRINTF, 
                 _("%g%% Confidence Interval of the Difference"),
@@ -1244,7 +1249,7 @@ trbox_one_sample_init(struct trbox *self, struct cmd_t_test *cmd )
   self->populate = trbox_one_sample_populate;
 
   trbox_base_init(self, cmd->n_variables,hsize);
-  tab_title (self->t, 0, _("One-Sample Test"));
+  tab_title (self->t, _("One-Sample Test"));
   tab_hline(self->t, TAL_1, 1, hsize - 1, 1);
   tab_vline(self->t, TAL_2, 1, 0, vsize - 1);
 
@@ -1258,7 +1263,7 @@ trbox_one_sample_init(struct trbox *self, struct cmd_t_test *cmd )
                 _("%g%% Confidence Interval of the Difference"),
                 cmd->criteria*100.0);
 
-  tab_vline(self->t,TAL_0,6,1,1);
+  tab_vline(self->t,TAL_GAP,6,1,1);
   tab_hline(self->t,TAL_1,5,6,2);
   tab_text (self->t, 1, 2, TAB_CENTER | TAT_TITLE, _("t"));
   tab_text (self->t, 2, 2, TAB_CENTER | TAT_TITLE, _("df"));
@@ -1359,7 +1364,7 @@ pscbox(void)
   tab_hline(table, TAL_2, 0, cols - 1, 1);
   tab_vline(table, TAL_2, 2, 0, rows - 1);
   tab_dim(table, tab_natural_dimensions);
-  tab_title(table, 0, _("Paired Samples Correlations"));
+  tab_title(table, _("Paired Samples Correlations"));
 
   /* column headings */
   tab_text(table, 2,0, TAB_CENTER | TAT_TITLE, _("N"));
@@ -1832,7 +1837,7 @@ group_postcalc ( struct cmd_t_test *cmd )
 
 
 static bool
-calculate(const struct casefile *cf, void *cmd_)
+calculate(const struct ccase *first, const struct casefile *cf, void *cmd_)
 {
   struct ssbox stat_summary_box;
   struct trbox test_results_box;
@@ -1842,6 +1847,7 @@ calculate(const struct casefile *cf, void *cmd_)
 
   struct cmd_t_test *cmd = (struct cmd_t_test *) cmd_;
 
+  output_split_file_values (first);
   common_precalc(cmd);
   for(r = casefile_get_reader (cf);
       casereader_read (r, &c) ;