[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

From |
"Nick Cox" <n.j.cox@durham.ac.uk> |

To |
<statalist@hsphsun2.harvard.edu> |

Subject |
st: RE: Re: distance data missing values |

Date |
Fri, 17 Oct 2008 12:29:13 +0100 |

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 n.j.cox@durham.ac.uk 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/

**Follow-Ups**:**Re: st: RE: Re: distance data missing values***From:*Ermal Hitaj <ermalhitaj@yahoo.com>

**st: RE: RE: Re: distance data missing values***From:*"Nick Cox" <n.j.cox@durham.ac.uk>

**References**:**st: distance data missing values***From:*Ermal Hitaj <ermalhitaj@yahoo.com>

**st: Re: distance data missing values***From:*"Martin Weiss" <martin.weiss1@gmx.de>

- Prev by Date:
**st: RE: Error r(9611)** - Next by Date:
**Re: st: RE: Sorting in a table a list of binomial variables by frequency of apparition in a survey context** - Previous by thread:
**st: Re: distance data missing values** - Next by thread:
**st: RE: RE: Re: distance data missing values** - Index(es):

© Copyright 1996–2014 StataCorp LP | Terms of use | Privacy | Contact us | What's new | Site index |