Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Home and host country Fixed Effects

    Dear Statalisters,
    I'm working on the impact of FDI flows on institutional distance between countries. In my Dataset the ID is country pairs(i have 635 country pairs numbered from 1 to 635) over 12 years. I'm using the gravity model of trade. In my FE estimation i have to account for home and host country effects (using the i. method), however i don't have a numeric identifier for home and host country, can you please tell me how to generate a numeric identifier for home and host country (should i assign random numbers or is there a specific rule to follow?). Thank you very much in advance.

  • #2
    Welcome to the list Bassem,

    i don't have a numeric identifier for home and host country
    Very easy to solve, assuming you have string variables (country names or iso abbrevations) for each country.
    It would be even easier if the home country variable and host country variable are encoded the same way (full country names for both in the same language, or alpha iso3 for both).

    Then simply do :

    Code:
    encode host_country,gen(host_contry_code)
    encode home_country,gen(home_country_code)
    feel free to choose your own variable names

    However, you said your fixed effects are around country pairs, so the easiest way is not to create numeric identifier for home and host country (although I advice you to create those variables as they can always be useful)

    You could simply use the egen group command.
    Code:
    egen cpair_code =group(home_country host_country)
    Best,
    Charlie

    Comment


    • #3
      Thank you very much Charlie Joyez

      Comment

      Working...
      X