In that spirit:
I take that the only issue is filling in gaps for pairs of trading
partners, i.e. the distance between A and B is necessarily the same as
the distance between A and B.
Then I don't see any need for a file fandango:
gen first = cond(Exporter < Importer, Exporter, Importer)
gen second = cond(Exporter < Importer, Importer, Exporter)
egen pairs = group(first second)
bysort pairs (distance) : replace distance = distance[1] if
missing(distance)
Nick
[email protected]
Martin Weiss
This question is quite close to:
http://www.stata.com/statalist/archive/2008-10/msg00578.html
Might want to try your luck there...
Ermal Hitaj
> I have trade distance data in a long form. I have missing values as
> follows.
>
> Exporter Importer Distance
> A B 1000km
> B A .
>
> I need to substitute the missing values with the distance value from
the
> case where country A is the exporter and B is the importer.
> Obviosly, there's a lot of countries (and a lot of products).
*
* 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/