Object Reference : Object View and Procedure Reference : Series
  
 
statby
Basic statistics by classification.
The statby view displays descriptive statistics for the elements of a series classified into categories by one or more series.
Syntax
series_name.statby(options) classifier_list
You should follow the series name with a period, the statby keyword, and a name (or a list of names) for the series or groups by which to classify.
The options control which statistics to display and in what form. By default, statby displays the means, standard deviations, and counts for the series.
Options
Options to control statistics to be displayed
 
sum
Display sums.
med
Display medians.
max
Display maxima.
min
Display minima.
quant=arg (default=.5)
Display quantile with value given by the argument.
q=arg (default=“r”)
Compute quantiles using the specified definition: “b” (Blom), “r” (Rankit-Cleveland), “o” (Ordinary), “t” (Tukey), “v” (van der Waerden), “g” (Gumbel).
skew
Display skewness.
kurt
Display kurtosis.
na
Display counts of NAs.
nomean
Do not display means.
nostd
Do not display standard deviations.
nocount
Do not display counts.
Options to control layout
 
l
Display in list mode (for more than one classifier).
nor
Do not display row margin statistics.
noc
Do not display column margin statistics.
nom
Do not display table margin statistics (unconditional tables); for more than two classifier series.
nos
Do not display sub-margin totals in list mode; only used with “l” option and more than two classifier series.
sp
Display sparse labels; only with list mode option, “l”.
Options to control binning
 
dropna (default), keepna
[Drop/Keep] NA as a category.
v=integer (default=1000)
Bin categories if classification series take on more than the specified number of distinct values.
nov
Do not bin based on the number of values of the classification series.
a=number (default=2)
Bin categories if average cell count is less than the specified number.
noa
Do not bin based on the average cell count.
b=integer (default=5)
Set maximum number of binned categories.
nolimit
Remove prompt warning for continuing when the total number of cells is very large.
Other options
 
prompt
Force the dialog to appear from within a program.
p
Print the descriptive statistics table.
Examples
wage.statby(max, min) sex race
displays the mean, standard deviation, maximum, and minimum of the series WAGE by (possibly binned) values of SEX and RACE.
group g1 sex race state
wage.statby(max, min) g1
shows the mean, standard deviation, maximum, and minimum of the series WAGE by (possibly binned) values of SEX, race, and STATE.
Cross-references
See “By-Group Statistics” for a list of functions to compute by-group statistics. See also “Stats by Classification” for discussion.
See also Vector::statby and boxplot.