*! version 0.2 08jul2015

Title

sumup -- Summary statistics by group

Syntax

sumup
[varlist]
[if] [in] [weight]
,
[options]

Description

sumup returns the same set of statistics than summarize, computed by groups.

Weights

fweights, aweights and pweights are allowed; see weight.

Options

by(byvars) variable(s) defining groups

detail detailed statistics.

statistics(statnames) specified list of statistics (see statnames)

save(filename) save statistics as a collapsed dataset

replace overwrite existing dataset

Statnames

mean mean

count count of nonmissing observations

n same as count

sum sum

max maximum

min minimum

range range = max - min

sd standard deviation

variance variance

cv coefficient of variation (sd/mean)

semean standard error of mean (sd/sqrt(n))

skewness skewness

kurtosis kurtosis

median median (same as p50)

p?? ??th percentile

iqr interquartile range = p75 - p25

q equivalent to specifying p25 p50 p75

Examples

Setup

. sysuse nlsw88.dta

. sumup wage, by(race)

. sumup wage [w = hours], by(race)

. sumup wage, by(industry) detail

. sumup wage, by(union married)

. sumup, by(union married)

. sumup wage, by(industry) statistics(mean p80)

. sumup wage hours, by(union married) save(temp.dta) replace

References

sumup, table, tabstat, collapse have similar functionalities, but sumup is ten times faster.
Code for sumup borrows heavily from tabstat.

Author

Matthieu Gomez

Department of Economics, Princeton University

Please report issues on Github
https://github.com/matthieugomez/stata-sumup