Language Reference

NORMAL Function

generates a pseudo-random normal deviate

NORMAL( seed)

where seed is a numeric matrix or literal. The seed argument can be any integer value up to 2^{31}-1.

The NORMAL function is a scalar function that returns a pseudo-random number having a normal distribution with a mean of 0 and a standard deviation of 1. The NORMAL function returns a matrix with the same dimensions as the argument. The first argument on the first call is used for the seed (or if that is 0, the system clock is used for the seed). This function is synonymous with the DATA step function RANNOR. The Box-Muller transformation of the UNIFORM function deviates is used to generate the numbers. The following code produces the output vector b, as shown:

  
   seed = 123456; 
   c = j(10,1,seed); 
   b = normal(c); 
   print b; 
  
             B 
  
         -0.109483 
         -0.348785 
         1.1202546 
         -2.513766 
         1.3630022
 

Previous Page | Next Page | Top of Page