Agriculture Reference
In-Depth Information
Figure 2.7
The dialog box for importing from a text file with a dictionary.
dataset filename, called Variety 2001 .raw. The dictionary file is used
by Stata to interpret how the data file should be loaded.
This import method can be entered in the Command area of the
Main window with either of these commands:
infile using “ /Users/georgeboyhan/Documents/Books/
Stata Book Files/Data Files/Infiledict.dct”,
using (“ /Users/georgeboyhan/Documents/Books/Stata Book
Files/Data Files/Variety 2001.raw ”)
infile using Infiledict.dct , using (“ Variety 2001.raw ”)
The first instance of the command is what is echoed to the Results
area of the Main window when the command is entered from the
dialog window (Figure 2.7). The second instance is what I typed after
changing the working directory to where the files are stored. You can
see how the pathname is no longer needed. This can make things
easier if you are using the Command area of the Main window.
The next command to look at for importing data is infix , which
is used to import fixed formatted data. That is data that have a fixed
width for each data point. Look at the data in Table  2.2; although
it doesn't look like it, it is in a fixed format that Stata can easily
import. The table fragment is from page 77 of Statistical Procedures
for Agricultural Research (Gomez and Gomez, 1984) and was nicely
formatted; however, upon scanning into a computer the formatting
was lost. The first column, which consists of the numbers 1-8, are the
Search WWH ::




Custom Search