Agriculture Reference
In-Depth Information
observations based on a condition. For example, you may be inter-
ested in only yields above a certain level or range. The in qualifier
allows you to select a range of observations. For example, if you wish
to look at the first 10 entries, type tabstat fieldyield in 1/10 .
Weights allow you to have another variable as a weight in comput-
ing the statistic of interest. For example, a specific measurement may
have occurred several times for a treatment so that a frequency weight
would be used. Stata also allows probability, analytic, and importance
weights, which are discussed in more detail in the online Help files.
Open the onionyield03.dta for the following example. The
tabstat command is most useful when used with a grouping com-
mand. In this case, the entry variable indicates the varieties that were
in the experiment. The tabstat command can compute statistics by
a specific variable (var, in this case) in a couple of different ways. Look
at the following two commands:
tabstat fieldyield , statistics( mean) by( entry )
by entry , sort : tabstat fieldyield , statistics( mean)
Both of these commands do the same thing: list the means of
fieldyield, which is computed for each entry. The first case is probably
more useful because it lists the results as a simple table, whereas, in
the second case, the headings are re-created each time a new mean is
calculated. The first command will result in a data display that will be
easier to cut and paste into another document as a table.
There are a large number of descriptive statistics that can be com-
puted with the tabstat command. They include the mean, count,
sum, maximum, minimum, range, standard deviation, variance, coef-
ficient of variation, standard error of the mean, skewness, kurtosis,
median, as well as a number of percentiles.
Although tabstat is capable of generating many descriptive sta-
tistics, it does not save any of these results. With some commands,
Stata saves the results in variables that can be accessed for further
calculations. One such command is summarize :
summarize [ varlist ] [ if ] [ in ] [ weight ] [, options ]
summarize will calculate the number of observations, mean,
standard deviation, minimum, and maximum. You can use this
Search WWH ::




Custom Search