projects
/
pspp-builds.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
fcd8d5f
)
call residual function instead of predict to get residual
author
Jason Stover
<jhs@math.gcsu.edu>
Sun, 9 Apr 2006 19:46:29 +0000
(19:46 +0000)
committer
Jason Stover
<jhs@math.gcsu.edu>
Sun, 9 Apr 2006 19:46:29 +0000
(19:46 +0000)
src/language/stats/regression.q
patch
|
blob
|
history
diff --git
a/src/language/stats/regression.q
b/src/language/stats/regression.q
index 3037f72cdd0714b71a83c9cc44a78330db45c765..d5536e80b58ce78d650f48ee0598a007fae0f498 100644
(file)
--- a/
src/language/stats/regression.q
+++ b/
src/language/stats/regression.q
@@
-507,11
+507,13
@@
subcommand_save (int save, pspp_linreg_cache *lc, const struct casefile *cf, int
int i;
int case_num;
double residual;
int i;
int case_num;
double residual;
- const union value **vals;
+ const union value **vals = NULL;
+ const union value *obs = NULL;
struct casereader *r;
struct ccase c;
assert (lc != NULL);
struct casereader *r;
struct ccase c;
assert (lc != NULL);
+ assert (lc->depvar != NULL);
assert (is_missing != NULL);
if (save)
assert (is_missing != NULL);
if (save)
@@
-526,9
+528,13
@@
subcommand_save (int save, pspp_linreg_cache *lc, const struct casefile *cf, int
for (i = 0; i < n_variables; ++i)
{
vals[i] = case_data (&c, v_variables[i]->fv);
for (i = 0; i < n_variables; ++i)
{
vals[i] = case_data (&c, v_variables[i]->fv);
+ if (v_variables[i]->index == lc->depvar->index)
+ {
+ obs = vals[i];
+ }
}
}
- residual = (*lc->
predict
) ((const struct variable **) v_variables,
-
(const union value **) val
s, lc, n_variables);
+ residual = (*lc->
residual
) ((const struct variable **) v_variables,
+
(const union value **) vals, ob
s, lc, n_variables);
}
}
free (vals);
}
}
free (vals);