Questions tagged [sas-iml]

SAS/IML is the matrix programming language component to SAS (similar to R).

SAS/IML is the matrix language component of SAS software. It interfaces with the base SAS programming environment, allowing you to smoothly transition from matrix operations to dataset operations, and to use SAS' full suite of statistical tools while enjoying the power of a fully featured matrix language.

SAS/IML also allows an interface into R, to allow users to take advantage of the power of SAS while maintaining the flexibility of using R packages as well.

For more information see http://www.sas.com/technologies/analytics/statistics/iml/index.html

98 questions
1
vote
2 answers

SAS matrix product with missing elements in IML

Is it right that in SAS IML, it is not possible to multiply to get product of two matrices if they contain missing value ?? There is no solution for this problem in SAS ???
Math
  • 1,274
  • 3
  • 14
  • 32
1
vote
2 answers

How to select the 5 minimum values with SAS Proc IML?

I would like to know if it's possible to select the 5 minimum or maximum values by rows with IML ? This is my code : Proc iml ; use table; read all var {&varlist} into matrix ; n=nrow(matrix) ; /* n=369 here*/ p=ncol(matrix); /* p=38…
chocolat
  • 33
  • 4
1
vote
2 answers

SAS PROC iml can not declare

I'm pretty new in proc iml. sooo......I can not declare and create a variable.In the coding line, declare showing in red. If I run it, it is like ' Statement is not valid or it is used out of proper order' Thank you for your help proc…
1
vote
1 answer

How to vectorise in SAS/IML?

Suppose I have proc iml; x = {1,2,3}; I am interested in computing CDF ('F',1,2, ....) for every element of x. Of course, I can write a loop, but I would like to know the smart way of doing it, i.e. vectorise? I tried to google but could not…
Lost1
  • 990
  • 1
  • 14
  • 34
1
vote
2 answers

code re-use in proc IML: accessing contents of vectors by specifying their name as a string

Within proc IML of the SAS system from within a user-defined module I want to be able to access the data in a vector by taking as an argument the name of the vector. For example in the code below the module called "test" builds the two strings…
dandar
  • 175
  • 1
  • 9
1
vote
1 answer

Populate the matrix proc iml SAS

I have a x matrix with two columns(c1,c2). I want to fix the first column (c1), add 10 columns each have values C2+m, C2+m...C2+m to the X matrix, m is a random integer. finally the matrix going to be: C1, C2+m, C2+m, C2+m...C2+m; CODE: proc…
DIY-DS
  • 243
  • 4
  • 16
1
vote
2 answers

SAS/IML: how to use individual variance components in RANDNORMAL

This is a programming question, but I'll give you a little of the stats background first. This question refers to part of a data sim for a mixed-effects location scale model (i.e., heterogeneous variances). I'm trying to simulate two MVN variance…
Ryan W.
  • 21
  • 4
1
vote
2 answers

Do loop and If statement in Proc IML

I have table1 that contains one column (city), I have a second table (table2) that has two columns (city, distance), I am trying to create a third table, table 3, this table contains two columns (city, distance), the city in table 3 will come from…
bison2178
  • 747
  • 1
  • 8
  • 22
1
vote
1 answer

sum of square errors in proc iml

I'm trying to create a code to run Newton Raphson optimization. I'm using proc iml, but when I need to evaluate the error (e) I need to sum up all the square differences and don't know how to tell SAS that in that case I need the sum of the…
GabyLP
  • 3,649
  • 7
  • 45
  • 66
1
vote
1 answer

Print subset of matrix

I'm trying to create a code to run a simple perceptron in SAS base. I'd like to print in each iteration (or store in a table) the result and the target, but I get an error when I try to print y[i,]: proc iml; use percept; read all var{x1 X2} into…
GabyLP
  • 3,649
  • 7
  • 45
  • 66
1
vote
1 answer

error with the "submit" statement in SAS

I need to submit R statements in SAS. To do that, the SAS documentation recommand to enable the RLANG option (which I did) and then use the submit statement as follows : submit / R; (more details are available here, I use the exact example…
Vincent
  • 955
  • 2
  • 15
  • 32
1
vote
2 answers

Invocation of unresolved module EXPORTMATRIXTOR (in SAS PROC IML)

I copy pasted the code from this page on calling R in SAS IML I got the errors below. I don't know why ExportmatrixtoR and Submit are giving me problems. Help? 6 proc iml; NOTE: IML Ready 7 q = {3.7, 7.1, 2, 4.2, 5.3, 6.4,…
user1705135
  • 356
  • 2
  • 4
1
vote
2 answers

Generating filename from the variable from inside the loop in SAS PROC IML

I am trying to breakdown data file into small files, with one of the variables as a part of the name for those files. To be specific, I have a bunch of Census tracts, plus other variables. I am reading them into the matrix, perform some operations…
HerrDoktor
  • 13
  • 3
1
vote
2 answers

Do-loop in SAS-IML

I want to use a macro do loop inside proc iml like so: %Let Tab1=FirstTable; %Let Tab2=SecondTable; %Let Tab3=ThirdTable; *&Tab1-3 have been initialised as sas datasets; proc iml; * This works; use &Tab1; read all into Mat3; print Mat3; *…
Pane
  • 555
  • 2
  • 7
  • 20
0
votes
1 answer

SAS Proc IML Simulate from empirical data with limits

This might sound bonkers, but looking to see if there are any ideas on how to do this. I have N categories (say 7) where a set number of people (say 1000) have to be allocated. I know from historical data the minimum and maximum for each category…
MrAnalyst
  • 23
  • 6