Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gegen rank vs. egen rank #68

Closed
economoser opened this issue Sep 30, 2019 · 1 comment
Closed

gegen rank vs. egen rank #68

economoser opened this issue Sep 30, 2019 · 1 comment
Assignees

Comments

@economoser
Copy link

It seems that, oddly, the -rank- subcommand of -gegen- does not support a by-option, while the original -egen- command does. Maybe a bug? See example below:

. bys year: gegen inc_rank = rank(inc)
by: prefix not allowed with rank
r(198); t=0.02 9:18:35

. bys year: egen inc_rank = rank(inc)
(9925 missing values generated)
r; t=0.10 9:18:39
@mcaceresb
Copy link
Owner

This is not so much of a bug as maybe a design flaw. I purposely disallowed that in case the user tried to pass something that is allowed with by but that I wouldn't account for... However, in this case I force the input to be a single variable, so it might be OK.

I'l probably allow the by prefix in the next release. In the meantime you can comment out lines 152 to 155 in gegen.ado as a quickfix (i.e. these lines).

@mcaceresb mcaceresb self-assigned this Oct 2, 2019
mcaceresb added a commit that referenced this issue Jan 27, 2020
Features

- In `gregress` (including `givregress` and `gpoisson`) collinear
  columns are now dropped (LDL' decomposition).

- `gegen shift, shiftby(#)` and `gstats transform (shift #)` are available
  to compute lags (negative `#`) and leds (positive `#`).

- Adds `gini`, `gini dropneg`, `gini keepneg` to `gcollapse`, `gegen`,
  and `gstats tab`.

- Adds `cumsum`, `cumsum +/-`, and `cumsum +/- varname` to `gstats transform`;
  options can also be passed to `cumsum` globally via `cumby()`

- Closes #69. `greshape wide/spread` now allows `labelformat()` for
  custom variable labels (only when a single variable is passed to
  `key()/j()`). The default is `#keyvalue# #stublabel#`.  Available
  placeholders are `#stubname#`, `#stublabel#`, `#keyname#`,
  `#keylabel#`, `#keyvalue#`, and `#keyvaluelabel#`

Enhancements

- Closes #68. `gegen` now allows `by:` prefix when calling a
  `gstats transform` function (this is only allowed because these calls
  already require single-variable input, so the `by:` prefix should not
  present an issue when calling the function).

- In `givgregress`
    - Values to missing if model is not identified (not enough instruments).
    - `hdfe` no longer saves projected vars.

- Collinearity and singularity checks in regression models

- Removed rowmajor option from `gregress`

Bug Fixes

- In `gquantiles`, data was read incorrectly with `by()` and `weights`
  if `xtile` was not requested. In particular, the data was copied as if
  the target had only one column, but since weights need to be included,
  the target has two columns. This was fixed.

- Fixes bug in `greshape, dropmiss` where if the number of remaining
  observations is lower than the observations in memory, `set obs` would
  be run, resulting in an error. Now `keep in` is run for that case.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants