- size_t first_column; /* First column of the gsl_matrix which
- contains recoded values of the categorical
- variable.
- */
- size_t last_column; /* Last column containing the recoded
- categories. The practice of keeping only the
- first and last columns of the matrix implies
- those columns corresponding to v must be
- contiguous.
- */
- size_t n_allocated_categories; /* This is used only during initialization
- to keep track of the number of values
- stored.
- */
-};
-
-/*
- There are usually multiple categorical variables to recode. Get rid
- of this structure immediately when the variable structure has been
- modified to contain the binary encoding.
- */
-struct recoded_categorical_array
-{
- struct recoded_categorical **a;
- size_t n_vars;
-};
-/*
- The design matrix structure holds the design
- matrix and an array to tell us which columns
- correspond to which variables. This structure
- is not restricted to categorical variables, and
- perhaps should be moved to its own module.
-*/
-
-struct design_matrix_var
-{
- int first_column; /* First column for this variable in the
- design_matix. If this variable is categorical,
- its values are stored in multiple, contiguous
- columns, as dictated by its vector encoding
- in the variable's struct recoded_categorical.
- */
- int last_column;
- struct variable *v;
-};
-struct design_matrix
-{
- gsl_matrix *m;
- struct design_matrix_var *vars; /* Element i is the the variable whose
- values are stored in column i of m. If that
- variable is categorical with more than two
- categories, its values are stored in multiple,
- contiguous columns. In this case, element i is
- the first column for that variable. The
- variable's values are then stored in the
- columns first_column through
- last_column. first_column and last_column for
- a categorical variable are stored in the
- variable's recoded_categorical structure.