The following example illustrates the use of PROC SIMNORMAL to generate two normal random variates that have specified means and covariance.
In this example, the means and covariances are given; these might have come from previous experiments, observational studies, or other considerations.
First you create a _TYPE_=COV data set as the input data set, and then you run PROC SIMNORM with NUMREAL=5000, creating a sample that contains 5,000 observations. The simple statistics of this sample are checked using PROC CORR. The results are shown in Figure 104.1.
data scov(type=COV) ; input _TYPE_ $ 1-4 _NAME_ $ 9-10 S1 S2 ; datalines ; COV S1 1.915 0.3873 COV S2 0.3873 4.321 MEAN 1.305 2.003 run;
proc simnorm data=scov outsim=ssim numreal = 5000 seed = 54321 ; var s1 s2 ; run;
proc corr data=ssim cov ; var s1 s2 ; title "Statistics for PROC SIMNORM Sample Using NUMREAL=5000" ; run;
Figure 104.1: Statistics for PROC SIMNORM Sample Using NUMREAL=5000