Implemented Effects (also called Contrast) coding instead of Dummy Coding
and corrected logic error.
-#define EFFECTS_CODING 0
+#define EFFECTS_CODING 1
const struct interact_params *iap = &cat->iap[i];
const struct interact_params *iap = &cat->iap[i];
for (v = 0; v < iact->n_vars; ++v)
{
const struct variable *var = iact->vars[v];
for (v = 0; v < iact->n_vars; ++v)
{
const struct variable *var = iact->vars[v];
+ const double df = iap->df_prod[v] / dfp;
+
/* Translate the subscript into an index for the individual variable */
/* Translate the subscript into an index for the individual variable */
- int index = (subscript - base_index) % iap->df_prod[v];
- if ( v > 0)
- index /= iap->df_prod[v - 1];
+ const int index = ((subscript - base_index) % iap->df_prod[v] ) / dfp;
+ dfp = iap->df_prod [v];
+ if ( valn->index == df )