+2007-08-15 Jason Stover <jhs@wonko.gcsu.edu>
+
+ * regression.q (identify_indep_vars): Print an error if dependent
+ and independent variables are the same. Fixes bug 19819.
+
2007-08-12 Ben Pfaff <blp@gnu.org>
* flip.c: Drop use of dict_get_compacted_dict_index_to_case_index
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;
}
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]);
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);