Good point. However, as we're playing minor improvements,
note this too needs a fix:
gen grp = sum(flag == "01") if flag == ""
or
gen grp = sum(flag == "01") if mi(flag)
or perhaps even
gen grp = sum(flag == "01") if trim(flag) == ""
to catch "missings" that are somehow spaces.
Any more?
Nick
[email protected]
Nick Winter
> >Or just
> >
> >gen grp = sum(flag == "01")
>
> Or, to avoid assigning grp values to missing values of flag:
> gen grp = sum(flag == "01") if flag < .
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/