GLM: Update logic for choosing types of sums of squares
authorJohn Darrington <john@darrington.wattle.id.au>
Wed, 23 Nov 2011 13:23:17 +0000 (14:23 +0100)
committerJohn Darrington <john@darrington.wattle.id.au>
Wed, 23 Nov 2011 18:49:02 +0000 (19:49 +0100)
src/language/stats/glm.c
tests/language/stats/glm.at

index 4b1b1a8bf3f7e233e44db8519e07da484963c23a..28f61bc68bc7dd21e6f931aea8bf631d069eb1d7 100644 (file)
@@ -33,6 +33,7 @@
 #include "language/lexer/lexer.h"
 #include "language/lexer/value-parser.h"
 #include "language/lexer/variable-parser.h"
+#include "libpspp/assertion.h"
 #include "libpspp/ll.h"
 #include "libpspp/message.h"
 #include "libpspp/misc.h"
@@ -537,7 +538,18 @@ run_glm (struct glm_spec *cmd, struct casereader *input,
     */
     ws.ssq = gsl_vector_alloc (cm->size1);
     gsl_vector_set (ws.ssq, 0, gsl_matrix_get (cm, 0, 0));
-    get_ssq (cov, ws.ssq, cmd);
+    switch (cmd->ss_type)
+      {
+      case 1:
+       break;
+      case 2:
+      case 3:
+       get_ssq (cov, ws.ssq, cmd);
+       break;
+      default:
+       NOT_REACHED ();
+       break;
+      }
     //    dump_matrix (cm);
 
     gsl_matrix_free (cm);
index 8209bc7298ad2e24f985bfad3a6d3246f9d7c00b..394f4a2dfb14f71c419ce04e3713b5394ff24682 100644 (file)
@@ -49,7 +49,6 @@ end data.
 variable labels a 'Factor A' b 'Factor B' c 'Factor C' y 'Criterion'.
 
 glm y by   b a c
-  /method=sstype(3)
   /intercept=include
   /criteria=alpha(.05)
   /design = a b c
@@ -103,7 +102,6 @@ begin data.
 end data.
 
 glm points by Factor0 Factor1
-  /method=sstype(3)
   /intercept=include
   /criteria=alpha(.05)
   .