Announcement

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

  • HELP! reghdfe errors: technique not found in class FixedEffects

    I am new to Stata and want to apply IPTW-DID method.

    Fistly, I use 'reghdfe' but stata reports the errors message: technique not found in class FixedEffects

    Code:
    reghdfe y x [aw=weight], absorb(fe1 fe2) vce(cluster id)
    technique not found in class FixedEffects
    r(3000);
    I don't know what's the problem. I tried to check theversion of 'reghdfe' in my Stata. This is the last version.

    And then I tried to use 'xtreg' to achieve this weighted regression.

    Code:
    xtreg y x i.yearindustry i.yearprovince [aw=weight],fe
    weights not allowed
    r(101);
    I can't understand the errors messages 'weights not allowed'.....

    Because I only have 1224 observations and I also have tired only to control year-fixed effect and firm-fixed effect. But the stata also reports the same error message...

    Thanks for your advice.

  • #2
    Are the weights invariant within each panel?

    Comment


    • #3
      Wang:
      welcome to this forum.
      Two trivial comments:
      1) be sure that your -weight- variable is actually named -weight-;
      2) as Jared helpfully pointed out, weights should be constant within panels.
      However, if that were not the case, you should have received an explicit message from Stata, llike in the following toy-example:
      Code:
      . use "https://www.stata-press.com/data/r17/nlswork.dta"
      (National Longitudinal Survey of Young Women, 14-24 years old in 1968)
      
      . xtreg ln_wage age i.year i.c_city [aw=hours ],fe
      weight must be constant within idcode
      r(199);
      As far as the community-contributed module (as you're kindly requested to mention it for reasons well explained in the FAQ. Thanks) -reghdfe- outcome is concerned, you may want to take a look at the following thread: https://www.statalist.org/forums/for...ects-undefined
      Kind regards,
      Carlo
      (StataNow 18.5)

      Comment


      • #4
        Originally posted by Jared Greathouse View Post
        Are the weights invariant within each panel?
        Thanks for your kind.
        Do you mean there will be only one wight within the same id?Right?

        Comment


        • #5
          Originally posted by Carlo Lazzaro View Post
          Wang:
          welcome to this forum.
          Two trivial comments:
          1) be sure that your -weight- variable is actually named -weight-;
          2) as Jared helpfully pointed out, weights should be constant within panels.
          However, if that were not the case, you should have received an explicit message from Stata, llike in the following toy-example:
          Code:
          . use "https://www.stata-press.com/data/r17/nlswork.dta"
          (National Longitudinal Survey of Young Women, 14-24 years old in 1968)
          
          . xtreg ln_wage age i.year i.c_city [aw=hours ],fe
          weight must be constant within idcode
          r(199);
          As far as the community-contributed module (as you're kindly requested to mention it for reasons well explained in the FAQ. Thanks) -reghdfe- outcome is concerned, you may want to take a look at the following thread: https://www.statalist.org/forums/for...ects-undefined
          Thank you so much!!!

          I tried my best to understand your words.

          1) Do you mean maybe I input a wrong weight name in stata?
          2) There is an equal weight within the same id in panel data. Right? And I have tried it and the stata still told me that technique not found in class FixedEffects.

          Code:
           reghdfe lnco2intensity did [aw=ipw],absorb(year province_code) 
          > vce(cluster id)
          technique not found in class FixedEffects
          r(3000);
          Then I followed the post that you shared with me. Stata sent the errors messages to me.

          Code:
          reghdfe, compile
          last estimates not found
          r(301);
          Anyway thank you very very very much!

          Comment


          • #6
            Wang:
            1) your interpretation is correct;
            2) check that you have the very last version of the community-contributed module -reghdfe-.
            Kind regards,
            Carlo
            (StataNow 18.5)

            Comment


            • #7
              Originally posted by Carlo Lazzaro View Post
              Wang:
              1) your interpretation is correct;
              2) check that you have the very last version of the community-contributed module -reghdfe-.
              Thank you so much.How kind you are!
              Today, after I restarted my stata, I could run it. : )

              Comment

              Working...
              X