You could use the loc function to subset your data matrix. The following is the description of the function, snipped from Indexing matrices in Introduction to SAS/IML. the LOC function is often very useful for subsetting vectors and matrices. This function is used for locating elements which meet a given...

Read the article "Compute the kth smallest data value in SAS" Define the modules as in the article. Then use the following: have = {1 9 8 7 3 4 2 6, 9 3 2 1 4 7 12 -2}; x = have`; /* transpose */ ord = j(5,ncol(x)); do...

According to the IML Documentation on missing values, you are correct: it is not possible to multiply two matrices that contain a missing value (or more) using matrix multiplication (elementwise is fine). This is stated as for efficiency reasons; I'm not sure what that entails, but presumably there are some...

It will be better if you post your code first then ask questions. I think proc transpose is the fastest solution. data _t1; input var1 $ var2 $ var3 5.; cards; A B 1 C D 2 E F 3 A D 4 A F 5 C B 6 C...

The submit statement is a feature of the SAS/IML language, so it must be submitted during a SAS/IML code block. proc iml; submit / R; x <- 5 x endsubmit; quit; Further, you must have the RLANG system option set (which may be controlled by you or your administrator) at...

Rick Wicklin answers this question in a blog post, in which he introduces the distance function, but also tells you how to do it two other ways. PROC DISTANCE (not an IML procedure, but produces a matrix-like dataset you could easily load into IML) Write your own module. You need...

In short, the SVD decomposition is not unique. The singular vectors of M are the eigenvectors of M`M. Eigenvectors are not unique. Even when the matrix is full rank, the eigenvectors are only defined up to a sign: If v is an eigenvector of the matrix A for eigenvalue lambda,...