Announcement

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

  • Testing Equality of Coefficients across Two Regressions

    Dear all,
    I am trying to conduct a statistical test whether the coefficients from two second-stage regressions are significantly different from each other.
    My two regressions looks like:
    Code:
    ivreghdfe DISP  log_ME  (h_diffs =test lngdp epu_state) if log_ME>=r(p50), a(cusip st year) cluster(st_year)
    ivreghdfe DISP  log_ME  (h_diffs =test lngdp epu_state) if log_ME<r(p50), a(cusip st year) cluster(st_year)
    I was trying to use the following steps:
    Code:
    ivreghdfe DISP  log_ME  (h_diffs =test lngdp epu_state) if log_ME>=r(p50), a(cusip st year) cluster(st_year)
    estimates store cequalzero
    ivreghdfe DISP  log_ME  (h_diffs =test lngdp epu_state) if log_ME<r(p50), a(cusip st year) cluster(st_year)
    estimates store cequalone
    suest cequalzero cequalone
    From the last step, I got the error message saying that
    cequalzero was estimated with cluster(st_year).
    re-estimate without the cluster() option, and
    specify the cluster() option with suest.
    Can anyone inform me how to correct my code? Thank you so much!
    Last edited by james xu; 20 Sep 2024, 20:58.

  • #2
    Originally posted by james xu View Post
    Can anyone inform me how to correct my code?
    Well, given the error message, maybe try this (in red) for starters.
    Code:
    ivreghdfe DISP log_ME (h_diffs =test lngdp epu_state) if log_ME>=r(p50), a(cusip st year) // cluster(st_year)
    estimates store cequalzero
    ivreghdfe DISP log_ME (h_diffs =test lngdp epu_state) if log_ME<r(p50), a(cusip st year) // cluster(st_year)
    estimates store cequalone
    suest cequalzero cequalone, vce(cluster st_year))

    Comment


    • #3
      Originally posted by Joseph Coveney View Post
      Well, given the error message, maybe try this (in red) for starters.
      Code:
      ivreghdfe DISP log_ME (h_diffs =test lngdp epu_state) if log_ME>=r(p50), a(cusip st year) // cluster(st_year)
      estimates store cequalzero
      ivreghdfe DISP log_ME (h_diffs =test lngdp epu_state) if log_ME<r(p50), a(cusip st year) // cluster(st_year)
      estimates store cequalone
      suest cequalzero cequalone, vce(cluster st_year))
      Hello Joseph,
      Thank you for your advice. From my understanding, you only clustering the SE for the suest command in the last line, correct? However, if I do so, I get a new error message saying
      unable to generate scores for model cequalzero
      suest requires that predict allow the score option
      What could be wrong with this error message? Thank you

      Comment


      • #4
        Originally posted by james xu View Post
        . . . you only clustering the SE for the suest command in the last line, correct?
        Yes. That is what the error message and the help file instruct.

        I get a new error message . . . What could be wrong with this error message?
        It seems that the user-written command ivreghdfe doesn't make the scores available as required and as stated in the help file for suest. But I am completely unfamiliar with ivreghdfe and you might want to take this up with the command's author.

        Comment


        • #5
          You can look at this: https://www.statalist.org/forums/for...ferent-samples. But with ivreghdfe (from https://github.com/sergiocorreia/ivreghdfe), you'd need to interact the fixed effects as well.

          Comment


          • #6
            Originally posted by Andrew Musau View Post
            You can look at this: https://www.statalist.org/forums/for...ferent-samples. But with ivreghdfe (from https://github.com/sergiocorreia/ivreghdfe), you'd need to interact the fixed effects as well.
            Hi Andrew,
            Thanks for your response. May I ask what you mean by
            interact the fixed effects

            Comment


            • #7
              Originally posted by james xu View Post

              May I ask what you mean by
              interact the fixed effects


              Code:
              gen group= log_ME>=r(p50)
              ivreghdfe ..., a(0.group#(cusip st year) 1.group#(cusip  st year)) ...

              Comment

              Working...
              X