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]
Re: st: panel data-dropping all observations for the identifier when certain variable value is missing
From
Muhammad Anees <[email protected]>
To
[email protected]
Subject
Re: st: panel data-dropping all observations for the identifier when certain variable value is missing
Date
Wed, 6 Jul 2011 08:32:49 +0500
drop xvar if date<datein2008 will drop all those observations with
missing datein2008 observations too as I guess. but the inverse
command of -keep-ing will do the job. You can use
keep xvar if date>datein2008
keep xvar if date>datein2007
keep xvar if date>datein2006
etc.
Hope this works
Anees
On Wed, Jul 6, 2011 at 5:07 AM, Sabrina Helmut <[email protected]> wrote:
>
>
> Dear all,
>
> I am struggling with the following:
>
> I have firm-year observations for the years 2003-2010. For cases where the last value for the variable <offdate>, which is a variable containing dates, is older than a
> date in 2008 (so date in 2007, 2006,...) then stata shall drop the firm/identifier at all, so for
> every year. Then, I want stata to show me for every firm/identifier the last entry for the variable <offdate>, which could then either be a date in 2008, 2009 or 2010. Which commands could help me doing this?
>
> Thanks,
> Sabrina
>
>
>
>
>
> *
> * For searches and help try:
> * http://www.stata.com/help.cgi?search
> * http://www.stata.com/support/statalist/faq
> * http://www.ats.ucla.edu/stat/stata/
>
--
Muhammad Anees
MSc & MS in Economics
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/