Quick Cluster: Avoid crash when presented with missing values
[pspp] / src / language / stats / friedman.c
index 9711167b1d3a0ef8fea3d8600c614f4375873ea5..5ef3083f62f183920c4aaf2409e60ec4471c5dcc 100644 (file)
@@ -1,5 +1,5 @@
 /* PSPP - a program for statistical analysis. -*-c-*-
-   Copyright (C) 2010 Free Software Foundation, Inc.
+   Copyright (C) 2010, 2011 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
 
 #include <config.h>
 
-#include "friedman.h"
+#include "language/stats/friedman.h"
 
 #include <gsl/gsl_cdf.h>
 #include <math.h>
 
-#include <data/format.h>
-
-#include <libpspp/misc.h>
-#include <libpspp/message.h>
-#include <data/procedure.h>
-#include <data/casereader.h>
-#include <data/dictionary.h>
-#include <data/variable.h>
-
+#include "data/casereader.h"
+#include "data/dataset.h"
+#include "data/dictionary.h"
+#include "data/format.h"
+#include "data/variable.h"
+#include "libpspp/message.h"
+#include "libpspp/misc.h"
+#include "output/tab.h"
 
 #include "gettext.h"
 #define _(msgid) gettext (msgid)
@@ -202,6 +201,8 @@ friedman_execute (const struct dataset *ds,
       fr.w /= pow2 (fr.cc) * (pow3 (ost->n_vars) - ost->n_vars)
        - fr.cc * sigma_t;
     }
+  else
+    fr.w = SYSMIS;
 
   show_ranks_box (ost, &fr);
   show_sig_box (ost, &fr);
@@ -211,7 +212,6 @@ friedman_execute (const struct dataset *ds,
 
 \f
 
-#include <output/tab.h>
 
 static void
 show_ranks_box (const struct one_sample_test *ost, const struct friedman *fr)