You probably cannot replace with the string count: if at all, you would have
to count first and the replace with the return value "r(N)".
Also try this:
**********
u auto, clear
egen float mygroups = group(f rep78)
by mygroups, sort : egen float mycount = count(mygroup)
**********
HTH
Martin
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Ashim Kapoor
Sent: Thursday, September 18, 2008 9:34 AM
To: [email protected]
Subject: st: use of count.
Hello everyone,
I have a question :
I want to do :
bysort state cnum cname : replace no_of_cand_in_state=count
This does not work. could someone please tell me how do I fix this ?
Thank you,
Ashim.
*
* 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/
*
* 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/