-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathsumup.sthlp
119 lines (90 loc) · 3.71 KB
/
sumup.sthlp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
{smcl}
{* *! version 0.2 08jul2015}{...}
{vieweralsosee "tabstat" "help tabstat"}{...}
{vieweralsosee "tabulate" "help tabulate"}{...}
{vieweralsosee "table" "help table"}{...}
{vieweralsosee "collapse" "help collapse"}{...}
{viewerjumpto "Syntax" "sumup##syntax"}{...}
{viewerjumpto "Description" "sumup##description"}{...}
{viewerjumpto "Weights" "sumup##weights"}{...}
{viewerjumpto "Options" "sumup##options"}{...}
{viewerjumpto "Statistics" "sumup##statnames"}{...}
{viewerjumpto "Examples" "sumup##examples"}{...}
{viewerjumpto "Author" "sumup##contact"}{...}
{title:Title}
{p2colset 5 18 20 2}{...}
{p2col :{cmd:sumup} {hline 2}}Summary statistics by group{p_end}
{p2colreset}{...}
{marker syntax}{...}
{title:Syntax}
{p 8 15 2} {cmd:sumup}
[{varlist}]
{ifin} {it:{weight}}
{cmd:,}
[{help sumup##options:options}] {p_end}
{marker description}{...}
{title:Description}
{pstd}
{cmd:sumup} returns the same set of statistics than {cmd:summarize}, computed by groups.
{marker weights}{...}
{title:Weights}
{pstd}
{cmd:fweight}s, {cmd:aweight}s and {cmd:pweight}s are allowed; see {help weight}.
{marker options}{...}
{title:Options}
{synoptset 30 tabbed}{...}
{synopthdr}
{synoptline}
{synopt :{opt by(byvars)}} variable(s) defining groups {p_end}
{synopt :{opt d:etail}} detailed statistics.{p_end}
{synopt:{opt s:tatistics(statnames)}} specified list of statistics (see {help sumup##statnames:statnames}) {p_end}
{synopt:{opt save(filename)}} save statistics as a collapsed dataset {p_end}
{synopt:{opt format(string)}} format to display statistics (except the number of observations and of missings)
{synopt:{opt replace}} overwrite existing dataset{p_end}
{marker statnames}{...}
{title:Statnames}
{synoptset 30 tabbed}{...}
{synopthdr}
{synoptline}
{synopt:{opt me:an}} mean{p_end}
{synopt:{opt co:unt}} count of nonmissing observations{p_end}
{synopt:{opt n}} same as {cmd:count}{p_end}
{synopt:{opt su:m}} sum{p_end}
{synopt:{opt ma:x}} maximum{p_end}
{synopt:{opt mi:n}} minimum{p_end}
{synopt:{opt r:ange}} range = {opt max} - {opt min}{p_end}
{synopt:{opt sd}} standard deviation{p_end}
{synopt:{opt v:ariance}} variance{p_end}
{synopt:{opt cv}} coefficient of variation ({cmd:sd/mean}){p_end}
{synopt:{opt sem:ean}} standard error of mean ({cmd:sd/sqrt(n)}){p_end}
{synopt:{opt sk:ewness}} skewness{p_end}
{synopt:{opt k:urtosis}} kurtosis{p_end}
{synopt:{opt med:ian}} median (same as {opt p50}){p_end}
{synopt:{opt p??}} ??th percentile {p_end}
{synopt:{opt iqr}} interquartile range = {opt p75} - {opt p25}{p_end}
{synopt:{opt q}} equivalent to specifying {cmd:p25 p50 p75}{p_end}
{marker examples}{...}
{title:Examples}
{pstd}Setup{p_end}
{phang2}{cmd:. sysuse nlsw88.dta}{p_end}
{phang2}{cmd:. sumup wage, by(race) }{p_end}
{phang2}{cmd:. sumup wage [w = hours], by(race) }{p_end}
{phang2}{cmd:. sumup wage, by(industry) detail}{p_end}
{phang2}{cmd:. sumup wage, by(union married)}{p_end}
{phang2}{cmd:. sumup, by(union married)}{p_end}
{phang2}{cmd:. sumup wage, by(industry) statistics(mean p80)}{p_end}
{phang2}{cmd:. sumup wage hours, by(union married) save(temp.dta) replace}{p_end}
{marker references}{...}
{title:References}
{cmd:sumup}, {cmd:table}, {cmd:tabstat}, {cmd:collapse} have similar functionalities. {cmd:sumup} is ten times faster, and allows to define groups composed of multiple variables.
Code for {cmd:sumup} borrows heavily from {cmd:tabstat}.
{marker contact}{...}
{title:Author}
{phang}
Matthieu Gomez
{phang}
Department of Economics, Princeton University
{phang}
Please report issues on Github
{browse "/~https://github.com/matthieugomez/stata-sumup":https://github.com/matthieugomez/stata-sumup}
{p_end}