Agriculture Reference
In-Depth Information
plantcount, seedstems, and doubles) along with the fieldyield variable
from the second dataset. Stata recognized the rep and entry variables
in both datasets, thus, the merge was done across these variables and
they only appear once in the new file. In addition, there is another
variable called _merge, which in this case is a list of 3s. In a merge,
Stata will create this new variable and it will indicate where the spe-
cific observation came from. For example, if an observation is only in
the master file, a 1 will appear in this column. If the observation is
only from the using file, a 2 will appear, and if from both, a 3. In some
cases, the observations won't be exactly a one-to-one match and this
variable will tell you this. In addition, if it should be an exact match
as in this case, it is an easy way to see if something went wrong in the
merge.
Finally and probably the easiest way to enter data into Stata is
to Copy and Paste into the Data Editor. Almost all of my data are
entered in Microsoft Excel simply because an assistant handles this
and Microsoft Office is ubiquitous on the computers in the office. It
would be a bit impractical and expensive to buy Stata for that computer.
A neat little feature of Stata is that when you copy data from a
program like Excel, go ahead and copy the column labels (treatment,
replication, etc.) and when you select the first cell in Stata's Data
Editor and paste, it will ask if the first row is for variable labels. It will
even make adjustments to the names if there are any conflicts (Stata
requires that all variable labels should have unique values).
There are several other methods of importing data into Stata and
I will leave it to you to explore them if necessary. In addition, the
import examples shown here can be even more flexible with their
capabilities especially when using a data dictionary.
Manipulating Data and Formats
Stata can be useful even before you begin an experiment by generating
random number tables that are organized for your specific experi-
ment. For example, if you have an experiment that is going to be a
randomized complete block design (RCBD) with 12 treatments and
4 replications, you would want treatments 1-12 randomized within
each of 4 blocks (replications). The generated randomization then can
be taken to the field, greenhouse, etc. to install the experiment.
Search WWH ::




Custom Search