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

gunique missing scalars when there are no observations #75

Closed
NilsJPWerner opened this issue Jul 26, 2021 · 0 comments
Closed

gunique missing scalars when there are no observations #75

NilsJPWerner opened this issue Jul 26, 2021 · 0 comments
Assignees

Comments

@NilsJPWerner
Copy link

Describe the bug
gunique handles no observations differently from unique. Unique return 0 for its scalars in the case of no observations, while gunique returns nothing.

Code Sample

. sysuse auto, clear
(1978 Automobile Data)

. unique foreign if make == "audi"
Number of unique values of foreign is  0
Number of records is  0

. di r(sum)
0

. di r(N)
0

. gunique foreign if make == "audi"
(no observations)

. di r(unique)
.

. di r(J)
.

. di r(N)
.

Version info

  • OS: Ubuntu 20.04
  • Version: v1.5.0
@mcaceresb mcaceresb self-assigned this Jul 26, 2021
mcaceresb added a commit that referenced this issue Aug 28, 2021
Features

- Added `gglm` to estimate GLM models, including `logit`.

Bug Fixes

- Closes #78: if now passed raw/in double-quotes throughout the pipeline
- Closes #75: gunique returns 0s in r() when there are no obs
- Closes #74: gstats transform parses abbreviated targets
- Closes #72: Warning for gegen expressions without by group
- Fixed GLM issues generating de-meaned variables
- Fixed gegen nunique with multiple inputs
- Fixed bug in `gpoisson` where internal weights not copied correctly in loop.
- Various fixes to the docs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants