Ermal Hitaj <[email protected]>:
Maybe swap names and -joinby- like so:
clear
input Exporter Importer Distance
1 2 1000
2 1 .
end
ren Exporter i
ren Importer e
tempfile other
save `other'
ren e im
ren i e
ren im i
ren Distance d
joinby e i using `other'
g dist=max(Distance,d)
li
On Thu, Oct 16, 2008 at 4:28 PM, Ermal Hitaj <[email protected]> wrote:
> Hi,
>
> I wonder whether somebody could help with the following:
> 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).
>
> Thanks,
> E.
*
* 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/