size_t n_factor_vars;
const struct variable **factor_vars;
- /* In the current implementation, design_vars will
- normally be the same as factor_vars.
- This will change once interactions, nested variables
- and repeated measures become involved.
- */
- size_t n_design_vars;
- const struct variable **design_vars;
-
size_t n_interactions;
struct interaction **interactions;
glm.dict = dataset_dict (ds);
glm.n_dep_vars = 0;
glm.n_factor_vars = 0;
- glm.n_design_vars = 0;
glm.n_interactions = 0;
glm.interactions = NULL;
glm.dep_vars = NULL;
glm.factor_vars = NULL;
- glm.design_vars = NULL;
glm.exclude = MV_ANY;
glm.intercept = true;
glm.wv = dict_get_weight (glm.dict);
interaction_destroy (glm.interactions[i]);
free (glm.interactions);
free (glm.dep_vars);
- free (glm.design_vars);
return CMD_SUCCESS;
free (glm.interactions);
free (glm.dep_vars);
- free (glm.design_vars);
return CMD_FAILURE;
}
vars = xcalloc (covariance_dim (cov), sizeof (*vars));
covariance_get_var_indices (cov, vars);
- for (k = 0; k < cmd->n_design_vars; k++)
+ for (k = 0; k < cmd->n_interactions; k++)
{
n_dropped = 0;
for (i = 1; i < covariance_dim (cov); i++)
{
- if (vars[i] == cmd->design_vars[k])
+ if (vars[i] == cmd->interactions[k]->vars[0])
{
+ assert (n_dropped < covariance_dim (cov));
dropped[n_dropped++] = i;
}
}
if ( lex_match (lexer, T_ASTERISK) || lex_match (lexer, T_BY))
{
- lex_error (lexer, "Interactions are not yet implemented"); return false;
+ // lex_error (lexer, "Interactions are not yet implemented"); return false;
return parse_design_interaction (lexer, glm, iact);
}
- glm->n_design_vars++;
- glm->design_vars = xrealloc (glm->design_vars, sizeof (*glm->design_vars) * glm->n_design_vars);
- glm->design_vars[glm->n_design_vars - 1] = v;
-
return true;
}