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 on April 23, 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   Pappan MADHAVAN <madhavanpappan@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: index number of an observation
Date   Sun, 10 Mar 2013 18:14:24 -0400

You can use "list index if var>mean". Here you get the list all the
values that are more than mean, and you can see which obs is the first
one. I think in stata you can do this even without the index. Stata by
default gives this number.

Anand

On Sun, Mar 10, 2013 at 6:01 PM, Amir Kasaeian <amir_kasaeian@yahoo.com> wrote:
> 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/
*
*   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