Announcement

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

  • Quantile regression with fixed effects

    Dear @VCarlo Lazzaro,

    I hope you can help me with quantile regression. I have a panel data of 31 countries and 29 years. I have checked and I have heteroskedasticity among my variables. This is my code:

    Code:
    set seed 12345
    eststo s1: qregpd manEMP lnPop lnPop_sq lngdppc lngdppc_sq fdi remitt foreignaid, id(cnt_enc) fix(year) optimize(mcmc) noisy draws(5000) burn(500) arate(.5) quantile(25)
    I tried to use xtqreg first, but I do not know how to add fixed effects there. I am a bit lost since I do not know if my code is correct or whethr should I go for other command.

    Thanks.
    Best,
    Lucia




  • #2
    Dear Lucia Gracia,

    Please note that qregpd does not estimate a model with fixed effects. As for xtqreg, it automatically includes fixed effects for the ID variable used in xtset; you you want to include fixed effects for a different variable you can use the option i(). Please check the help file for details.

    Best wishes,

    Joao

    Comment


    • #3
      Thanks for your answer Joao Santos Silva,

      I have another question if you do not mind. I have this original code:

      Code:
      xtpcse agrEMP lnPop lnPop_sq lngdppc lngdppc_sq fdi remitt foreignaid i.year i.cnt_enc
      which was okay. Now I was requested to add time dummy trend variables and time-dummy variables interacted with fdi, remitances and foreign aid. And to generate the marginal effect of fdi, remittances and foreign and their confidence intervals. So I created this new code:

      Code:
      gen decade = 10 * floor(year/10)
      
      reg agrEMP lnPop lnPop_sq lngdppc lngdppc_sq fdi remitt foreignaid c.fdi#i.decade c.remitt#i.decade c.foreignaid#i.decade i.cnt_enc, r
      margins, dydx(fdi) over(decade)
      margins, dydx(remitt) over(decade)
      margins, dydx(foreignaid) over(decade)
      However, the results I find now for my variables of interest have different coefficients with different signs. So, I am worried this is not the right approach for what I was requested. Can you help me?

      Best,
      LucĂ­a

      Comment


      • #4
        Sorry, I cannot help with that. Hopefully, someone else will.

        Best wishes,

        Joao

        Comment

        Working...
        X