Statalist The Stata Listserver


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

st: Re: Re: RE: Re: first program


From   "Michael Blasnik" <michael.blasnik@verizon.net>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: Re: Re: RE: Re: first program
Date   Thu, 01 Jun 2006 14:23:36 -0400

No programming needed:

bysort id (date): keep if _n==_N

will keep the last observation (in date order) for each id.

Michael Blasnik
michael.blasnik@verizon.net

----- Original Message ----- From: "Christer Thrane" <ch-thran@online.no>
To: <statalist@hsphsun2.harvard.edu>
Sent: Thursday, June 01, 2006 2:13 PM
Subject: st: Re: RE: Re: first program



Is it possible to twitch it somehow so that it, for each unique person as defined by the person id variable, keeps only the observation form the last panel. In other words, I want to create a cross-sectional dataset in which the observations (one per person) may stem from different panels.
*
*   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