Fluorite | Level 6

## Correlated Random Draws - Student's T distribution

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)

1 ACCEPTED SOLUTION

Accepted Solutions
SAS Super FREQ

## Re: Correlated Random Draws - Student's T distribution

Use the RANDMVT function to generate random observations from a multivariate t distribution.

2 REPLIES 2
Super User

## Re: Correlated Random Draws - Student's T distribution

I remembered there is a RAND function to get it .

Better post it at IML forum . @Rick_SAS  is there.

SAS Super FREQ

## Re: Correlated Random Draws - Student's T distribution

Use the RANDMVT function to generate random observations from a multivariate t distribution.

From The DO Loop