Announcement

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

  • xtreg and areg, time-variant weights, instrument variable

    Hi everyone, in my empirical analysis, I firstly use areg to do the regressions as below:

    areg dif_wage dif_output x1 x2 x3 x4 if (year==2006|year == 2004|year == 2002) [aweight=pop], absorb(province_year) cluster(province)

    areg dif_wage dif_output x1 x2 x3 x4 i.province_year if (year==2006|year == 2004|year == 2002) [aweight=pop], absorb(city) cluster(province)


    where the weighted variable pop is the city's population which changes yearly; dif_frac_PE_output is the main independent variable, x1-x4 are other control variables

    The regression results are shown as attachments.

    My next step is to use the variable dif_tariff as the instrumental variable for dif_output, but the command areg can't do the instrumental variable regression. It seems that I should do the IV with the command xtreg, but xtreg can't use the time-varied variable population as the regression weight.

    So how can I do the instrumental variable with the time-varied population as regression weight in the panel data model?
    Attached Files
    Last edited by Jason Su; 18 Jan 2021, 08:56.

  • #2
    Check whether you cannot do what you want to do with the user contributed -reghdfe-.

    Code:
    findit reghdfe
    and then follow the instructions to install.

    Comment


    • #3
      Originally posted by Joro Kolev View Post
      Check whether you cannot do what you want to do with the user contributed -reghdfe-.

      Code:
      findit reghdfe
      and then follow the instructions to install.
      Hey, Joro, thanks for your reply. As I know, reghdfe is used for high-dimension fixed effects and I'm not sure whether it would apply to my case. But I would check the help file of reghdfe as you suggested.

      When I check other Q&A, others suggest that xtivreg2 may solve my problem because it allows both IV and the time-varied variable as regression weight. Do you agree with that?

      Comment


      • #4
        Yes, of course, Jason. If -xtivreg2- accepts time varying weights, it can do the job.

        -reghdfe- can perform IV regression as well.

        My intuition is that -xt- commands might not accept time varying weights, mimicking the behaviour of commands that are written by Stata Corp, while "absorb" commands do accept time varying weights.


        Originally posted by Jason Su View Post

        Hey, Joro, thanks for your reply. As I know, reghdfe is used for high-dimension fixed effects and I'm not sure whether it would apply to my case. But I would check the help file of reghdfe as you suggested.

        When I check other Q&A, others suggest that xtivreg2 may solve my problem because it allows both IV and the time-varied variable as regression weight. Do you agree with that?

        Comment


        • #5
          Originally posted by Joro Kolev View Post
          Yes, of course, Jason. If -xtivreg2- accepts time varying weights, it can do the job.

          -reghdfe- can perform IV regression as well.

          My intuition is that -xt- commands might not accept time varying weights, mimicking the behaviour of commands that are written by Stata Corp, while "absorb" commands do accept time varying weights.



          Good, I would check both xtivreg2 and reghdfe. Thanks for your suggestion and I would let you know if I make the progress, Joro.

          Comment

          Working...
          X