Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: egen; version


From   David Kantor <[email protected]>
To   [email protected]
Subject   st: egen; version
Date   Wed, 25 Feb 2004 16:57:16 -0500

Hi, everyone.

I just noticed a peculiar behavior that I thought I'd share.

If I do this...

gen byte temp1 = V8==.c

egen byte b1 = max(V8==.c), by(V2 V3)
egen byte b2 = max(temp1), by(V2 V3)

Then b1 and b2 can be different, contrary to my initial expectation.

This was a puzzle, but then I realized that egen.ado (and _gmax.ado) set version to 6. Therefore, the expression V8==.c within the call to egen evaluates to 1 for ALL missings -- not just .c. Thus, b1 indicates the presence of any missings in V8, whereas b2 indicates the presence of .c only.

This is something to be aware of, and I didn't see any warning about it in the egen help.

I''ve sent this to Stata tech support, too.
-- David

David Kantor
Institute for Policy Studies
Johns Hopkins University
[email protected]
410-516-5404

*
* 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/




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