Agriculture Reference
In-Depth Information
If the adjustment value is not displayed, you will need to reenter the
anova command and recalculate this value. This value is 0.0358982
and can be substituted in the subsequent calculations if you do not
want to redo the anova .
The ratio of these adjusted values will be used to calculate the F
value and probability. Enter the following commands:
count
local k = sqrt (r(N))
gen y = sum (tiller)
local G = y[_N]
gen W = `k' * tiller - (`k'+1) * btiller + `G'
gen T = tiller + `u' * W
gen M = T/(`k' + 1)
gen T2 = T^2
gen y2 = sum (T2)
local TT2 = y2[_N]
local adjTMS = 1/((`k'+ 1) * (`k'^2 - 1)) * (`TT2'
- (`G'^2/`k'^2))
local EEMS = (e(rss)/e(df_r)) * (1 + `k' * `u')
local adjF = `adjTMS'/`EEMS'
display `adjF'
display Ftail( `k'^2-1, (`k'-1) * (`k'^2 - 1), `adjF')
The count command counts the number of observations in the
current dataset, which is 16. More importantly, it stores this value
in the scalar r(N). The next command creates a local macro, k,
which is the square root of the scalar r(N) resulting in 4. The next
command generates a new variable y that is a running total of the
tiller variable. G is a local macro of the last value in the y vari-
able, which has a value of 13,746. The next variable generated is W,
which is calculated using the k and G macros with the tiller and
btiller variables. The next variables, T, M, T2, and y2, are gener-
ated in a like fashion. The TT2 macro is before the last item in the
y2 variable. The adjTMS holds the adjusted treatment mean square
and the EEMS is the calculated adjustment to the error mean
square (effective error mean square). The F value is calculated as the
adjusted treatment mean square divided by the EEMS. Finally, the
calculated F and the related probability are displayed.
Search WWH ::




Custom Search