Announcement

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

  • reghdfe and boottest

    Dear Statalist,

    I have a question about reghdfe and boottest commands. I am trying to answer whether people's expectations of a variable are systematically different along observable dimensions, such as some demographic characteristics age and income. The data sample is clustered at state and year levels. So I ran something like
    Code:
    reghdfe forecastsisy  ageisy incomeisy, vce(cluster state year)
    where i stands for individual, s stands for state and y stands for year. However, when I tried to use boottest like
    Code:
    boottest age
    it returns an error "r(198) Doesn't work after reghdfe with absorbed interaction terms." As far as I know, boottest can handle reghdfe with one-way fixed effect. But I didn't include any fixed effects in my model. I am a little confused why I still got this error.

    Plus, if I want to add state and year fixed effects in the model, such as
    Code:
    reghdfe forecastsisy  ageisy incomeisy, a(state year) vce(cluster state year)
    Is there a way I can bootstrap cluster my standard errors?

    I have the latest versions of both reghdfe (6.12.1) and boottest (3.2.3).

    Thank you so much!
    Last edited by Victoria Wong; 30 Aug 2021, 01:12.

  • #2
    I am not aware of how reghdfe and boottest interact, but what about this, does this work?

    Code:
    bootstrap _b, cluster(state year): reghdfe forecastsisy  ageisy incomeisy, a(state year) vce(cluster state year)
    Best wishes

    (Stata 18.0 MP)

    Comment


    • #3
      Hello Felix,

      Thank you for your reply. However, it doesn't seem to work. It returns an error "r(451) repeated time values within panel the most likely cause for this error is misspecifying the cluster(), idcluster(), or group() option".

      Best wishes,
      Vic

      Comment


      • #4
        Originally posted by Felix Bittmann View Post
        I am not aware of how reghdfe and boottest interact, but what about this, does this work?

        Code:
        bootstrap _b, cluster(state year): reghdfe forecastsisy ageisy incomeisy, a(state year) vce(cluster state year)
        Hello Felix,

        Thank you for your reply. However, it doesn't seem to work. It returns an error "r(451) repeated time values within panel the most likely cause for this error is misspecifying the cluster(), idcluster(), or group() option".

        Best wishes,
        Vic

        Comment


        • #5
          Check whether the user written -boottest- does not have an option for two way clustering. I think it has.

          Then estimate your equation without clustering, and impose the clustering at the -boottest- stage.

          Comment


          • #6
            Originally posted by Joro Kolev View Post
            Check whether the user written -boottest- does not have an option for two way clustering. I think it has.

            Then estimate your equation without clustering, and impose the clustering at the -boottest- stage.
            Hi Joro,

            Thank you for your response. Maybe I wasn't so clear. The user written -boottest- can totally handle multi-way clustering. But I think it doesn't work after reghdfe if there is more than one fixed effect specified in absorb(). I was wondering if I could use -boottest- after a regression model with multi fixed effects and clusters.

            Best wishes,
            Vic

            Comment


            • #7
              You are answering your question yourself: if -boottest- cannot handle multiway fixed effects, they you cannot use it if you need multiway fixed effects.

              If boottest does the job with one dimensional fixed effects, you can absorb your high dimensional fixed effect, and try to handle the lower dimensional fixed effects through factor variable notation, e.g., absorb(id) vs i.year.


              Originally posted by Victoria Wong View Post

              Hi Joro,

              Thank you for your response. Maybe I wasn't so clear. The user written -boottest- can totally handle multi-way clustering. But I think it doesn't work after reghdfe if there is more than one fixed effect specified in absorb(). I was wondering if I could use -boottest- after a regression model with multi fixed effects and clusters.

              Best wishes,
              Vic

              Comment


              • #8
                Originally posted by Joro Kolev View Post
                You are answering your question yourself: if -boottest- cannot handle multiway fixed effects, they you cannot use it if you need multiway fixed effects.

                If boottest does the job with one dimensional fixed effects, you can absorb your high dimensional fixed effect, and try to handle the lower dimensional fixed effects through factor variable notation, e.g., absorb(id) vs i.year.



                Thank you Joro, it is now working. It was my fault. Sorry. I think I installed the new versions but didn't restart Stata. That's why even tho I had only one fixed effect, it still returned that error message. The -boottest- command works well after -reghdfe- with one fixed effect. Also, this https://github.com/sergiocorreia/ppmlhdfe/issues/4 helps too.

                Comment

                Working...
                X