Announcement

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

  • Problem saving first-stage F-statistic using -outreg2- after -xtivreg2-

    Dear Statalisters, I have a problem saving with -outreg2- the F-statistic of the first-stage regression when using -xtivreg2-. I can save the basic regression output (excluding the F-statistic) using this code:
    Code:
    xtivreg2 Bottom20 (prot1600Xpost1517 = distwittXpost1517) y_*, first savefirst fe i(IDlocality) cluster(IDlocality)
    est restore _xtivreg2_prot1600Xpost1517
    outreg2 using "$path/Outreg2 outputs/tab_IV_1stage", stats(coef se) paren(se) bdec(3) nocons r2 /* 
    */tex(pretty) replace ctitle(First) keep(distwittXpost1517) addstat(Dep. var. mean, e(g_avg))
    My problem arises when I also want to save the F-statistic and add -addstat(F-stat, `fstat)- or -addstat(F-stat, e(rkf))- to the last line of code:
    Code:
    xtivreg2 Bottom20 (prot1600Xpost1517 = distwittXpost1517) y_*, first savefirst fe i(IDlocality) cluster(IDlocality)
    est restore _xtivreg2_prot1600Xpost1517
    outreg2 using "$path/Outreg2 outputs/tab_IV_1stage", stats(coef se) paren(se) bdec(3) nocons r2 /* 
    */tex(pretty) replace ctitle(First) keep(distwittXpost1517) addstat(F-stat, e(rkf), Dep. var. Mean, e(g_avg))
    Then I get an error message "invalid syntax", saying that I should "check eret list for the existence of e(rkf)". I have checked -eret list- and in fact there seems to be not F-statistic available to save. It seems implausible to me that there is no way to get the F-statistic using -outreg2- after -xtivreg2-. I am sure there is a solution and I would be very glad if you had any suggestions.

    Many thanks,

    Felix

    PS. I am aware of a similar discussion (https://www.statalist.org/forums/for...eg2-by-outreg2), but my problem is slightly different as I am just struggling to export the first-stage F-stat

  • #2
    Hi Felix,

    I am facing a similar problem. I would like to report the F-statistic of the first stage result post xtivreg2. If you were able to find a solution would you please share it with me?

    Many thanks in advance.

    Jala

    Comment


    • #3
      If interested, see #5: https://www.statalist.org/forums/for...-2sls-xtivreg2

      Comment

      Working...
      X