case: Introduce new functions for numbers and substrings in cases.
[pspp] / src / language / stats / friedman.c
index e2b9354678012057553dfb764f04798b7c9f6be3..55e42489f4e3a420790c7184c432b1968d5f17af 100644 (file)
@@ -101,7 +101,7 @@ friedman_execute (const struct dataset *ds,
   bool warn = true;
 
   double sigma_t = 0.0;
-  struct datum *row = xcalloc (ost->n_vars, sizeof *row);
+  struct datum *row = XCALLOC (ost->n_vars,  struct datum);
   double rsq;
   struct friedman fr;
   fr.rank_sum = xcalloc (ost->n_vars, sizeof *fr.rank_sum);
@@ -123,7 +123,7 @@ friedman_execute (const struct dataset *ds,
       double prev_x = SYSMIS;
       int run_length = 0;
 
-      const double w = weight ? case_data (c, weight)->f: 1.0;
+      const double w = weight ? case_num (c, weight) : 1.0;
 
       fr.cc += w;