Appendix D: SAS PROC IML Matrix Language with Interface to all SAS capacities and functionality Use it as a calculator Use it to write your own programs Full Documentation at http://support.sas.com/onlinedoc/913/docMainpage.jsp
PROC IML Overview Invoke SAS from your machine, and type in proc iml ; Then click on the Run button. You are now ready to run the SAS matrix language. To input the 4 by 2 matrix X, enter X = { 1 2, 3 4, 5 6, 7 9 } ; Using curly brackets with space to delimit columns and a comma to delimit rows.
PROC IML Operators Transpose ` (key above the ~ on US English keyboards) Addition + Subtraction - Matrix Multiply * Scalar Multiplication * Inverse of matrix INV(matrix) Diagonal of matrix DIAG(matrix) Square Root of elements SQRT(matrix) Elementwise Division /
PROC IML Matrix Subsets Subscript [row(s), col(s) ] Pick off jth col of A A[,j] Sum across columns A[,+] Subset A A[{1 3 2}, {1}] The last example takes rows 1, 3 and 2 and column 1 from A.