Announcement

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

  • PPML Estimation, CEPII Exporter-time, Importer-time and Country-pair fixed effects, Structural gravity model

    Please read attached picture 1,2,3 and 4 to understand my queries. I will be very grateful for your comments.

    Example 1 of 1:
    I want to run ppml estimator on the data given in Table 1 to get the results as given in Table 2 and Table 3.
    Are the following Stata commands, correct? Total exporting countries are 10 and importing countries are
    200 and years (time periods) are 25. Column 1 (Exporter) and Column 2 (Importer) are Country IDs.

    Step 1
    egen exp_time = group(exporter year)
    quietly tabulate exp_time, generate(EXPORTER_TIME_FE)
    egen imp_time = group(importer year)
    quietly tabulate imp_time, generate(IMPORTER_TIME_FE)
    egen pair_id = group(exporter importer)
    quietly tabulate pair_id, generate(PAIR_FE)

    Step 2: For Table 2 Desired Output
    ppml trade gdp_e gdp_i fta lang, a(i.exporter i.importer) cluster(pair_id)
    or
    ppmlhdfe trade gdp_e gdp_i fta lang, a(i.exporter i.importer) cluster(pair_id)

    Step 2: For Table 3 Results
    ppml trade pta, a(exp_time imp_time pair_id) cluster(pair_id)
    or
    ppmlhdfe trade pta, a(exp_time imp_time pair_id) cluster(pair_id)


    Example 2 of 2: Continuing from Example 1, now I want to check the impact of trade agreement characteristics impact on bilateral trade. Trade agreements are evaluated on three types of characteristics, i.e., depth, flexibility and constraints as given in Table 4. To proceed with the analysis, first, I need to merge the data from Table 4 to Table 1A and am confused about how to do it correctly. Second, I want to check the lag and lead effect of trade agreements characteristics on trade.

    How to merge these with the help of Stata commands correctly?
    I adopted the following approach to merge the data.
    Step 1: Sort Variables
    sort exporter importer year
    by exporter (importer year): gen lag3 = trade[_n-3]
    by exporter (importer year): gen lag5 = trade[_n-5]
    by exporter (importer year): gen lead5 = trade[_n+5]

    Is this the right way to do it?
    After applying the above commands, the exporter, importer and year columns look like this. I am confused about the last three columns how to post data correctly from Table 4 to Table 1A. Option 1, Option 2 or Option 3 or Option is the correct way. Or if there is any other way to deal with it correctly? An fta signed between 2 countries in a specific year (one time event) has been rated with certain scores, how it will be report for the next years in panel data and multilateral agreements?

    Step 2: Get ppml estimations
    ppml trade depth flexibility constraints, a(exp_time imp_time pair_id) cluster(pair_id)
    or
    ppmlhdfe trade depth flexibility constraints, a(exp_time imp_time pair_id) cluster(pair_id)

    Step 3: Get lag and lead estimations
    ppml lag3 depth flexibility constraints, a(exp_time imp_time pair_id) cluster(pair_id)
    ppml lag5 depth flexibility constraints, a(exp_time imp_time pair_id) cluster(pair_id)
    ppml lead5 depth flexibility constraints, a(exp_time imp_time pair_id) cluster(pair_id)
    or
    ppmlhdfe lag3 depth flexibility constraints, a(exp_time imp_time pair_id) cluster(pair_id)
    ppmlhdfe lag5 depth flexibility constraints, a(exp_time imp_time pair_id) cluster(pair_id)
    ppmlhdfe lead5 depth flexibility constraints, a(exp_time imp_time pair_id) cluster(pair_id)


    Click image for larger version

Name:	1.jpg
Views:	1
Size:	349.6 KB
ID:	1747269
    Click image for larger version

Name:	2.jpg
Views:	1
Size:	393.3 KB
ID:	1747270
    Click image for larger version

Name:	3.jpg
Views:	1
Size:	348.5 KB
ID:	1747271
    Click image for larger version

Name:	4.jpg
Views:	1
Size:	145.1 KB
ID:	1747272

  • #2
    Dear Abdul Ghafoor Khan,

    It seems that you are a bit confused about this, so let me try to nudge you in the right direction. You give examples where the ppml command is being used with the option a(), but ppml does not have that option. So, stick to ppmlhdfe and note that with that command you do not need to start by generating the fixed effects (check the examples in the help file). Also, it looks that you want to estimate a structural model with importer-year and exporter-year fixed effects and estimate the coefficients on variables like gdp. That is not possible because gdp will be collinear with the fixed effects and will be dropped.

    Hence, I suggest you try to understand the problem a bit better, and then perhaps ask more focused questions.

    Best wishes,

    Joao

    Comment


    • #3
      Joao Santos Silva Dear Professor, Thank you so much for your guidance. I got some clarity on this. But can you also please comment on the Example 2. I want to check trade agreement characteristics impact on trade. In left table I have panel data like exporter, importer and year followed by the three variables representing a score on agreement characteristics. Suppose an agreement signed between Country A and B in 2005 has received a score of 5, 4, 4. Should I replicate it every time 5,4,4 from 2005 - 2023 for Country A and B in the data sheet. Because an FTA is signed in a specific year and received a one-time score (unlike other indexes that change every year), but the Country pair A and B appear every year e.g. from 1990 - 2023. So should i simply copy the score from 2005 and paste it in front of this pair (Country A and B) till 2023. And what about values before 2005, should I leave it empty or change it to 0.

      Regards

      Comment


      • #4
        Dear Abdul Ghafoor Khan,

        If the scores do not change, yes, you should replicate them for each year after the agreement is signed.

        Best wishes,

        Joao

        Comment

        Working...
        X