Announcement

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

  • Fixed Effects models coefficient comparison tests

    Dear All, Please, could anyone suggest which command to test the H0 that two coefficients from two fixed effects models (one only with females and one non-females) are equal?
    Lincom and suest do not work with xtreg or reghdfe.

    Many thanks!!

  • #2
    Can you do it in the conventional way, that is, include in one model not only the time-varying predictor and but also another term for the interaction of sex and that predictor? Something analogous to this, which recovers the sex-related difference in coefficient nicely.
    Code:
    version 18
    
    clear *
    
    // seedem
    set seed 2103971464
    
    quietly set obs 100
    generate byte pid = _n
    generate double pid_u = rnormal()
    generate byte sex = mod(_n, 2)
    
    quietly expand 5
    bysort pid: generate byte tim = _n
    
    generate double out = rnormal(10 + pid_u + sex - tim + sex * tim, 1)
    
    *
    * Begin here
    *
    xtreg out i.sex##c.tim, i(pid) fe
    
    exit

    Comment


    • #3
      Originally posted by Juliana Cunha View Post
      . . . which command to test the H0 that two coefficients . . . are equal?
      Oh, I forgot to add
      Code:
      test c.tim = 1.sex#c.tim
      for the closure.

      Comment


      • #4
        Yup. No need to estimate two models when one will do.

        Comment


        • #5
          I wrote
          Code:
          test c.tim = 1.sex#c.tim
          The two slopes are _b[tim] and _b[tim] + _b[1.sex#c.tim], and so that should have been
          Code:
          test 1.sex#c.tim
          Sorry for the lapse.

          Comment

          Working...
          X