Announcement

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

  • questions about fixed effects in gravity model

    Dear sir or madam,

    I'm an undergraduate Economics student and I chose gravity model topic (didn't learned before) for my final year essay. I have some questions of fixed effects.
    My essay is studying impact of WTO accession on one country's exports.

    The simple form of my data is like
    pairid country-origin country-destination year lnexports lndistance WTO(origin) other variables(gdp,RTA,commonlanguage, continguity,etc)
    1 A B 2000
    1 A C 2000
    1 A D 2000
    2 A B 2001
    2 A C 2001
    2 A D 2001
    ..............
    ..............
    My teacher asked me to just do the simple OLS,without considersing PMML.
    My first question is: If I want to include the country pair FE and time FE, is the STATA command like: reg lnexports lndistance WTO(origin) other varibles i.pairid i.year or perhaps xtreg lnexports lndistance WTO(origin) other varibles i.year, fe ??
    Second: Since my country-origin doesn't change (always A), is it correct to use i.pairid?(I feel confused)

    Thank you very much for your support!

    Best,
    Jerry
    Last edited by Jerry Shen; 16 Apr 2021, 10:20.

  • #2
    Dear Joao Santos Silva

    Sorry to bother. Could you please give me a hand?
    Thank you very much.

    Best,
    Jerry

    Comment


    • #3
      Dear Jerry Shen,

      If I understand it correctly, the two commands should give you the same result. Because you only have one origin, using a FE for the pair or destination is the same thing. Note that many of the regressors you are including (e.g., distance) will be dropped because of the fixed effects.

      Best wishes,

      Joao
      PS: It is a shame that your teacher told you not to use PPML; maybe you can use it for extra marks anyway ;-)

      Comment


      • #4
        Dear @Joao Santos Silva,

        Thanks for your precious time. Below are two regression results.
        For the first: Why the p-value of my variable of most interest gatt_o equals 1???
        For the second: the p-value shows that it's also far from statical significance. Since my only origin here is China, I believe this is not consistent with several literature I've reviewed. Is there something wrong?
        Thanks again for your reply! You are really a nice person!

        Best,
        Jerry
        PS: My teacher is kind and I think she just wants me to use the simple OLS for the first draft maybe. I'll try PPML later.

        Click image for larger version

Name:	5555.PNG
Views:	1
Size:	56.1 KB
ID:	1604020

        Click image for larger version

