Language Reference

DESIGN Function

creates a design matrix

DESIGN( column-vector)

where column-vector is a numeric column vector or literal.

The DESIGN function creates a design matrix of 0s and 1s from column-vector. Each unique value of the vector generates a column of the design matrix. This column contains ones in elements with corresponding elements in the vector that are the current value; it contains zeros elsewhere. The columns are arranged in the sort order of the original values.

For example, the following statements produce the design matrix a, as shown:

  
    a={1,1,2,2,3,1}; 
    a=design(a);
 

  
              A             6 rows      3 cols    (numeric) 
  
                              1         0         0 
                              1         0         0 
                              0         1         0 
                              0         1         0 
                              0         0         1 
                              1         0         0
 

Previous Page | Next Page | Top of Page