Skip to content

Commit

Permalink
Closes #75: gunique returns 0s in r() when there are no obs
Browse files Browse the repository at this point in the history
  • Loading branch information
mcaceresb committed Aug 28, 2021
1 parent 2044f08 commit 17a9e7e
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 1 deletion.
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ open:
dolphin --split ~/todo/now/stata-gtools \
~/todo/now/stata-gtools/src &

# !!! todo xx BUG; gunique when no obs and gen!!!! should be all missing!!!
# test xx src/test/test_gregress.do
# doc xx docs/usage/gpoisson.md (consolidate)
# doc xx docs/stata/gpoisson.sthlp (consolidate)
Expand Down
9 changes: 9 additions & 0 deletions build/changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
Change Log
==========

## gtools-1.8.1 (2021-08-27)

### Bug Fixes

- 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

## gtools-1.8.0 (2021-06-15)

### Features
Expand Down
10 changes: 10 additions & 0 deletions build/gunique.ado
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ program gunique, rclass
}
else if ( `rc' == 17001 ) {
di as txt "(no observations)"
return scalar N = 0
return scalar J = 0
return scalar unique = 0
return scalar minJ = 0
return scalar maxJ = 0
exit 0
}
else if ( `rc' ) exit `rc'
Expand Down Expand Up @@ -114,6 +119,11 @@ program gunique, rclass
}
else if ( `rc' == 17001 ) {
di as txt "(no observations)"
return scalar N = 0
return scalar J = 0
return scalar unique = 0
return scalar minJ = 0
return scalar maxJ = 0
exit 0
}
else if ( `rc' ) exit `rc'
Expand Down
9 changes: 9 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
Change Log
==========

## gtools-1.8.1 (2021-08-27)

### Bug Fixes

- 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

## gtools-1.8.0 (2021-06-15)

### Features
Expand Down
10 changes: 10 additions & 0 deletions src/ado/gunique.ado
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ program gunique, rclass
}
else if ( `rc' == 17001 ) {
di as txt "(no observations)"
return scalar N = 0
return scalar J = 0
return scalar unique = 0
return scalar minJ = 0
return scalar maxJ = 0
exit 0
}
else if ( `rc' ) exit `rc'
Expand Down Expand Up @@ -114,6 +119,11 @@ program gunique, rclass
}
else if ( `rc' == 17001 ) {
di as txt "(no observations)"
return scalar N = 0
return scalar J = 0
return scalar unique = 0
return scalar minJ = 0
return scalar maxJ = 0
exit 0
}
else if ( `rc' ) exit `rc'
Expand Down

0 comments on commit 17a9e7e

Please sign in to comment.