From 762f47ec7fcfe1bfd9a404dae6ce285e61b1df57 Mon Sep 17 00:00:00 2001 From: Jason Stover Date: Mon, 10 Apr 2006 00:25:33 +0000 Subject: [PATCH] fixed prediction bug --- src/math/linreg/coefficient.c | 2 +- src/math/linreg/predict.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/math/linreg/coefficient.c b/src/math/linreg/coefficient.c index 5efde99e..2154ffe4 100644 --- a/src/math/linreg/coefficient.c +++ b/src/math/linreg/coefficient.c @@ -209,7 +209,7 @@ pspp_linreg_get_coeff (const pspp_linreg_cache * c, tmp = pspp_linreg_coeff_get_var (result, 0); i++; } - if (i == c->n_coeffs) + if (i > c->n_coeffs) { return NULL; } diff --git a/src/math/linreg/predict.c b/src/math/linreg/predict.c index 0bab23c8..49e24434 100644 --- a/src/math/linreg/predict.c +++ b/src/math/linreg/predict.c @@ -62,7 +62,7 @@ pspp_linreg_predict (const struct variable **predictors, { coe = pspp_linreg_get_coeff (c, predictors[j], vals[j]); i = 1; - while (found[i] != coe && i < c->n_coeffs) + while (found[i] == coe && i < c->n_coeffs) { i++; } -- 2.30.2