Announcement

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

  • How to esttab the r-square from the first stage using ivreghdfe?

    Hi,

    I want to export statistics from the first stage. By running the following code:

    ivreghdfe y (x = z), a(id year) cl(id year id_year) first savefirst savefprefix(s1)
    estadd scalar widstat1 = `e(widstat)': s1x
    estadd scalar cdf1 = `e(cdf)': s1x
    estadd scalar r2_a1 = `e(r2_a)': s1x
    esttab s1x est1 using iv.tex, replace f b(3) se(3) ar2(3) label star(* 0.10 ** 0.05 *** 0.01) booktabs alignment(D{.}{.}{-1}) stats(widstat1 cdf1 N r2_a1 r2_a, labels("KP Wald F" "$\R^2$" "CD Wald F" "Obs. #" "$\R^2$")) sfmt(3)

    I got the r2_a1 with the same number of the r-square from the second stage. How to get the r-square from the first stage?

    Many thanks,
    Linghui

  • #2
    A correction:

    estadd scalar cdf2 = e(cdf)

    Comment


    • #3
      Sorry, it seems that the original is correct.

      Comment


      • #4
        estout and ivreghdfe are from SSC, as you are asked to explain (FAQ Advice #12). See #6: https://www.statalist.org/forums/for...-stage-outcome

        Comment


        • #5
          Thank you very much, Andrew Andrew Musau!

          Comment

          Working...
          X