Agriculture Reference
In-Depth Information
The program is heavily commented to explain how it works, but,
in any case, I would like to walk through the program and explain
exactly what it does. This basic format can be used with any of the
multiple range tests with small changes to the calculations. There are
three arguments entered with the scheffe command representing
the dependent variable ( depend ), the independent or treatment vari-
able ( indep ), and the replication variable ( rep ). The number of argu-
ments can be changed for more complex designs. The next statement
calculates the ANOVA and, again with more complex designs, this
statement can be modified to accommodate such changes. The next
statement sets the macro trt to the number of treatments from the
saved scalars, e(df _ 1) plus 1. Set more off turns off the page
pausing that can occur in the Results window when the output is par-
ticularly long.
The next two statements calculate the critical S value discussed above
and the standard error as described above. These two are then multi-
plied together. This value is then the critical value in comparing any two
means. The next couple of lines display the results of this calculation.
he preserve command is used to remember the dataset in
memory. This is used in conjunction with the command restore ,
which occurs later in the program. The dataset is going to be collapsed
to capture the treatment means in the next statement and then the
dataset will be restored to its original form. You can see the effect of
preserve and restore by having the Data Editor visible and
entering the following three commands in the Command window:
preserve
collapse (mean) stron, by (lake)
restore
Collapsing the dataset by the treatments ( indep ), calculating
the treatment means ( depend ), and sorting these results give us the
treatment means in ascending order. These values then can be used
later in the program.
Do-files can do more than just calculations and display results.
Stata's programming language, like all computer programs, has the
ability to both loop through statements many times as well as make
decisions based on specific criteria. The next several statements in the
Search WWH ::




Custom Search