BookmarkSubscribeRSS Feed
Huiping
Calcite | Level 5

I am trying to generate a random number from a mixture normal distribution but got an error message that the matrices do not conform to the operation. Here is my code:

proc iml;

call randseed(12345);

p = {0.2 0.5 0.3};  mu = {0 5 10}; sig = {1 1 2};

call randgen(x, 'NORMALMIX',p,mu,sig);

print x;

quit;

1 REPLY 1
Rick_SAS
SAS Super FREQ

The NORMALIMIX family was added in SAS/IML 12.1, which shipped with SAS 9.3m2.

To find your version of SAS, look at the top of the SAS Log when you start SAS, or following the instructions in this article: Determine the version of SAS software at run time - The DO Loop

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.

From The DO Loop
Want more? Visit our blog for more articles like these.
Discussion stats
  • 1 reply
  • 733 views
  • 0 likes
  • 2 in conversation