+ /*
+ 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 squares 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;
+}
+
+/* Encode categorical variables.
+ Returns number of valid cases. */
+static int
+prepare_categories (struct casereader *input,
+ const struct variable **vars, size_t n_vars,
+ struct moments_var *mom)
+{
+ int n_data;
+ 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]);
+
+ n_data = 0;
+ for (; casereader_read (input, &c); case_destroy (&c))
+ {
+ /*
+ The second condition ensures the program will run even if
+ there is only one variable to act as both explanatory and
+ response.
+ */
+ for (i = 0; i < n_vars; i++)