- if (!is_depvar (i, depvar))
+ /*
+ The second condition ensures the program will run even if
+ there is only one variable to act as both explanatory and
+ response.
+ */
+ if ((!is_depvar (i, depvar)) || (n_variables == 1))
n_data = prepare_data (n_cases, is_missing_case, indep_vars,
cmd.v_dependent[k],
(const struct casefile *) cf, mom);
n_data = prepare_data (n_cases, is_missing_case, indep_vars,
cmd.v_dependent[k],
(const struct casefile *) cf, mom);
- design_matrix_create (n_indep, (const struct variable **) indep_vars,
+ design_matrix_create (n_indep,
+ (const struct variable **) indep_vars,
models[k]->indep_std = gsl_vector_alloc (X->m->size2);
models[k]->depvar = (const struct variable *) cmd.v_dependent[k];
/*
models[k]->indep_std = gsl_vector_alloc (X->m->size2);
models[k]->depvar = (const struct variable *) cmd.v_dependent[k];
/*
- Independent/dependent variable separation. The
- 'variables' subcommand specifies a varlist which contains
- both dependent and independent variables. The dependent
- variables are specified with the 'dependent'
- subcommand, and maybe also in the 'variables' subcommand.
- We need to separate the two.
- */
+ Independent/dependent variable separation. The
+ 'variables' subcommand specifies a varlist which contains
+ both dependent and independent variables. The dependent
+ variables are specified with the 'dependent'
+ subcommand, and maybe also in the 'variables' subcommand.
+ We need to separate the two.
+ */
if (!is_depvar (i, cmd.v_dependent[k]))
{
if (var_is_alpha (v_variables[i]))
{
design_matrix_set_categorical (X, row,
if (!is_depvar (i, cmd.v_dependent[k]))
{
if (var_is_alpha (v_variables[i]))
{
design_matrix_set_categorical (X, row,
- Now that we know the number of coefficients, allocate space
- and store pointers to the variables that correspond to the
- coefficients.
- */
+ Now that we know the number of coefficients, allocate space
+ and store pointers to the variables that correspond to the
+ coefficients.
+ */
pspp_linreg ((const gsl_vector *) Y, X->m, &lopts, models[k]);
compute_moments (models[k], mom, X, n_variables);
subcommand_statistics (cmd.a_statistics, models[k]);
subcommand_export (cmd.sbc_export, models[k]);
pspp_linreg ((const gsl_vector *) Y, X->m, &lopts, models[k]);
compute_moments (models[k], mom, X, n_variables);
subcommand_statistics (cmd.a_statistics, models[k]);
subcommand_export (cmd.sbc_export, models[k]);