I am able to create random correlated standard normal draws using PROC IML and feeding it a correlation matrix and a vector of means=0 (see the code below)
*Create Lower Triangular Correlation Matrix;
DATA Have_Matrix;
INPUT C1 C2 C3 C4;
DATALINES;
1 .7 .2 0
.7 1 .4 .5
.2 .4 1 .3
0 .5 .3 1
;RUN;
*Create a vector of Means=0;
DATA Have_Means (Drop=i);
DO i = 1 TO 4;
Mean = 0;
OUTPUT;
END;
RUN;
*Create the Correlated Random Draws;
PROC IML;
USE Have_Matrix;
READ ALL VAR _NUM_ INTO CovMatrix; *Symmetric Covariance Matrix;
USE Have_Means;
READ all VAR _NUM_ INTO Mean;
N = 1000; *sample size;
X = RandNormal(N, Mean, CovMatrix); *1,000 x 4 Correlated Std Normal Draws;
CREATE Want FROM X; APPEND FROM X; CLOSE Want;
QUIT;
How do I do this using a Student's T distribution? (I believe the above code defaults to Gaussian? I could be wrong about that so please correct me if I am misinterpreting)
Use the RANDMVT function to generate random observations from a multivariate t distribution.
I remembered there is a RAND function to get it .
Better post it at IML forum . @Rick_SAS is there.
Use the RANDMVT function to generate random observations from a multivariate t distribution.
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.