Agriculture Reference
In-Depth Information
extension. If you entered the specifications correctly, you should have
a file with eight observations and five variables.
To use this command from the Command area of the Main win-
dow, type in
infix var 1 rep1 2-6 rep2 7-11 rep3 12-16 total 17-22
using riceyield.txt
You may have noticed that I didn't type nearly as much as was
echoed to the Results window when using the dialog window. This is
because I changed the working directory to where the data files are
stored so the pathname does not have to be typed.
There are occasions when not all of the data for an experiment are
in the same file. For example, yield data may have been collected at
different times or even over several years and each time the data were
collected they were entered into a different file. Stata has commands
that make merging data relatively easy.
There are three files available online * we will use to illustrate one
method of merging data. The data are from a watermelon variety trial
that was harvested on three separate days, thus the three files. The files
contain a variable called entry , which denotes the plot number and five
columns of variables, which are the weights of individual fruit. What
we want to do is append two files onto the end of the third. Stata uses
the term master to describe the file in memory and the files that will
be appended to the master as the using datasets .
Open the dataset labeled water71503.dta; this will be the master
dataset. To this dataset we will append the using datasets of water71603.
dta and water72103.dta. To do this, under the Data menu, select
Combine datasets > Append datasets
This will bring up the append—Append datasets dialog window
(Figure 2.9). Use the Browse… button as before and find the second
file water71603.dta. Then select the Select an additional file button,
which then allows you to select an additional file, water72103.dta.
Leave the other options as they are and click the OK button. This will
merge the using datasets water71603.dta and water72103.dta with the
* Files available online at http://www.crcpress.com/products/isbn/9781466585850.
Search WWH ::




Custom Search