You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Features - `greshape` supports `@` syntax for wide and long. Change the string to be matched via `match()` - `greshape` supports stata varlist syntax for long to wide (may not be combined with `@` within a stub). - `greshape` does not support varlist syntax for wide to long, but can use `match(regex)` for complex wide to long matches (see examples). - Closes#57 - `glevelsof, mata[(name)]` saves the levels to mata. The levels are _not_ stored in `r(levels)` and option `local()` is not allowed. With `silent`, the levels are additionally not formatted. - `glevelsof, mata numfmt()` requires `numfmt` to be a mata print format instead of a C print format. - `gtop, ntop(.)` and `gtop, ntop(-.)` now allow printing all the levels from largest to smallest or the converse. - `gtop, alpha` sorts the top levels in variable order. if `gtop -var, alpha` is passed then they are sorted in reverse order. - `gtop, mata` uses temporary files on disk to read the levels from C via mata. Matrices and locals are not used, meaning `r(levels)`, `r(toplevels)`, and the resuls stored via the option -matrix()-, ``r(`matrix')``, are no longer available. The user can access each of these via the mata object `GtoolsByLevels` (the user can change the name of this object via `mata(name)`). The levels are stored raw in `GtoolsByLevels.charx` and `GtoolsByLevels.numx`; the levels are stored formatted in `GtoolsByLevels.printed`; the frequencies are stored in `GtoolsByLevels.toplevels`. - `r(matalevels)` stores the name of the mata object with the levels and frequencies. - `gtop` also stores `r(ntop)`, `r(nrows)`, and `r(alpha)` as return scalars, for the numbere of top levels (if `.`, this will be `r(J)`), the number of rows in the `toplevels` matrix (it may or not include a row for "other" and a row for "missing"), and whether the top levels are sorted by their values. - `gtop, mata numfmt()` requires `numfmt` to be a mata print format instead of a C print format.
@@ -59,8 +59,8 @@ __*Gtools commands with a Stata equivalent*__
59
59
| gquantiles | xtile | 10 to 30 / 13 to 25 (-) ||`by()`, various (see [usage](https://gtools.readthedocs.io/en/latest/usage/gquantiles)) |
60
60
|| pctile | 13 to 38 / 3 to 5 (-) || Ibid. |
61
61
||\_pctile | 25 to 40 / 3 to 5 || Ibid. |
62
-
| gstats tab | tabstat | 10 to 60 / 5 to 40 (-)| See [remarks](#remarks)| various (see [usage](https://gtools.readthedocs.io/en/latest/usage/gstats_summarize)) |
63
-
| gstats sum | sum, detail | 10 to 40 / 5 to 10 | See [remarks](#remarks)| various (see [usage](https://gtools.readthedocs.io/en/latest/usage/gstats_summarize)) |
62
+
| gstats tab | tabstat | 10 to 50 / 5 to 30 | See [remarks](#remarks)| various (see [usage](https://gtools.readthedocs.io/en/latest/usage/gstats_summarize)) |
63
+
| gstats sum | sum, detail | 10 to 20 / 5 to 10 | See [remarks](#remarks)| various (see [usage](https://gtools.readthedocs.io/en/latest/usage/gstats_summarize)) |
64
64
65
65
<small>(+) The upper end of the speed improvements are for quantiles
66
66
(e.g. median, iqr, p90) and few groups. Weights have not been
@@ -296,8 +296,9 @@ allow weights).
296
296
297
297
Hence both should be able to replicate all of the functionality of their
298
298
Stata counterparts. Last, `gstats tab` allows every statistic allowed
299
-
by `tabstat` as well as any statistic allowed by `gcollapse`, and the
300
-
syntax for the statistics specified via `statistics()` is also the same.
299
+
by `tabstat` as well as any statistic allowed by `gcollapse`; the
300
+
syntax for the statistics specified via `statistics()` is the same
301
+
as in `tabstat`.
301
302
302
303
The following are implemented internally in C:
303
304
@@ -324,7 +325,7 @@ The following are implemented internally in C:
324
325
| min | X | X | X |
325
326
| range | X | X | X |
326
327
| select | X | X | X |
327
-
| rawselect | X |X| X |
328
+
| rawselect | X || X |
328
329
| percent | X | X | X |
329
330
| first | X | X (+) | X |
330
331
| last | X | X (+) | X |
@@ -349,7 +350,7 @@ gegen target = pctile(var), by(varlist) p(#)
349
350
```
350
351
351
352
where # is a "percentile" with arbitrary decimal places (e.g. 2.5 or 97.5).
352
-
`gtools` also supports selecting the `#`th smallest or largest non-missing value:
353
+
`gtools` also supports selecting the `#`th smallest or largest value:
353
354
```stata
354
355
gcollapse (select#) target = var [(select-#) target = var ...] , by(varlist)
355
356
gegen target = select(var), by(varlist) n(#)
@@ -385,13 +386,13 @@ Differences from `collapse`
385
386
-`rawstat` allows selectively applying weights.
386
387
-`rawselect` ignores weights for `select` (analogously to `rawsum`).
0 commit comments