Statalist The Stata Listserver


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

st: error with -egen median if-


From   "Alex Ogan" <[email protected]>
To   <[email protected]>
Subject   st: error with -egen median if-
Date   Mon, 22 May 2006 11:58:47 -0400

Can anyone explain this weird error (the type mismatch failure on the
final -egen-)? 

. codebook price_close_usd

------------------------------------------------------------------------
---------------------------------------------
price_close_usd
Price_close_usd
------------------------------------------------------------------------
---------------------------------------------

                  type:  numeric (double)

                 range:  [.00013,92100]               units:  1.000e-06
         unique values:  36369                    missing .:  2186/59699

                  mean:   103.726
              std. dev:      1037

           percentiles:        10%       25%       50%       75%
90%
                             .4296   1.54118      6.88     22.55
53.3

. codebook is_adr

------------------------------------------------------------------------
---------------------------------------------
is_adr
Is_adr
------------------------------------------------------------------------
---------------------------------------------

                  type:  string (str7), but longest is str1

         unique values:  1                        missing "":
55599/59699

            tabulation:  Freq.  Value
                         55599  ""
                          4100  "1"

. egen testsum_1 = sum(price_close_usd)

. egen testmedian_1 = median(price_close_usd)

. egen testsum_2 = sum(price_close_usd) if is_adr != "1"
(4100 missing values generated)

. egen testmedian_2 = median(price_close_usd) if is_adr != "1"
type mismatch
r(109);

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/



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