Agriculture Reference
In-Depth Information
so the first step in writing this program is to enter
capture
pro-
gram
drop
anovalsd
. Remember this line drops the program
anovalsd from memory and ignores any error code that may occur if
the program is not in memory. The next line to enter is
program
anovalsd
, which defines the program. The next line
args
tells
the program that subsequent items are arguments, which will be
used in the program. When this program is run, it requires three
arguments, which are passed to the program. To use the program
after it has been run, you would enter
anovalsd
depend
indep1
rep
where the three arguments would be the variable names from
the dataset in memory representing the dependent, independent,
and replication variables.
The next line
set
more
off
, as mentioned previously, turns off
the pause feature in the Results window. Usually output is paused
with every screen requiring the user to hit a key to see the next screen.
By turning off this feature, the results are displayed all at once with-
out pausing.
quietly:
summarize
`depend'
is one of the great features of
Stata programming. Executing a command
quietly
means no out-
put is to be generated. Instead the command
summarize
is executed
and values calculated by this command are stored in memory. These
saved results then can be used by subsequent commands. To dem-
onstrate this, load the dataset Onion varieties programming.dta and
enter the following command:
summarize
Yield
This results in the following output:
Variable | Obs Mean Std. Dev. Min Max
-------------+--------------------------------------------------
Yield | 20 102.4 10.43259 82.5 122.5
Now enter the command
return list
This results in the following output:
Search WWH ::
Custom Search