I am looking for a way to delete all observations from a matrix based on conditions. For example, if I produced a simulation but subsequently wanted to delete all resulting rows that are less than 0 or greater than 1, how would I do that in IML?
This is easy to do in a DATA step, so I can do that, but I was curious regarding an IML approach. (It is probably discussed in Dr. Wicklin's text "Statistical Programming with SAS/IML Software," which I have and will examine, but I thought I would post the question here as it may be a more efficient way to find the answer.
Thanks
Brian
proc iml;
A = {0.50 0.50 0.50, -1 0.50 0.50, 2 0.50 0.50|;
B = matrix with rows that contain negative entries or entries greater than 1 removed
run;
The resulting matrix B should consist of {0.50 0.50 0.50} only.