I have a panel data set. Every id has tons of observations. I also create a dummy, called non, which shares the same value within id. In other words, for a specific id, its tons of observations has only one value (o or 1) of non.

Now I want to know how many ids are 0 of non and 1 of non. I want to do this, but it failed:
Code:
collapse (min) non, by(id)
distinct(id) if non == 1
Collapse command failed. After doing this collapse command, all id have non zero.
Why?