Agriculture Reference
In-Depth Information
command collapses the dataset adding all the weights with the same
entry number.
To do this from the command window, enter
collapse (sum) weightlbs , by( entry )
he (sum) indicates that the command should add the weights
weightlbs by the entries entry. If you look at the Help screen for this
command in the Viewer window, you will see that a dataset can be
collapsed by the mean, which is the default if nothing is specified in
the command, but you also have several other alternatives, such as
median, standard deviation, etc. If the collapsed dataset isn't correct
or you made a mistake, use the restore command to restore the
original dataset. It gives you a great deal of versatility in handling a
dataset.
Once the file is collapsed, you will need to create variables to rep-
resent the different parameters in the model. If you have the collapsed
file open from the previous paragraph, the next step is to identify the
treatments (varieties in this case) and the replications for an RCBD.
If not, open the file onionyield2002collapsed.dta, which is the col-
lapsed file from the previous paragraph. Most field experiments that
set up are RCBD, which is probably the most common field design
in agriculture (we will talk about them later). I will code such experi-
ments with a three digit number where the first digit is the replication
number and the next two are the treatment number. For example,
with the plot number 403, the 4 represents the replication and the 03
the treatment.
To create a variable with the variety number, select the following menu:
Data > Create or change data > Create new variable
When the dialog appears, enter variety in the Variable name:
field and, in the Specify a value or an expression, enter mod
( entry,100 ) . hen press OK.
In our case, entering mod ( entry,100 ) calculates the modulus of
entry divided by 100. The modulus is the remainder from division, so,
for example, dividing 403 by 100 has a remainder of 3. The modulus
is the remainder.
Search WWH ::




Custom Search