Language Reference |
returns a Hadamard matrix
The HADAMARD function returns a Hadamard matrix, which is an matrix consisting entirely of the values 1 and - 1. The columns of a Hadamard matrix are all orthogonal. Hadamard matrices are frequently used to make orthogonal array experimental designs for two-level factors. For example, the following IML statements create a Hadamard matrix:
h = hadamard(12); print h[format=2.];
The results are as follows:
H 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 1 1 -1 1 -1 -1 -1 1 1 1 -1 1 1 1 1 -1 1 -1 -1 -1 1 1 1 -1 1 -1 1 1 -1 1 -1 -1 -1 1 1 1 1 1 -1 1 1 -1 1 -1 -1 -1 1 1 1 1 1 -1 1 1 -1 1 -1 -1 -1 1 1 1 1 1 -1 1 1 -1 1 -1 -1 -1 1 -1 1 1 1 -1 1 1 -1 1 -1 -1 1 -1 -1 1 1 1 -1 1 1 -1 1 -1 1 -1 -1 -1 1 1 1 -1 1 1 -1 1 1 1 -1 -1 -1 1 1 1 -1 1 1 -1 1 -1 1 -1 -1 -1 1 1 1 -1 1 1
The first column is an intercept and the next 11 columns form an orthogonal array experimental design for 11 two-level factors in 12 runs, .
To request the 17th row of a Hadamard matrix of order 448, use the following statement:
h = hadamard(448, 17);
Copyright © 2009 by SAS Institute Inc., Cary, NC, USA. All rights reserved.