- for (i = 0; i < n_cases; i++)
- {
- is_missing_case[i] = 0;
- }
- n_data = prepare_data (n_cases, is_missing_case, indep_vars,
- cmd.v_dependent[k],
- (const struct casefile *) cf);
- Y = gsl_vector_alloc (n_data);
-
- X =
- design_matrix_create (n_indep, (const struct variable **) indep_vars,
- n_data);
- for (i = 0; i < X->m->size2; i++)
- {
- lopts.get_indep_mean_std[i] = 1;
- }
- models[k] = pspp_linreg_cache_alloc (X->m->size1, X->m->size2);
- models[k]->indep_means = gsl_vector_alloc (X->m->size2);
- models[k]->indep_std = gsl_vector_alloc (X->m->size2);
- models[k]->depvar = (const struct variable *) cmd.v_dependent[k];
- /*
- For large data sets, use QR decomposition.
- */
- if (n_data > sqrt (n_indep) && n_data > REG_LARGE_DATA)
+ for (k = 0; k < cmd->n_dependent; k++)
+ {
+ const struct variable *dep_var;
+ struct casereader *reader;
+ casenumber row;
+ struct ccase c;
+ size_t n_data; /* Number of valid cases. */
+
+ 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);
+ reader = casereader_create_filter_missing (reader, &dep_var, 1,
+ MV_ANY, NULL);
+ n_data = prepare_categories (casereader_clone (reader),
+ indep_vars, n_indep, mom);
+
+ if ((n_data > 0) && (n_indep > 0))