Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | Amir Kasaeian <amir_kasaeian@yahoo.com> |
To | "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu> |
Subject | Re: st: index number of an observation |
Date | Sun, 10 Mar 2013 15:01:55 -0700 (PDT) |
Dear Clint, I didn't catch it! For example, I want to know what is the first observation (now by which index) more than mean in a column? I want its index number. thanks ----- Original Message ----- From: Clinton Thompson <clintonjthompson@gmail.com> To: statalist@hsphsun2.harvard.edu Cc: Sent: Sunday, 10 March 2013, 13:05 Subject: Re: st: index number of an observation You can create the index first w/ a system variable, like this: gen index = _n The variable, index, should then uniquely identify each observation in your dataset and can then be used to reference a specific observation. Type -findit subscripting- (without the dashes) for more information. HTH, Clint On Sun, Mar 10, 2013 at 10:07 AM, Amir Kasaeian <amir_kasaeian@yahoo.com> wrote: > Dear all, > > Good day! > I want to catch index number of an observation in my data set. Which command or lines of codes should I use? > > Many thanks. > > Best, > Amir > > * > * For searches and help try: > * http://www.stata.com/help.cgi?search > * http://www.stata.com/support/faqs/resources/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/faqs/resources/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/faqs/resources/statalist-faq/ * http://www.ats.ucla.edu/stat/stata/