[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Seeking help in stata

From   "Anders Alexandersson" <[email protected]>
To   [email protected]
Subject   Re: st: Seeking help in stata
Date   Fri, 14 Dec 2007 12:05:58 -0500

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.


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:

© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index