The SIMNORMAL Procedure

Getting Started: SIMNORMAL Procedure

(View the complete code for this example.)

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 106.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 106.1: Statistics for PROC SIMNORM Sample Using NUMREAL=5000

Statistics for PROC SIMNORM Sample Using NUMREAL=5000

The CORR Procedure

2 Variables:S1 S2

Covariance Matrix, DF = 4999
 S1S2
S11.8958054990.424837163
S20.4248371634.132974275

Simple Statistics
VariableNMeanStd DevSumMinimumMaximum
S150001.302541.376886513-3.906826.49864
S250001.987902.032979940-5.698129.42833