Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | Matteo Pazzona <M.Pazzona@bath.ac.uk> |
To | statalist@hsphsun2.harvard.edu |
Subject | st: Programming the fixed effect transformation in Mata with an unbalanced panel data |
Date | Mon, 20 May 2013 17:16:15 +0100 |
Dear Statalist,I have an unbalanced panel data and I need to program the fixed effect transformation with MATA. The code I am trying to program is the usual ( let's call the matrix for all the panel M):
M = (I(N) # (I(T) - 1/T(ee'))where N stands for unit observations ,T the total number of years, e = (1,1,...,1) is 1xT vector of ones and # is the kronecker product. Given that I have an unbalanced panel data, I have a varying number of years. I am able to program it with balanced panel data but not with unbalanced data. I have checked on the FAQs but I could not find a clear answer to that. Secondly, after having computed the fixed effect transformation I need to delete the last observation for each group. So, if Y is the vector of independent variables , then I want to delete the Tth observation ( last observation) for each group of the matrix MY . Again, since the number of years is not fixed I am not able how to do that.
If you could help me out on this too, it would be very helpful. Thanks in advance! Best, Matteo * * 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/