A new version of dstat is available. For installation, type:
dstat is a very general command for the estimation of a wide variety of summary statistics and distribution functions. For a list of changes since the last update see changes after 07nov2025 on https://github.com/benjann/dstat/. Some new features are as follows.
Code:
. ssc install dstat, replace
- dstat summarize now has an at() option to compute conditional statistics.
Code:
. sysuse nlsw88, clear
(NLSW, 1988 extract)
. dstat summarize (mean median) wage, at(grade=10/18)
Conditional statistics Number of obs = 2,244
Condition = grade
--------------------------------------------------------------
wage | Coefficient Std. err. [95% conf. interval]
-------------+------------------------------------------------
mean |
10 | 4.692721 .2402356 4.221614 5.163829
11 | 5.688235 .3512727 4.999382 6.377089
12 | 6.638048 .1593726 6.325515 6.950581
13 | 8.315217 .4910102 7.352335 9.278099
14 | 9.130599 .4990696 8.151912 10.10929
15 | 9.88578 .6455681 8.619806 11.15175
16 | 9.806044 .4052976 9.011246 10.60084
17 | 10.43081 .4875015 9.474806 11.38681
18 | 11.60784 .50493 10.61766 12.59802
-------------+------------------------------------------------
median |
10 | 4.203828 .2676516 3.678957 4.728698
11 | 5.032206 .230795 4.579612 5.4848
12 | 5.507244 .1082474 5.294968 5.719519
13 | 6.843801 .3397835 6.177478 7.510123
14 | 7.745568 .354447 7.050489 8.440646
15 | 8.904991 .3692172 8.180948 9.629034
16 | 8.542671 .3745201 7.808229 9.277113
17 | 10.06441 .4661785 9.150227 10.9786
18 | 10.59178 .3289128 9.946779 11.23679
--------------------------------------------------------------
- twoway dstat now supports dstat summarize if the at() option is specified.
Code:
. twoway dstat summarize (mean median) wage, at(grade=10/18) over(union)
- A new order() option can be used to change how results are arranged. For example, by default, dstat summarize groups results by variables. Type order(statistics) to group results by statistics.
Code:
. dstat summarize (mean median) wage tenure
Summary statistics Number of obs = 2,231
--------------------------------------------------------------
| Coefficient Std. err. [95% conf. interval]
-------------+------------------------------------------------
wage |
mean | 7.792448 .1220428 7.553118 8.031777
median | 6.280193 .0977002 6.0886 6.471786
-------------+------------------------------------------------
tenure |
mean | 5.97785 .1166616 5.749073 6.206627
median | 3.833333 .1224775 3.593151 4.073515
--------------------------------------------------------------
. dstat summarize (mean median) wage tenure, order(statistics)
Summary statistics Number of obs = 2,231
--------------------------------------------------------------
| Coefficient Std. err. [95% conf. interval]
-------------+------------------------------------------------
mean |
wage | 7.792448 .1220428 7.553118 8.031777
tenure | 5.97785 .1166616 5.749073 6.206627
-------------+------------------------------------------------
median |
wage | 6.280193 .0977002 6.0886 6.471786
tenure | 3.833333 .1224775 3.593151 4.073515
--------------------------------------------------------------
- Option qdef() supports additional quantile estimation methods, and the methods (17 in total) can now be selected by keywords.

Comment