+/* Parser for the variables sub command */
+static int
+regression_custom_variables(struct cmd_regression *cmd UNUSED)
+{
+
+ lex_match('=');
+
+ if ((token != T_ID || dict_lookup_var (default_dict, tokid) == NULL)
+ && token != T_ALL)
+ return 2;
+
+
+ if (!parse_variables (default_dict, &v_variables, &n_variables,
+ PV_NONE ))
+ {
+ free (v_variables);
+ return 0;
+ }
+ assert(n_variables);
+
+ return 1;
+}
+/*
+ Count the explanatory variables. The user may or may
+ not have specified a response variable in the syntax.
+ */
+static
+int get_n_indep (const struct variable *v)
+{
+ int result;
+ int i = 0;
+
+ result = n_variables;
+ while (i < n_variables)
+ {
+ if (is_depvar (i, v))
+ {
+ result--;
+ i = n_variables;
+ }
+ i++;
+ }
+ return result;
+}
+/*
+ Read from the active file. Identify the explanatory variables in
+ v_variables. Encode categorical variables. Drop cases with missing
+ values.
+*/
+static
+int prepare_data (int n_data, int is_missing_case[],
+ struct variable **indep_vars,
+ struct variable *depvar,
+ const struct casefile *cf)
+{
+ int i;
+ int j;
+
+ assert (indep_vars != NULL);
+ j = 0;
+ for (i = 0; i < n_variables; i++)
+ {
+ if (!is_depvar (i, depvar))
+ {
+ indep_vars[j] = v_variables[i];
+ j++;
+ if (v_variables[i]->type == ALPHA)
+ {
+ /* Make a place to hold the binary vectors
+ corresponding to this variable's values. */
+ cat_stored_values_create (v_variables[i]);
+ }
+ n_data = mark_missing_cases (cf, v_variables[i], is_missing_case, n_data);
+ }
+ }
+ /*
+ Mark missing cases for the dependent variable.
+ */
+ n_data = mark_missing_cases (cf, depvar, is_missing_case, n_data);
+
+ return n_data;
+}