Announcement

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

  • How to model intra-EU trade dummy variables for Gravity Model studying EU Membership effect on trade flows

    Hi,

    I am estimating a gravity model using an unbalanced country-pair panel data set, looking at European countries from 1948-2006, with about 48,000 observations. The dataset is the one used in Head et al (2010) “The erosion of colonial trade linkages after independence”. Anyway, I am looking at the EU membership effect, i.e the gains in trade due to EU membership.

    I am struggling to model the intra-EU trade dummys to estimate the EU membership effect. The problem is that European countries joined the EU at multiple dates so that it is difficult to find a single EU membership effect.

    How I have gone about coding it so far, with little success, is by generating multiple intra-EU dummy variables and adding new members when new expansions were created. The following is the code I used. (Also, iso_o represents exporter and iso_d is importer, so that the dummys equal to 1 if both the exporter and importer are EU members).

    * Original Members
    gen intra_EU_1 = (iso_o=="FRA" | iso_o=="DEU" | iso_o=="ITA" | iso_o=="BEL" | iso_o=="NLD" | iso_o=="LUX") & (iso_d=="FRA" | iso_d=="DEU" | iso_d=="ITA" | iso_d=="BEL" | iso_d=="NLD" | iso_d=="LUX")
    replace intra_EU_1 = 0 if year<1964

    *
    * Original Members + First Expansion ( i.e plus Ireland UK Denmark and Greenland)
    gen intra_EU_2 = (iso_o=="FRA" | iso_o=="DEU" | iso_o=="ITA" | iso_o=="BEL" | iso_o=="NLD" | iso_o=="LUX" | iso_o=="IRL" | iso_o=="GBR" | iso_o=="DNK" | iso_o=="GRL") & (iso_d=="FRA" | iso_d=="DEU" | iso_d=="ITA" | iso_d=="BEL" | iso_d=="NLD" | iso_d=="LUX" | iso_d=="IRL" | iso_d=="GBR" | iso_d=="DNK" | iso_d=="GRL")
    replace intra_EU_2 = 0 if year<1973

    *
    * Original Members + First Expansion + Second Expansion (i.e plus Greece)
    gen intra_EU_3 = (iso_o=="FRA" | iso_o=="DEU" | iso_o=="ITA" | iso_o=="BEL" | iso_o=="NLD" | iso_o=="LUX" | iso_o=="IRL" | iso_o=="GBR" | iso_o=="DNK" | iso_o=="GRL" | iso_o=="GRC") & (iso_d=="FRA" | iso_d=="DEU" | iso_d=="ITA" | iso_d=="BEL" | iso_d=="NLD" | iso_d=="LUX" | iso_d=="IRL" | iso_d=="GBR" | iso_d=="DNK" | iso_d=="GRL" | iso_d=="GRC")
    replace intra_EU_3 = 0 if year<1981

    *
    * Original Members + First Expansion + Second Expansion + Third Expansion (i.e plus Portugal and Spain)
    gen intra_EU_4 = (iso_o=="FRA" | iso_o=="DEU" | iso_o=="ITA" | iso_o=="BEL" | iso_o=="NLD" | iso_o=="LUX" | iso_o=="IRL" | iso_o=="GBR" | iso_o=="DNK" | iso_o=="GRL" | iso_o=="GRC" | iso_o=="PRT" | iso_o=="ESP") & (iso_d=="FRA" | iso_d=="DEU" | iso_d=="ITA" | iso_d=="BEL" | iso_d=="NLD" | iso_d=="LUX" | iso_d=="IRL" | iso_d=="GBR" | iso_d=="DNK" | iso_d=="GRL" | iso_d=="GRC" | iso_d=="PRT" | iso_d=="ESP")
    replace intra_EU_4 = 0 if year<1986

    *
    * Final Model with all members upto the fourth enlargement (i.e Plus Austria, Sweden and Finland)
    gen intra_EU_5 = (iso_o=="FRA" | iso_o=="DEU" | iso_o=="ITA" | iso_o=="BEL" | iso_o=="NLD" | iso_o=="LUX" | iso_o=="IRL" | iso_o=="GBR" | iso_o=="DNK" | iso_o=="GRL" | iso_o=="GRC" | iso_o=="PRT" | iso_o=="ESP" | iso_o=="AUT" | iso_o=="SWE" | iso_o=="FIN") & (iso_d=="FRA" | iso_d=="DEU" | iso_d=="ITA" | iso_d=="BEL" | iso_d=="NLD" | iso_d=="LUX" | iso_d=="IRL" | iso_d=="GBR" | iso_d=="DNK" | iso_d=="GRL" | iso_d=="GRC" | iso_d=="PRT" | iso_d=="ESP" |iso_d=="AUT" | iso_d=="SWE" | iso_d=="FIN")
    replace intra_EU_5 = 0 if year<1995

    Using this method, I gather very confusing results. Some of the intra-EU dummys' coefficients are positive and some are negative. Also, many of the results are insignificant.
    I know that studying EU membership has been done many times before, and I was just wondering if anyone could provide me with advice on how to go about generating intra-EU dummy variables.

    Thanks, Amran

  • #2
    Well, I think you are making a mistake in creating a separate indicator for EU membership corresponding to each year in which a country entered. It's certainly not surprising that the results are odd, since in some cases your just adding one or two countries, so these indicators will be almost colinear and give unstable estimates of their effects. Here's what I would do.

    1. I would search the internet for (or find in some other way) a table showing the country codes of each EU member nation and the year in which it joined the EU. (If you can't find one, create it yourself from the information you show above.) Save that data in a Stata data set called years_of_entry. Call the country variable iso_code, and the year of entry entry_year.

    2. Merge that data set into your main data, doing something like this:

    Code:
    rename iso_o iso_code
    merge m:1 iso_code using years_of_entry, keep(master match) nogenerate
    rename iso_code iso_o
    rename entry_year entry_year_o
    
    rename iso_d iso_code
    merge m:1 iso_code using years_of_entry, keep(master match) nogenerate
    rename iso_code iso_d
    rename entry_year entry_year_d
    
    foreach x in o d {
        gen byte EU_member_`x' = (year >= entry_year_`x' & !missing(entry_year_`x'))
    }
    At that point each observation will have two indicators, EU_member_o and EU_member_d indicating whether the _o and _d countries, respectively, were EU members in that observation's year. Note: In the above code, a country is treated as an EU member in the year it enters the EU. If you want to treat it only as an EU member starting the year after antry, change >= to > in the -gen byte EU_member...- command.

    Comment


    • #3
      Hi Clyde,

      Thank you for this. I am running into a problem when running the code you provided above.
      I get the error: "factor variables and time-series operators not allowed r(101);"

      Do you have suggestions on how I may correct this issue?

      Thanks

      Comment


      • #4
        Thank you so much Clyde, I fixed my problem and your method did work. To study intra-EU trade I ran the following code after using your above code.
        gen intra_EU = EU_member_o*EU_member_d

        Another question I have is, if I am trying to study the loss of trade when an EU country trades with a non-EU European country how would I go about modelling that?

        I feel as if this is a very trivial question, but I am a bit confused.

        Would this be the same as the coefficient of either dummy EU_member_o or EU_member_d equaling zero?
        Last edited by Amran Wali; 24 Jun 2016, 02:15.

        Comment


        • #5
          I think the simplest way to generate an indicator for an EU country trading with a non EU country would be:

          Code:
          gen byte EU_with_non_EU = (EU_member_o != EU_member_d)
          Then I would use that indicator in the model.

          Comment


          • #6
            Thank you so much Clyde. You have saved me a lot of time.

            Comment

            Working...
            X