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]

st: Balanced panel


From   Estrella Gomez <[email protected]>
To   [email protected]
Subject   st: Balanced panel
Date   Thu, 11 Jul 2013 15:47:03 +0200

Dear statalisters

I have a panel that contains exporters, importers and years. Since
some countries do not trade at all, I would like to generate the zero
observations for those cases. The command tsfill, full allows me to do
it for a pair of countries that traded in a given year, but no in the
rest. It generates zero observations for the years in which two
countries did not trade, given that those countries traded in some
year of the sample.

However, I would also like to generate zero flows if two countries did
not trade at all in any year. For instance, in the following case:

t 	exporter	importer	trade
2006	AR	CA	1
2008	AR	CA	1
2006	US	CA	1
2007	US 	CA	1
2008	US	CA	1
2006	US	AR	1
2007	US 	AR	1
2008	US	AR	1
2006	CA	US 	1
2007	CA	US	1
2008	CA	US	1
2006	AT	US 	1
2007	AT	US	1
2008	AT	US	1

tsfill, full would generate:

t 	exporter	importer	trade
2007	AR	CA	.

but I would also need

t 	exporter	importer	trade
2006	AR	AT	.
2007	AR	AT	.
2008	AR	AT	.


Any idea?
Thank you very much,
Estrella
*
*   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/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index