Bookmark and Share

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: Balancing panel data uniquely identified by TWO variables


From   Stas Kolenikov <[email protected]>
To   [email protected]
Subject   Re: st: Balancing panel data uniquely identified by TWO variables
Date   Sat, 6 Nov 2010 23:32:47 -0500

On Sat, Nov 6, 2010 at 9:42 PM, Victor Gauto <[email protected]> wrote:
> I have an unbalanced panel I would like to “fill” out.  I’ve tried
> using the “tsset” and “tsfill, full” commands without getting the
> results I wanted.  As an example, I have 2 companies selling 2
> products in 3 years.  So if my data were complete I should have
> 2X2X3=12 observations to have a balanced panel.  I have fewer
> observations, since some companies have not sold all the products in
> all the years.  For example, I have 7 observations.  I would like to
> fill this gap by including missing observations due to lack of sales
> of certain products, or certain years.

You can try to run a series of -joinby- based on unique values of your
variables, and then -merge- them with the actual data.

-- 
Stas Kolenikov, also found at http://stas.kolenikov.name
Small print: I use this email account for mailing lists only.

*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index