Agriculture Reference
In-Depth Information
number of decimal places. Stata has many detailed formatting direc-
tives including for dates and times.
Finally, the last line end ends the program. This simple program
is one that I use routinely to calculate treatment means, CV, and the
LSD value for variety trials.
One of the results lines lists its output as Fisher's Protected LSD
(p≤0.05). This is not entirely correct. Actually, this line only calculated
the LSD, which controls for comparisonwise error. In order for this
LSD to be Fisher's Protected LSD, there needs to be an experiment-
wide level of significance; the treatment probability (Variety) should
be below 5%. In the example dataset, this probability is not actually
significant at the 5% level (p = 0.3367).
This then is an opportunity to improve the program. Several new
lines of code will be added to this do-file to determine if, in fact, the
experimentwide error rate is below the requisite 5% level. To begin,
the following lines of code will be added after the CV is displayed.
Actually, these lines can be added anywhere in the program as long as
they occur after the anova command has been executed. These lines
are
local r = e(df_1)
local s = e(df_r)
local t = e(F_1)
These lines save the scalars for the degrees of freedom for treat-
ments (numerator) and the residual (denominator), as well as the cal-
culated F value for the treatments, respectively. Their values are 4, 12,
and 1.264906429141414. The next line added is
local a = Ftail( `r',`s',`t' )
he Ftail() function calculates the probability, which, in this
case, is associated with the variety differences. The probability calcu-
lated is 0.33669645. This is the same probability (with more decimal
places) than is shown in the ANOVA table under the Prob > F head-
ing for variety. This value is then used to compare with the level of
significance chosen (i.e., 0.05). The next section of code to be added
then makes a decision and displays results based on this comparison.
The code is
Search WWH ::




Custom Search