Agriculture Reference
In-Depth Information
Then change yield in these pasted commands to pungency, sugar, dry-
wts, jumbo, mediums, and doubles. You may wish to have a log file
started before executing these commands, which can be part of this
do-file. In addition, you can include the file name in the do-file so that
the do-file will open the dataset, start a log, complete the analysis, and
close the log. To see the complete do-file, open Large dataset.do. Note
for this to work properly you will have to change your working directory
to where the Large Onion Dataset 2001-02.dta dataset is located. To
change the working directory select the Change Working Directory…
item under the File menu. This also can be accomplished with the cd
command, but will have a slightly different pathname based on the
operating system used (i.e., Macintosh, Windows, or Unix). Then select
the icon Do in the top of the Do-File Editor window. This file will
quickly analyze all the variables and list the treatment means. Also
included in this do-file is the command set more off . This turns off
the more function in the Results window so the results do not pause
for each window of data, but rather runs quickly through all of the
analyses. Because a log file was created, this can be opened from the
Log menu under File. This file will have a .smcl extension.
Stata programs can be much more than just files of commands.
They can be written to act like other ado files, such as official Stata
ado files. This means they can include Help files and GUI elements.
They can be shared with other users or downloaded and installed on
your computer. They can be written just for the specific problem at
hand or they can be written to be reused for similar problems. They
can be complex or simple.
If you are familiar with computer programming, many of the con-
ventions, structure, and program control will appear familiar. There
are, however, some differences that can initially appear confusing. On
the other hand, for the neophyte, it is relatively easy and straight-
forward to write and use programs and their usefulness will quickly
become evident.
Some of the issues that can be confusing in Stata programming deal
with the vocabulary used in discussing the language. For example,
Stata uses the term macro to indicate what in other languages is called
a variable . Remember, however, that Stata is primarily a statistics
program, not a programming language, and, consequently, the term
variable is reserved for the columns of data in a dataset. This also can
Search WWH ::




Custom Search