Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


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

Re: st: index number of an observation


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?searchhttp://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/


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