Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Unbalanced to Balanced panel


From   Muhammad Anees <anees@aneconomist.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Unbalanced to Balanced panel
Date   Tue, 8 Nov 2011 11:51:57 +0500

after you do your data xtset id year;

bys pid: gen nyear=[_N]
keep if nyear==K

where k is the number of years you want to keep data for and where
every individual is traced.



On Tue, Nov 8, 2011 at 11:08 AM, Vinod Mishra <vinod.mishra@live.com> wrote:
> Dear All,
>
> I am a new member to Statalist and this is my first post. I have been searching and using information from statalist from last few years. My question is as follows:
>
> I have an unbalanced panel data and I want to make it balanced, such that I am left with the biggest possible 'N X T' balanced panel. Is there a stata program that automatically does that ?
>
> I am aware of stfill and xtbalance. But I don't think they do, what I want to do.
>
> regards,
>
> Vinod
> *
> *   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/
>



-- 

Regards
---------------------------
Muhammad Anees
Assistant Professor
COMSATS Institute of Information Technology
Attock 43600, Pakistan
www.aneconomist.com

*
*   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/


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