tabstat — Compact table of summary statistics 3
statname Definition statname Definition
mean mean p1 1st percentile
count count of nonmissing observations p5 5th percentile
n same as count p10 10th percentile
sum sum p25 25th percentile
max maximum median median (same as p50)
min minimum p50 50th percentile (same as median)
range range = max − min p75 75th percentile
sd standard deviation p90 90th percentile
variance variance p95 95th percentile
cv coefficient of variation (sd/mean) p99 99th percentile
semean standard error of mean (sd/
√
n) iqr interquartile range = p75 − p25
skewness skewness q equivalent to specifying p25 p50 p75
kurtosis kurtosis
Options
labelwidth(#) specifies the maximum width to be used within the stub to display the labels of the
by() variable. The default is labelwidth(16). 8 ≤ # ≤ 32.
varwidth(#) specifies the maximum width to be used within the stub to display the names of the vari-
ables. The default is varwidth(12). varwidth() is effective only with columns(statistics).
Setting varwidth() implies longstub. 8 ≤ # ≤ 32.
columns(variables |statistics) specifies whether to display variables or statistics in the columns
of the table. columns(variables) is the default when more than one variable is specified.
format and format(% fmt) specify how the statistics are to be formatted. The default is to use a
%9.0g format.
format specifies that each variable’s statistics be formatted with the variable’s display format; see
[D] format.
format(% fmt) specifies the format to be used for all statistics.
The column width is the maximum width of these formats. The minimum column width is nine
display characters.
casewise specifies casewise deletion of observations. Statistics are to be computed for the sample
that is not missing for any of the variables in varlist. The default is to use all the nonmissing
values for each variable.
nototal is for use with by(); it specifies that the overall statistics not be reported.
missing specifies that missing values of the by() variable be treated just like any other value and
that statistics should be displayed for them. The default is not to report the statistics for the by()==
missing group. If the by() variable is a string variable, by()=="" is considered to mean missing.
noseparator specifies that a separator line between the by() categories not be displayed.
longstub specifies that the left stub of the table be made wider so that it can include names of the
statistics or variables in addition to the categories of by(varname). The default is to describe the
statistics or variables in a header. longstub is ignored if by(varname) is not specified.
save specifies that the summary statistics be returned in r(). The overall (unconditional) statistics
are returned in matrix r(StatTotal) (rows are statistics, columns are variables). The conditional
statistics are returned in the matrices r(Stat1), r(Stat2), . . . , and the names of the corresponding
variables are returned in the macros r(name1), r(name2), . . . .