Announcement

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

  • Two way fixed effects and marginal effects

    Hello everyone,
    My model is Income inequality i,t = β01NatResit2 NatResi,tDemi,tn Xi,t + λt i + εit
    I run the model using the command reghdfe.
    where NatResi,t Demi,t is interaction term. When I run reghdfe income_inequality natural_resource_rents c.natural_resource_rents#i.democracy globalization ,absorb(ccode year) and
    margins, dydx(natural_resource_rents) at(democracy=(0 1)) the result i have is
    Average marginal effects Number of obs = 3,249 Model VCE : OLS Expression : Linear prediction, predict() dy/dx w.r.t. : natural_resource_rents 1._at : democracy = 0 2._at : democracy = 1 Delta-method dy/dx Std. Err. z P>z [95% Conf. Interval] natural_resource_rents _at 1 . (not estimable) 2 . (not estimable)
    Could you help me calculate marginal effects and then do a marginsplot?
    Thank you very much in advance.





  • #2
    Your model is wrong, to start with. You describe the democracy variable as Demi,t, which impiles that it varies both across countries and over time within countries. That being the case, you need to include uninteracted democracy in the model. (If, in fact this democracy variable is time-invariant, then you can omit it, but in that case it should be denoted Demi without a time subscript.)

    Your -margins- output shows that the effects you are trying to estimate or not identified by the data with this model. There are a number of possible reasons for that, but without seeing the -reghdfe- output itself (including any messages) and a representative example of the data (use -dataex-) it is impossible to discern which is in play here. Please post back with that additional information. Before doing that, however, please read the Forum FAQ, especially #12, for advice about how to present this information in a readable and usable form with the -dataex- command for example data and code delimiters for Stata output.

    If you are running version 17, 16 or a fully updated version 15.1 or 14.2, -dataex- is already part of your official Stata installation. If not, run -ssc install dataex- to get it. Either way, run -help dataex- to read the simple instructions for using it. -dataex- will save you time; it is easier and quicker than typing out tables. It includes complete information about aspects of the data that are often critical to answering your question but cannot be seen from tabular displays or screenshots. It also makes it possible for those who want to help you to create a faithful representation of your example to try out their code, which in turn makes it more likely that their answer will actually work in your data.


    Comment


    • #3
      work1.docx
      Thank you very much for your answer Clyde Schechter.
      reghdfe income_inequality natural_resource_rents natural_resdem globalization resource_taxes muslim ethnic_fractionalization coup lgdp urban_population HCI democracy ,vce(robust) absorb(ccode year)

      Comment


      • #4
        Maria,

        Let me repeat me request from #2 that you read the Forum FAQ, so you can learn about the most effective ways to communicate your data, code, and results. Microsoft Office documents, especially Word documents, can contain active content, including malware. I do not open such documents coming from people I do not know. Many others on this Forum take similar precautions with their computers. I will be happy to review what you have to show, and try to help you, when you post it here in the Forum using -dataex- for example data, and code-delimiters for commands and output.

        Comment

        Working...
        X