Announcement

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

  • Statistical significance stars not appearing for joint significance test for Hausman-Taylor Instrumental Variable estimator in estout

    Hello,

    I am using Stata/BE 17.0.

    I have a set of estimates using the Random Effects estimator and a set of estimates using the Hausman-Taylor IV estimator.

    For each set of estimates I am producing an output table using the estout command. In both output tables, I also include a joint significance test for five variables for which I add the test statistic to the stored regression estimate using the estadd command. The code to obtain the test statistics and the final output tables is:

    Code:
    local variables RE0F RE1F RE2F RE0M RE1M RE2M HT0F HT1F HT2F HT0M HT1M HT2M
    foreach v of local variables {
        estimates restore `v'
        test res_sp10 res_sp20 res_sp30 res_sp40 res_sp50
        estadd scalar chi3 = r(chi2)
    }    
    
    estout RE0F RE1F RE2F RE0M RE1M RE2M, label cells(b(star fmt(3))) keep(res_sp10 res_sp20 res_sp30 res_sp40 res_sp50 IMR) varwidth(20) stats(r2_o N_g chi3, labels("R-Squared" "N" "Chi2-Test: FFM=0") star(chi3)) order(res_sp10 res_sp20 res_sp30 res_sp40 res_sp50 IMR)
    estout HT0F HT1F HT2F HT0M HT1M HT2M, label cells(b(star fmt(3))) keep(res_sp10 res_sp20 res_sp30 res_sp40 res_sp50 IMR) varwidth(20) stats(r2_o N_g chi3, labels("R-Squared" "N" "Chi2-Test: FFM=0") star(chi3)) order(res_sp10 res_sp20 res_sp30 res_sp40 res_sp50 IMR)
    Note that:
    • RE0F RE1F RE2F RE0M RE1M RE2M HT0F HT1F HT2F HT0M HT1M HT2M are the names of the stored regression estimates.
    • res_sp10 res_sp20 res_sp30 res_sp40 res_sp50 are the variables I test joint significance for
    • chi3 is the variable storing the test statistic for each regression
    My problem is that the asterisks which denote the statistical significance of the joint significance test statistic (red box in each picture) do not appear for the Hausman-Taylor output table. I have no problems with the Random Effects output table, also shown below.

    Random Effects table: asterisks are showing for Chi2 test as supposed to.

    Click image for larger version

Name:	Screenshot 2023-03-22 at 17.57.13.png
Views:	1
Size:	71.1 KB
ID:	1706663


    PROBLEM: Hausman Taylor table: asterisks are not showing for unknown reason
    Click image for larger version

Name:	Screenshot 2023-03-22 at 17.54.43.png
Views:	1
Size:	68.1 KB
ID:	1706662

    I'd appreciate any help on this. Please let me know if you need more information regarding what I'm doing.

    Last edited by Patrick Miller; 22 Mar 2023, 12:25.

  • #2

    Try this and see what happens:
    Code:
     estout RE0F RE1F RE2F RE0M RE1M HT0F, label cells(b(star fmt(3))) keep(res_sp10 res_sp20 res_sp30 res_sp40 res_sp50 IMR) varwidth(20) stats(r2_o N_g chi3, labels("R-Squared" "N" "Chi2-Test: FFM=0") star(chi3)) order(res_sp10 res_sp20 res_sp30 res_sp40 res_sp50 IMR) estout RE2M HT1F HT2F HT0M HT1M HT2M, label cells(b(star fmt(3))) keep(res_sp10 res_sp20 res_sp30 res_sp40 res_sp50 IMR) varwidth(20) stats(r2_o N_g chi3, labels("R-Squared" "N" "Chi2-Test: FFM=0") star(chi3)) order(res_sp10 res_sp20 res_sp30 res_sp40 res_sp50 IMR)

    Comment


    • #3
      I tried this and it didn't work. The test statistic for the random effects estimates get asterisks but none of the hausman-taylor estimates do:

      Click image for larger version

Name:	Screenshot 2023-03-23 at 08.37.10.png
Views:	1
Size:	215.0 KB
ID:	1706749

      Click image for larger version

Name:	Screenshot 2023-03-23 at 08.35.16.png
Views:	1
Size:	219.7 KB
ID:	1706750

      Comment


      • #4
        Here's a guess looking at ereturn for xtreg and xthtaylor.

        xtreg: e() includes e(p) for the chi2 of the model.
        xthtaylor: e() does not include e(p) for the chi2 of the model.

        estout looks for e(p) when setting stars.

        Thus, I think the stars on the RE models are not for the "chi3" test but for the model. So you get stars, but the wrong ones. Since no e(p) for xthtaylor, you get no stars.

        I think you need to get r(p) after test and use it to add stars.

        See this thread:
        HTML Code:
        https://www.statalist.org/forums/forum/general-stata-discussion/general/1702782-reporting-multiple-regression-including-lincom-using-foreach-loop-command

        Comment

        Working...
        X