Announcement

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

  • PPML/glm with Interaction and dummy varibales

    Dear Stata Users,
    I would like to ask some questions. I am working on international trade data and following Yotov et al., (2016) "An Advanced Guide to Trade Policy Analysis: The Structural Gravity Model"). in the second section of my study, I would like to use "ppml/glm" for disaggregated data with the (structural) gravity model to handle heteroscedasticity (size-adjusted).
    My paper questions account for crises with year dummy and present a comparative study between regions. Thus, I am using the interaction between year dummy and regions. so that I can present which region has positive or negative effects after a crisis. However, ppml method does not allow the Interaction option (var#var) and shows the "factor-variable and time-series operators not allowed". Most importantly, the method drops the dummy variables (omitted because of collinearity).
    So basic equation would be: Trade = β_0 + β_1 GDP_(o, t) + β_2 GDP_(d, t)+β_3 - β_4 Dist +β_5 〖YDmmy〗_(t) + β_6〖CDmmy〗_(d, t) + β_7 〖YDmmy〗_t #〖CDmmy〗_(d, t) +∈
    YDuumy = (2015>=1, otherwise “0”), CDmmy= (country belongs main group “1”, otherwise “0”) as an example.

    * STATA commands to create importer- and exporter-time fixed effects:
    cap egen exp_time = group(country year)
    tabulate exp_time, generate(EXPORTER_TIME_FE)
    cap egen imp_time = group(Jcountry year)
    tabulate imp_time, generate(IMPORTER_TIME_FE)
    cap egen pair = group(country Jcountry)
    * Symmetric country-pair fixed effects
    * Short-cut code valid if none of the pairs has identical distances.
    egen pair_id = group(distcap)
    tabulate pair_id, generate(PAIR_FE)
    * STATA commands to estimate gravity model with the PPML estimator:
    ppml trade EXPORTER_TIME_FE* IMPORTER_TIME_FE* PAIR_FE* GDP gdpo distcap i.dummy_ex2015##i.dmMain, cluster(pair_id)
    * Alternative command: glm
    glm trade EXPORTER_TIME_FE* IMPORTER_TIME_FE* PAIR_FE* GDP gdpo distcap i.dummy_ex2015##i.dmMain, cluster(pair_id) family(poisson) diff iter(30)

    I would like to keep the interaction and dummy variables but I do not know how.
    * Alternative command: poisson
    xtpoisson trade GDP gdpo distcap i.dummy_ex2015##i.dmMain, re
    xtpoisson trade GDP gdpo distcap i.dummy_ex2015##i.dmMain, fe cluster(pair_id)
    would it be the same as ppml/glm?

    I am a new stata user. Could you please guide me on how to deal with this problem? Thank you in advance

    Sincerely yours

    Onur BIYIK
    Last edited by ONUR BIYIK; 17 Sep 2021, 03:53.

  • #2
    let me add
    my solution for that
    * Alternative command: poisson
    xtpoisson trade GDP gdpo distcap i.dummy_ex2015##i.dmMain, re
    xtpoisson trade GDP gdpo distcap i.dummy_ex2015##i.dmMain, fe cluster(pair_id)
    would it be the same as ppml/glm?

    If I create an interaction dummy
    gen Maininterac2015=0
    replace Maininterac2015=1 if dummy_ex2015==1 & dmMain==1
    would it work? what would be a challenge? I have not implied it in regression

    Best

    Onut

    Comment

    Working...
    X