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]

st: Observations that keep a feature in the whole sample period


From   "Miguel Angel Duran Munoz" <[email protected]>
To   [email protected]
Subject   st: Observations that keep a feature in the whole sample period
Date   Wed, 22 May 2013 00:01:09 +0200 (CEST)

Hi, Statalisters. I want to focus on agents in my dataset that have a
particular feature; specifically, for those agents, and for each and every
period (out of 64), the value of a variable (const_a) is larger than a
particular threshold (0.097116). I have done what I show below.
Nevertheless, I have realized that some of my agents are not in the sample
since the first period, so what I am doing would mistakenly eliminate
them. Will anyone help to solve this problem? Thanks in advance.

bysort entity (date2): gen obs=_n
drop if const_a<0.097116
by entity: drop if obs[_N]<64

Miguel.



*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index