Random Numbers

Introduction

The primary purpose of these transformations is to generate data for the purpose of simulating an analysis. Use !SEED to fix the random generator seed if the same random numbers are required in different runs. !NORMAL and !UNIFORM generate random numbers at the residual level. SETN and SETU generate random numbers at the treatment level.
  • !NORMAL v replaces the variate with normal random variables having variance v . For example,
    Ndat !=0. !Normal 4.5
    creates a new variable ( !=0. ) and fills it with Normal(0,4.5) random values. These two transformations can be collapsed into one: viz.
    Ndat !=Normal 4.5
  • !SEED n sets the seed for the random number generator.
     !SEED 848586
    
  • !SETN v n replaces data values 1:n with normal random variables having variance v . Data values outside the range 1 ... n are set to 0.
      Anorm !=A  !SETN 2.5 10
    
    replaces data values of 1 ... 10 (copied from variable A ) with 10 Normal(0,2.5) random values.
  • !SETU v n replaces data values 1:n with uniform random variables having range 0:v . Data values outside the range 1 ... n are set to 0.
     Aeff !=A  !SETU 5 10
    
    replaces data values of 1, \cdots , 10 (copied from variable A ) with 10 Uniform(0,5) random values.
  • !UNIFORM v replaces the variate with uniform random variables having range 0:v .
      Udat !=0.  !Uniform 4.5 +
    
    creates a new variable and fills it with Uniform(0,4.5) random values. These two transformations can be collapsed into one: viz.
     Udat !=Uniform 4.5
    

    Return to start