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:
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:
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
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))
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))
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
Comment