Announcement

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

  • OLS, PPML, xtpoisson, xtqpml

    Hi am running a gravity equation with a large number of countries (i.e. 120 reporter and 120 partner). I would like to run an additional gravity model, but by including a country-pair fixed effect. For my OLS model, I ran:

    Code:
    egen pairid = group(ReporterName PartnerName)
    tab pairid, gen(pair_)
    
    reg lnexport lndist contig comlang_off comcol fta_wto EUtrade Brexit EUBrexit year_* pair_*, robust cluster(distw)
    This, however, does not allow me to run the OLS because of the large number of regressors (120*120), so I have had to drop 40 countries in reporter and 40 countries in partner. Is there another way to do this? and is there a quicker way since this takes a few hours to run? I also have a similar problem with the PPML.

    Code:
    ppml export lndist contig comlang_off comcol fta_wto Brexit EUtrade BrexitEU year_* pair_*, cluster(distw)
    I saw somewhere that xtqpml is adviced to run here. I am pretty sure I am not running it correctly though:

    Code:
    xtpqml export lndist contig comlang_off comcol fta_wto Brexit EUtrade BrexitEU year_*, fe i(pairid) cluster(distw)
    Click image for larger version

Name:	bild.PNG
Views:	1
Size:	13.0 KB
ID:	1494256


    The problem is that it drops variables of interest. Should I cluster this by pairid instead?

    Sum up:
    1) how do I run a quicker version of OLS that takes country pair into consideration?
    2) How do I run a quicker version of PPML correctly?

    Best regards,
    John

  • #2
    Dear John Nilsson,

    1) you should use xtreg;
    2) what you are doing is correct; with pair FE, all the bilateral variables such as distance and contiguity will drop because their effect is absorbed by the FE.

    Best wishes,

    Joao

    Comment


    • #3
      Dear Joao Santos Silva,

      Thank you so much for all your responses!

      You're truly a treasure to this forum!

      Sincerely,
      John

      Comment

      Working...
      X