Announcement

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

  • dummy variable trap

    Hello
    Everyone,

    I seek for your guidance: how to write codes for a panel data model which includes 4 dummy variables?

    I wrote some codes for my panel data model to explore what are the determinants of inward foreign direct investment in China by considering investing/home countries factors from 2003 to 2016. The number of countries is 141.

    In my baseline model, I only have the financial crisis as a dummy variable.

    For my robust tests, I plan to add economic associations as control variables, namely APEC, G_20, ASEAN. Thus, in total, I will have 4 dummy variables in model 2.

    Could you please give me some suggestion for my codes? My professor said that if we have 3 or more dummies in a model, we can't add constant value in model otherwise we will face dummy variable trap. I'm now facing this issue as proved by Stata. But I'm just a beginner of Stata, I doubt whether I wrote the codes correctly or not.

    ***Difference and System GMM - using xtabond2
    *_________________________________________________ ______________________________

    xtabond2 lifdic l.lifdic lgdp lgdppc ltradepc exchrate inflation ldistance tertiary internet crisis APEC G_20 ASEAN, gmm(l.lifdic, lag(2 2)) iv(lgdp lgdppc ltradepc exchrate inflation ldistance tertiary internet) robust nolevel twostep
    eststo dif1

    xtabond2 lifdic l.lifdic lgdp lgdppc ltradepc exchrate inflation ldistance tertiary internet crisis APEC G_20 ASEAN, gmm(l.lifdic, lag(2 2)) iv(lgdp lgdppc ltradepc exchrate inflation ldistance tertiary internet) robust twostep
    eststo sys1

    Thanks very much for your time and help. May you always be blessed.




  • #2
    You'll increase your chances of a useful answer by following the FAQ on asking questions - provide Stata code in code delimiters, readable Stata output, and sample data using dataex.

    Your adviser is simply wrong. You can have any number of dummies in the model as long as they don't add up to the constant (1) for all observations (the most common problem) or they don't add up to any of the other dummies or continuous variables. But it may be that you do have dummies that add to one - you need to omit one category in each grouping. This will easier if you use factor variable notation - i.APEC etc.

    If I were worrying about dummy variable traps, I'd start with a simpler estimator than xtabond2. Make use you don't have the problem in regression before moving to xtabond2. xtabond2 adds a substantial additional level of complexity. If you're using a recent version of Stata, you might consider Stata's versions (xtabond, etc.). You might also consider xtdpdml (user written).

    Comment


    • #3
      Thanks very much dear Phil!

      Comment

      Working...
      X