[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pspp-cvs] pspp/src/language/stats regression.q ChangeLog
From: |
Jason H Stover |
Subject: |
[Pspp-cvs] pspp/src/language/stats regression.q ChangeLog |
Date: |
Wed, 15 Aug 2007 19:24:17 +0000 |
CVSROOT: /sources/pspp
Module name: pspp
Changes by: Jason H Stover <jstover> 07/08/15 19:24:17
Modified files:
src/language/stats: regression.q ChangeLog
Log message:
fix bug 19819
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/pspp/src/language/stats/regression.q?cvsroot=pspp&r1=1.58&r2=1.59
http://cvs.savannah.gnu.org/viewcvs/pspp/src/language/stats/ChangeLog?cvsroot=pspp&r1=1.61&r2=1.62
Patches:
Index: regression.q
===================================================================
RCS file: /sources/pspp/pspp/src/language/stats/regression.q,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -b -r1.58 -r1.59
--- regression.q 12 Aug 2007 02:38:09 -0000 1.58
+++ regression.q 15 Aug 2007 19:24:16 -0000 1.59
@@ -1021,7 +1021,17 @@
for (i = 0; i < n_variables; i++)
if (!is_depvar (i, depvar))
indep_vars[n_indep_vars++] = v_variables[i];
-
+ if ((n_indep_vars < 2) && is_depvar (0, depvar))
+ {
+ /*
+ There is only one independent variable, and it is the same
+ as the dependent variable. Print a warning and continue.
+ */
+ msg (SE,
+ gettext ("The dependent variable is equal to the independent
variable. The least sequares line is therefore Y=X. Standard errors and related
statistics may be meaningless."));
+ n_indep_vars = 1;
+ indep_vars[0] = v_variables[0];
+ }
return n_indep_vars;
}
@@ -1036,6 +1046,9 @@
struct ccase c;
size_t i;
+ assert (vars != NULL);
+ assert (mom != NULL);
+
for (i = 0; i < n_vars; i++)
if (var_is_alpha (vars[i]))
cat_stored_values_create (vars[i]);
@@ -1163,7 +1176,6 @@
dep_var = cmd->v_dependent[k];
n_indep = identify_indep_vars (indep_vars, dep_var);
-
reader = casereader_clone (input);
reader = casereader_create_filter_missing (reader, indep_vars, n_indep,
MV_ANY, NULL);
Index: ChangeLog
===================================================================
RCS file: /sources/pspp/pspp/src/language/stats/ChangeLog,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -b -r1.61 -r1.62
--- ChangeLog 13 Aug 2007 03:44:46 -0000 1.61
+++ ChangeLog 15 Aug 2007 19:24:17 -0000 1.62
@@ -1,3 +1,8 @@
+2007-08-15 Jason Stover <address@hidden>
+
+ * regression.q (identify_indep_vars): Print an error if dependent
+ and independent variables are the same. Fixes bug 19819.
+
2007-08-12 Ben Pfaff <address@hidden>
* flip.c: Drop use of dict_get_compacted_dict_index_to_case_index
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pspp-cvs] pspp/src/language/stats regression.q ChangeLog,
Jason H Stover <=