Here is a more simple example. I also should have mentioned I am using
Stata/SE 8.2.
. input numvar str1 strvar
numvar strvar
1. 5
2. 6 "a"
3. 7 "b"
4. end
. egen testsum_1 = sum(numvar)
. egen testmedian_1 = sum(numvar)
. egen testsum_2 = sum(numvar) if strvar=="a"
(2 missing values generated)
. egen testmedian_2 = median(numvar) if strvar=="a"
a not found
r(111);
.
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Alex Ogan
Sent: Monday, May 22, 2006 11:59 AM
To: [email protected]
Subject: st: error with -egen median if-
Can anyone explain this weird error (the type mismatch failure on the
final -egen-)?
This message is intended solely for the designated recipient(s). It may contain confidential or proprietary information and may be subject to confidentiality protections. If you are not a designated recipient, you may not review, copy, or distribute this message. If you receive this in error, please notify the sender by reply e-mail and delete this message.
Arrowstreet Capital, L.P. is an Equal Opportunity Employer.
*
* 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/