Statalist The Stata Listserver


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

st: RE: dropping all years of id


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: dropping all years of id
Date   Wed, 17 Jan 2007 21:58:38 -0000

Suppose you 

tsset id year 

then one solution might resemble 

by id : egen minfreefloat = min(freefloat)
by id : drop if minfreefloat < 0.2 
drop minfreefloat 

An alternative would be 

drop if missing(freefloat) 
bysort id (freefloat) : drop if freefloat[_N] < 0.2 

Nick 
[email protected] 

Thomas Erdmann
 
> I have tsset my data (15 years). For one indicator 
> (independence) I have
> only data for the last 4 years. I'd like to drop each company 
> where the
> indicator is below some bound (e.g. 0.2) in the fours years I 
> have data
> available.
> 
> But
> Drop if freefloat<=0.2 & year==2005 
> 
> Doesn't work because if the condition is true for all of the 
> four years I'd
> like to remove the company completely from the data (for ALL years).

*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index