Agriculture Reference
In-Depth Information
scalars:
r(N) = 20
r(sum_w) = 20
r(mean) = 102.4
r(Var) = 108.83894698294
r(sd) = 10.43259061704906
r(min) = 82.5
r(max) = 122.5
r(sum) = 2048
These are referred to as scalars because they represent specific val-
ues and these values can be used in subsequent operations by refer-
ring to their label ( r(N), r(s u m _ w), etc.). These scalars are only
held temporarily in memory. If another summarize command with
a different variable were entered then the new scalars would be in
memory.
he r(mean) value is then used by the next line in the program,
local u = r(m ea n)/* Overall mean */ . A local macro is one
that can hold a value while this program is executing. As soon as
the execution is complete, the local macro is dropped. Now the pro-
gram has the r(mean) value (i.e., 102.4) stored in the local macro u .
The remainder of this line /* Overall mean */ is just a comment.
Anything that appears between /* and */ is ignored by the program.
As you write programs, it is a good idea to add comments explaining
what is happening or identifying items. This will help you remember
what you did when you come back to the program later or will help
others see exactly what you have done. Comments also can be added
using double slashes ( // ). The /* */ format is generally used for larger
comments of several lines.
The next line,
tabstat `depend' , by( `indep1' ) columns(variables) /*
Table of treatment means */
calculates a table of means for the first argument ( depend ) using the
second argument ( indep1 ) to group the means and places them in
a column format. It is important at this point to explain the use of
quotation marks. The open and closed quote marks tell Stata that the
value of the macro should be used. If the quotes are not present, then
Stata interprets it to mean just the word (depend, indep1, etc.). The
open quote that we are using here is located next to the 1 in the upper
Search WWH ::




Custom Search