5
6 proc iml;
NOTE: Writing HTML Body file: sashtml.htm
NOTE: IML Ready
7 /* Comparison of matrix operations in IML and R */
8 print "---------- SAS/IML Results -----------------";
9 x = 1:3;
9 ! /* vector of sequence 1,2,3 */
10 m = {1 2 3, 4 5 6, 7 8 9};
10 ! /* 3 x 3 matrix */
11 q = m * t(x);
11 ! /* matrix multiplication */
12 print q;
13 print "------------- R Results --------------------";
14 submit / R;
15 rx <- matrix( 1:3, nrow=1) # vector of sequence 1,2,3
16 rm <- matrix( 1:9, nrow=3, byrow=TRUE) # 3 x 3 matrix
17 rq <- rm %*% t(rx) # matrix multiplication
18 print(rq)
19 endsubmit;
ERROR: SAS is unable to transcode character data to the R encoding.
ERROR: The final R statement is incomplete.
ERROR: The final R statement is incomplete.
ERROR: The final R statement is incomplete.
ERROR: The final R statement is incomplete.
statement : SUBMIT at line 14 column 1
20
21 quit;