Announcement

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

  • ppmlhdfe/ols gravity model regressions (language parameters)

    Dear gravity-experts,
    Dear stata-community,

    in the context of my thesis i am investigating the change of linguistic coefficients in the classical gravity model over time.
    The following regressions all provide an R2 > 0.84 and provide significant results for the investigated language parameters.
    I am now wondering if I have included the right control variables (OLS and PPML) and applied the fixed effects correctly.
    Also, I am not sure if the ppmlhdfe regression has the correct syntax (stata does not give any error message so far).


    variables
    exporter: country a
    importer: country b
    pair_id: has the same value whether ARG trades with GER or GER with ARG, indentifies the country pairs
    year: reaching observations from 1986-2006
    trade: tradeflows between exporter and importer
    DIST: distance between the countries
    CNTG: countries that share a common border
    LANG: common official language, binary
    col: binary measure of common official language
    cnl: continuous index in [0, 1] reflecting the likelihood that two people selected at random from populations i and j will speak the same native language
    lp: continuous index in [0, 1] measuring how similar the languages spoken are
    cl: continuous index in [0, 1] computed as the simple average of col cnl and lp


    I would be very pleased about a short feedback.
    regards
    Marvin


    Code:
     use "C:\Users\marvin.haas\Desktop\Bachelor Regression\merged_dataset1.dta"
    
    ssc install ppml
    ssc install ftools
    ssc install reghdfe
    ssc install ppmlhdfe
    
    keep if year == 1986 | year == 1990 | year == 1994 | year == 1998 | year == 2002 | year == 2006
    
    generate ln_DIST = ln(DIST)
    generate ln_trade = ln(trade)
    
    forvalues i = 1986(1)2006{
    generate LANG_`i' = LANG if year == `i'
    replace LANG_`i' = 0 if LANG_`i' == .
    }
    
    forvalues i = 1986(1)2006{
    generate cnl_`i' = cnl if year == `i'
    replace cnl_`i' = 0 if cnl_`i' == .
    }
    
    forvalues i = 1986(1)2006{
    generate lp_`i' = lp if year == `i'
    replace lp_`i' = 0 if lp_`i' == .
    }
    
    egen exp_time = group(exporter year)
    quietly tabulate exp_time, gen(EXPORTER_TIME_FE)
    
    egen imp_time = group(importer year)
    quietly tabulate imp_time, gen(IMPORTER_TIME_FE)
    
    *OLS regressions
    regress ln_trade ln_DIST EXPORTER_TIME_FE* IMPORTER_TIME_FE* LANG_1986 LANG_1990 LANG_1994 LANG_1998 LANG_2002 LANG_2006 CNTG CLNY if exporter != importer, cluster(pair_id)
    
    regress ln_trade ln_DIST EXPORTER_TIME_FE* IMPORTER_TIME_FE* cnl_1986 cnl_1990 cnl_1994 cnl_1998 cnl_2002 cnl_2006 CNTG CLNY LANG if exporter != importer, cluster(pair_id)
    
    regress ln_trade ln_DIST EXPORTER_TIME_FE* IMPORTER_TIME_FE* lp_1986 lp_1990 lp_1994 lp_1998 lp_2002 lp_2006 CNTG CLNY LANG if exporter != importer, cluster(pair_id)
    
    *Poisson pseudo maximum likelihood regressions
    ppmlhdfe trade ln_DIST LANG_1986 LANG_1990 LANG_1994 LANG_1998 LANG_2002 LANG_2006 CLNY, absorb(exp_time imp_time) d
    
    ppmlhdfe trade ln_DIST cnl_1986 cnl_1990 cnl_1994 cnl_1998 cnl_2002 cnl_2006 CLNY CNTG LANG, absorb(exp_time imp_time) d
    
    ppmlhdfe trade ln_DIST lp_1986 lp_1990 lp_1994 lp_1998 lp_2002 lp_2006 CLNY CNTG LANG, absorb(exp_time imp_time) d 
    Last edited by Marvin Haas; 12 Jul 2022, 11:55.

  • #2
    Dear Marvin Haas,

    It looks generally OK to me, but note that the R2 of the OLS and PPML are no comparable because they have different dependent variables (the OLS results are not relevant anyway). Not also that if you really want to estimate the model in logs, it is much faster to use reghdfe that regress.

    Best wishes,

    Joao

    Comment


    • #3
      Dear Joao Santos Silva,
      the OLS Regressions deliver plausible results.
      However, the ppml regression 4 yields results that are difficult to interpret. You would expect the increasing influence of the lingua franca, english, to decrease the common-official-language effect on trade flows.
      the partially significant regression 4 comes to the opposite conclusion.
      Again, regressions 5 and 6 run in the expected direction that linguistic similarities over time (1986-2006) have less impact on trade flows due to a global language that everyone has agreed on, potentially English.
      Did I use the wrong control variables or what is my error?

      thanks in advance
      Marvin

      1.
      Code:
       regress ln_trade ln_DIST EXPORTER_TIME_FE* IMPORTER_TIME_FE* LANG_1986 LANG_1990 LANG_1994 LANG_1998 LANG_2002 LANG_2006 CNTG CLNY if exporter != importer, cluster(pair_id) 
      Click image for larger version

Name:	regression 1.PNG
Views:	1
Size:	70.7 KB
ID:	1673329



      3.
      Code:
       regress ln_trade ln_DIST EXPORTER_TIME_FE* IMPORTER_TIME_FE* lp_1986 lp_1990 lp_1994 lp_1998 lp_2002 lp_2006 CNTG CLNY LANG if exporter != importer, cluster(pair_id) 
      Click image for larger version

Name:	regression 3.PNG
Views:	1
Size:	75.4 KB
ID:	1673330

      PPML Regressions
      4.
      Code:
       ppmlhdfe trade  ln_DIST CNTG CLNY  LANG_1986 LANG_1990 LANG_1994 LANG_1998 LANG_2002 LANG_2006, absorb(exp_time imp_time) d
      Click image for larger version

Name:	regression 4.PNG
Views:	2
Size:	144.0 KB
ID:	1673332


      5.
      Code:
       ppmlhdfe trade ln_DIST cnl_1986 cnl_1990 cnl_1994 cnl_1998 cnl_2002 cnl_2006 CLNY CNTG LANG, absorb(exp_time imp_time) d
      Click image for larger version

Name:	regression 5.PNG
Views:	2
Size:	125.0 KB
ID:	1673334


      6.
      Code:
       ppmlhdfe trade ln_DIST lp_1986 lp_1990 lp_1994 lp_1998 lp_2002 lp_2006 CLNY CNTG LANG, absorb(exp_time imp_time) d  
      Click image for larger version

Name:	regression 6.PNG
Views:	2
Size:	124.6 KB
ID:	1673336


      Attached Files

      Comment


      • #4
        Dear Marvin Haas,

        We know that OLS can be badly biased in this context, so do not trust it even if it gives you results you like. As for the difference, are you forgetting to exclude intra-national trade in PPML?

        Best wishes,

        Joao

        Comment

        Working...
        X