Language Reference |
creates a design matrix
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 , 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
Copyright © 2009 by SAS Institute Inc., Cary, NC, USA. All rights reserved.