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)
.
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
Version info