next up previous contents index
Next: Remarks Up: Constructing data over many Previous: Constructing data for a

Generating vectors of random numbers

An important exception to the rule of scalars acting like scalars within DATAVEC:  commands occurs when we include a random-number generator within the equation E. This is because the two random number generators urand  and nrand  supply different random numbers on each call, so that different values will be generated for the different cases. Consider, for example, the definition in this line of code:

BD>datavec : X(1,100)=urand +1 tex2html_wrap_inline33712

This contructs a data vector X with observations tex2html_wrap_inline36498 which will consist of a sequence of uniformly distributed (0,1) random numbers, plus 1. In contrast, consider the following fragment of code, which takes one random number and duplicates it over a range of cases:

BD>c  %temp=urand  tex2html_wrap_inline33712

BD>datavec: X(1,100)=%temp tex2html_wrap_inline33712



David Wooff
Wed Oct 21 15:14:31 BST 1998