Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: list (if) (in)


From   "Vladimir Vakhitov" <vvakhitov@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: list (if) (in)
Date   Thu, 10 Apr 2008 14:57:37 -0400

Malcolm,

If you don't want to use -keep-, there is one weird way.

gen q=_n if x==5
egen qq=group(q)
list if qq<=10

If you need just to look at the data, use -browse- instead of list:

browse x if x==5

Vladimir.



2008/4/10, Malcolm Wardlaw <malcolm@mail.utexas.edu>:
> I'm sure this question is easy to answer, but searching for it is a little
> hard given that there are a lot of "if"s and "in"s in the documentation.
>
>  I want to be able to list the first 10 observations that conform to a given
> 'if' statement.
>
>  I can't do
>
>         list if x=5 in 1/10
>
>  or
>
>         list in 1/10 if x=5
>
>  since that only returns the first 10 observations in the data -if- they
> conform.
>
>  I want the first 10 observations that -do- conform.
>
>  Is there an easy way to do this?
>
>  Sorry if this is a dumb question
>
>  Malcolm
>  *
>  *   For searches and help try:
>  *   http://www.stata.com/support/faqs/res/findit.html
>  *   http://www.stata.com/support/statalist/faq
>  *   http://www.ats.ucla.edu/stat/stata/
>


-- 
__________________
Volodymyr Vakhitov
vvakhitov@gmail.com
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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