Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Something wrong with the -count- option in the -egen-?


From   gjhxmu@sina.com
To   statalist<statalist@hsphsun2.harvard.edu>
Subject   st: Something wrong with the -count- option in the -egen-?
Date   Thu, 13 Aug 2009 16:37:03 +0800

I typed the following in the stata and found -count- option didn't work well.

Anything wrong?

clear
input x
1
2
3
5
.
end
egen y=count(x)
egen yy=count(x>2)
egen yyy=count(x==2)
l,noobs

    +------------------+
  | x   y   yy   yyy |
  |------------------|
  | 1   4    5     5 |
  | 2   4    5     5 |
  | 3   4    5     5 |
  | 5   4    5     5 |
  | .   4    5     5 |
  +------------------+


Thank you for any help!

Best regards,
Rose

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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