Agriculture Reference
In-Depth Information
This do-file requires an ado file that is not part of the official package
of Stata ado files. The ado file in question is qsturng. To find this pro-
gram, enter in the Command window while connected to the Internet
findit qsturng
This command will open a Viewer window with a list of several Stata
Technical Bulletins (STB). Download dm64, which is in STB-46,
and install this ado command.
qsturng
stands for q studentized
range, which is found in tables at the back of many statistics textbooks.
This command requires three inputs: the number of treatments, error
degrees of freedom, and probability rate. For a 5% probability, enter
the value 0.95 and for a 1% probability enter 0.99.
The duncan do-file is almost identical to the scheffe do-file in terms
of presenting the results. It differs in the comparison values used to com-
pare means. With the Scheffé Test, a single test value is used, whereas
with Duncan's MRT there is a different value for each comparison.
Look at the segment of code below to see how this is calculated.
local
var
=
(e(rmse))
^
2
// Error mean square from ANOVA
local
repl
=
e(df_2)
+
1
// Number of replications
local sd =
sqrt(
2
*
`var'
/
`repl'
)
// Standard error of the mean
difference
local
trt
=
e(df_1)
+
1
// Number of treatments
forvalues
x
=
2
/
`trt'
{
// Loop from 2 to number of
treatments
quietly
:
qsturng
`x' e(df_r) 0.95
^
(`x'-1)
/* Calculates the Studentized Range (this function is not part of
the official Stata ado files and will have to be downloaded */
local
stu`x' = $S_1 //qsturng saves its results in
global S_1 & $S_1 returns the
value
local
r`x' = `stu`x''
*
`sd'
/sqrt(
2
)
/* Using the Studentized Range
to calculate the significant
difference based on rank order
distance */
}
// End 'x' brace
From the previous ANOVA, several e() scalars are available to use
in the program. The e(rmse) is the root mean square error, which when
Search WWH ::
Custom Search