Name:	6666.PNG
Views:	1
Size:	45.7 KB
ID:	1604021

        Comment


        • #5
          Jerry: I think I see the problem. Two of your variables, lngdpo and gatt_o only vary across time (because you only have one original country). These are perfectly collinear with the year dummy. You can't quite know (in my experience) which collinear variables Stata will drop. In the xtreg command, it dropped two of the year dummies, and that's why the coefficient on lndgpo is so different from the reg command. Notice that all coefficients are the same across the two except lndgpo and gatt_o. You can't identify the effects of these variables separately from the year dummies. My recommendation is to drop the lndgpo and gatt_o variables. If you insistent you want coefficients on them, you'll have to drop the year dummies (dropping just two doesn't make sense) and then include a linear time trend. You'll see if you drop lngdpo and gatt_o that the estimates will be identical; at least you should.

          Comment


          • #6
            Jeff Wooldridge

            Dear Jeff,

            Thank you for your reply. Sorry, I need to ask two more questions. Below I attached one paper I looked at(the first figure), which the author studied wto accession on Vietnam's trade.(also only have one origin country).

            Question 1: For the fourth column, why when she include both pair and year FE, it doesn't have gdp of origin. But in mine(second figure), I still have it?
            Question 2: If I don't include both year and pair FE or I only include pair FE, my variable of interest gatt_o are statiscally significant. But when I include both(second figure), it seems it will be far from statistical significance(stata command same as the previous answer). Are there any problems? How should I interpret?

            Looking forward to your reply since my task is urgent. Thanks a million!

            Best,
            Jerry

            Click image for larger version

Name:	111.PNG
Views:	1
Size:	100.5 KB
ID:	1604151
            Click image for larger version

Name:	222.PNG
Views:	1
Size:	33.9 KB
ID:	1604152

            Comment


            • #7
              Hi Jerry,
              I echo Jeff's observation that you have an issue where some of your regressors are collinear with your fixed effects. To remove any doubt, try the following:

              Code:
              reghdfe lnexport lngdpo lngdpd lnDistw gatt_o gatt_d developedeconomies WTOtpartnerdeveloped contig comlang_off fta_wto fta_wto, absorb(pair_id year) cluster(pair_id)
              You may need to install reghdfe in order for this to work. Because reghdfe knows what the fixed effects are (supplied via the "absorb" option), it will drop any regressors that are collinear with your fixed effects.

              Others may disagree but I think you should never use reg or xtreg when your model has multiple fixed effects like this. There is too much potential for this type of issue to occur!

              One other comment I will make that is more germane to the application is that gatt_o as I understand it is likely collinear with your time fixed effect. As Jeff said, you only have the one origin, so any origin-time-specific variables become time-specific only. If I understand correctly, you will need to drop the time fixed effect if what you are really interested in is the effect of gatt_o. If you want to replace the time fixed effect with a linear time trend, as suggested by Jeff, you would put

              Code:
              reghdfe lnexport lngdpo lngdpd lnDistw gatt_o gatt_d developedeconomies WTOtpartnerdeveloped contig comlang_off fta_wto fta_wto year, absorb(pair_id) cluster(pair_id)
              so that "year" is just treated as a regressor.

              Regards,
              Tom
              Last edited by Tom Zylkin; 17 Apr 2021, 15:49.

              Comment


              • #8
                Dear Tom Zylkin

                Thank you for your help. Followed by your suggestions to drop time fixed effect, my result seems strongly significant as several papers which I reviewed.
                My intention to include time FE is to control for any global economic effects such as booms or slowdowns in the global economy. Since gatt_o is collinear with my time FE, how do I formally explain or interpret this in my essay? Could you please give me more suggestions on that?
                Thank you very much again for the support.

                Best,
                Jerry

                Comment


                • #9
                  Hi Jerry,
                  I would be humble about the possibility that your result could be due to global factors that are unaccounted for that independently affect trade. That said, you do control for GDPs of exporter and importer, so that is a plausible control for business cycle effects, at least as far as they are captured through GDPs. However, there are other factors to be aware of, such as exchange rates.
                  Regards,
                  Tom

                  Comment


                  • #10
                    Dear Tom, Tom Zylkin

                    Thanks for your useful and kind reply. I have done the first half part of essay. Now I want to try the PPML estimator and could you please help me with this?
                    1. I know PPML can help to solve heteroskedasticity and zero trade flows. Please look the beginning of my data (graph below). In fact, I don't have zero exports in the full sample, but just some missing data which was neglected in the OLS estimation. According to Gleditsch (2002),80 % of all observations coded as missing do in fact represent zeros. Do I need to change all my missing data to zero before using PPML?

                    2. Sorry, I don't know much about PPML estimator. Could you please help me with the complete command?
                    If I want to first estimate using PPML without fixed effects, how to perform the command? (I suppose ppml?)
                    And if I want to include country-pair and/or year fixed effects, how to type the STATA command (maybe xtpqml?)


                    Looking forward to your reply. Thanks a million!!!!!!!!!!

                    Best,
                    Jerry
                    Click image for larger version

Name:	forum.PNG
Views:	1
Size:	45.4 KB
ID:	1606888

                    Comment


                    • #11
                      Dear Tom, Tom Zylkin

                      Hope you are well. Sorry to @ you again. Could you please help me with the questions above? I have a deadline for submitting my work next week.
                      Thank you very much for your support!

                      Best,
                      Jerry

                      Comment


                      • #12
                        Originally posted by Jerry Shen View Post
                        Dear Tom, Tom Zylkin

                        Thanks for your useful and kind reply. I have done the first half part of essay. Now I want to try the PPML estimator and could you please help me with this?
                        1. I know PPML can help to solve heteroskedasticity and zero trade flows. Please look the beginning of my data (graph below). In fact, I don't have zero exports in the full sample, but just some missing data which was neglected in the OLS estimation. According to Gleditsch (2002),80 % of all observations coded as missing do in fact represent zeros. Do I need to change all my missing data to zero before using PPML?

                        2. Sorry, I don't know much about PPML estimator. Could you please help me with the complete command?
                        If I want to first estimate using PPML without fixed effects, how to perform the command? (I suppose ppml?)
                        And if I want to include country-pair and/or year fixed effects, how to type the STATA command (maybe xtpqml?)


                        Looking forward to your reply. Thanks a million!!!!!!!!!!

                        Best,
                        Jerry
                        [ATTACH=CONFIG]n1606888[/ATTACH]
                        Hi Jerry,

                        Sorry for not getting back to you yesterday. For your first question, you should find out if those observations are likely to be zeroes or if they are missing for some other reason. To use ppmlhdfe with pair and year fixed efffects, it would look like this.

                        HTML Code:
                        ppmlhdfe y x, a(pair year) cluster(pair)
                        where "pair" and "year" are variables that contain IDs for individual pairs and years. To create the pair ID, you can type: "egen pair = group(exporter importer)".

                        If you want to use PPML without fixed effects you can still use ppmlhdfe and there is no reason not to do so.

                        Good luck with your deadline.

                        Regards,
                        Tom

                        Comment


                        • #13
                          Tom Zylkin

                          Dear Tom,

                          Thank you very much for your time and patience.
                          Apologies for any kind of inconvenience caused.

                          Best,
                          Jerry

                          Comment

                          Working...
                          X