Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

RE: st: FW: Generating a counter variable


From   "Oduwo, Geofrey" <[email protected]>
To   <[email protected]>
Subject   RE: st: FW: Generating a counter variable
Date   Mon, 22 Nov 2010 14:54:21 +0300

Thanks Abdon its worked for me

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Mitch Abdon
Sent: Monday, November 22, 2010 2:01 PM
To: [email protected]
Subject: Re: st: FW: Generating a counter variable

Hi, try bysort studyid: gen counter=_n

On Mon, Nov 22, 2010 at 6:57 PM, Oduwo, Geofrey <[email protected]> wrote:
> Hallo,
>
> I have a dataset and want to generate a variable that counts the study IDs each time they appear and starts the counting again each time a new study ID appears. How do I do this in stata.
>
> Thanks
>
> ==========================================
> Geofrey Oyoo Oduwo
> Data Analyst
> TB Research Branch
> KEMRI/CDC Research & Public Health Collaboration
> Mobile No: 0725 817 836 or 0750 371 472
> Email [email protected] or [email protected]
>
>
> *
> *   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/
>



-- 
Best,
Mitch


Arnelyn Abdon
+639178034402
http://statadaily.wordpress.com
http://www.facebook.com/pages/Stata-Daily/116477895082525

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


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index