Download presentation
Presentation is loading. Please wait.
1
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
2
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.
3
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 /
4
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.
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.