Rework moments routines for improved numerical stability based on
[pspp-builds.git] / src / t-test.h
index 8a72fb9ddd0ca7bf77af532dd985a0df9cb0382c..1e860834d6f3e4abc55bc8240533d854fd904dfc 100644 (file)
 #ifndef T_TEST_H
 #define T_TEST_H
 
-/* T-TEST private data */
-struct t_test_proc
+#include "val.h"
+
+
+enum comparison
+  {
+    CMP_LE = -2,
+    CMP_LT = -1,
+    CMP_EQ = 0,
+    CMP_GT = 1,
+    CMP_GE = 2
+  };
+
+/* Statistics for grouped data */
+struct group_statistics
   {
+    /* The value of the independent variable for this group */
+    union value id;
+
+    /* The criterium matching for comparing with id */
+    enum comparison criterion;
+
+    /* The arithmetic mean */
     double mean;
 
     /* Population std. deviation */
@@ -42,11 +61,35 @@ struct t_test_proc
     /* Std Err of Mean */
     double se_mean;
 
-    /* Sum of differnces */
+    /* Sum of differences */
     double sum_diff;
 
     /* Mean of differences */
     double mean_diff ;
+
+    /* Running total of the Levene for this group */
+    double lz_total;
+    
+    /* Group mean of Levene */
+    double lz_mean; 
+
   };
 
+
+/* T-TEST private data */
+struct t_test_proc
+{
+  /* Stats for the `universal group' */
+  struct group_statistics ugs;
+
+  /* Number of groups */
+  int n_groups ;
+
+  /* Stats for individual groups */
+  struct group_statistics *gs;
+
+  /* The levene statistic */
+  double levene ;
+};
+
 #endif