Agriculture Reference
In-Depth Information
Data > Create or change data > Create new variable
(extended)
In this dialog, enter a name in the Generate variable: field, for
example trt. From the Egen function: list, select Sequences (integer),
which will change the option portion of the dialog window. In the
Options select the Sequence: button and fill in from 1 to 12 in blocks
of 1. It may seem that the In blocks of: field should have a 4, but 1 is
correct. You may wish to try it both ways just to see how the numbers
are generated. From the Command area of the Main window, type in
egen trt = seq(), from ( 1 ) to( 12 ) block( 1 )
Next, select the same dialog window, enter a new variable, rep, and
enter the sequence from 1 to 4 in blocks of 12. The Command entry is
egen rep = seq(), from ( 1 ) to( 4 ) block( 12 )
Next, you will want to sort your data using the random vari-
able in groups of 12. To do this, select the Ascending sort submenu
(FigureĀ 2.14).
Data > Sort > Ascending sort
Select the random variable in the Variables: field and check the box
for Restrict sort of observations and enter from 1 to 12. This will ran-
domly sort the first 12 treatments in replication 1. Do this three more
Figure 2.14
Sort dialog on a Windows computer.
Search WWH ::




Custom Search