I prefer Gabi's and Nick's solution(s) too.
Of course, regarding my own ideas, it is egen's rowtotal() function,
not egen's total() function or generate's sum() function, that creates
regular sums but that idea is moot by now. And to make bad things
worse, from my perspective, I need to read up on how to use the
logical operator in regular expressions in Stata.
Thanks,
Anders
On Dec 14, 2007 11:40 AM, Nick Cox <[email protected]> wrote:
> Yes, good idea. In so far as "A" and "X" are the only alphabetic
> characters, then
>
> . list if missing(real(codeks))
>
> will identify any observations with "A", "X", "AX" within -codeks-,
> and no others.
> Note that no intermediate variable is needed for that purpose.
>
> Gabi Huiber
>
> This solution is not general, in that it assumes that all the codeks
> values that do not include A, X, or AX are numeric strings. If that is
> the case, Badi could simply do this:
>
> gen x=real(codeks)
>
> and x will show a missing value everywhere codeks shows A, X, or AX.
>
> Then it won't be too hard to say
>
> gen codeks_ax_dummy=(x==.)
> drop x
*
* 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/