From: John Darrington Date: Sat, 23 Oct 2010 09:51:13 +0000 (+0200) Subject: Properly handle weights in Friedman test X-Git-Tag: v0.7.7~187 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=50a07c54d38b3dc85db5c1318d67890e386710f9;p=pspp-builds.git Properly handle weights in Friedman test --- diff --git a/src/language/stats/friedman.c b/src/language/stats/friedman.c index d5890e3f..4a0201e6 100644 --- a/src/language/stats/friedman.c +++ b/src/language/stats/friedman.c @@ -157,7 +157,7 @@ friedman_execute (const struct dataset *ds, if ( run_length > 0) { double t = run_length + 1; - sigma_t += pow3 (t) - t; + sigma_t += w * (pow3 (t) - t); } run_length = 0; } @@ -166,14 +166,13 @@ friedman_execute (const struct dataset *ds, if ( run_length > 0) { double t = run_length + 1; - sigma_t += pow3 (t) - t; + sigma_t += w * (pow3 (t) - t ); } qsort (row, ft->n_vars, sizeof *row, cmp_posn); for (v = 0; v < ft->n_vars; ++v) - fr.rank_sum[v] += row[v].x; - + fr.rank_sum[v] += row[v].x * w; } casereader_destroy (input); free (row);