Your code looks fine to me. How about updating to version 8.2 and trying
again?
Ramani
I am trying to calculate household size using collapse. The dataset has
two variables, a unique household ID <uhhid> and the serial numbers of
the >household members <hhmem>.
This is the code I used and the error I get.
. /*create variable household size*/
. use rindvar02, clear