Announcement

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

  • Capturing summary stat with outreg2

    Dear all,

    I want to apply Lewbel (2012)'s heteroscedasticity-based identification approach. I am interested in capturing the summary statistic (specifically the Kleibergen-Paap rk Wald F statistic, p-value of Hansen J statistic, and p-value of Anderson-Rubin Wald test) using outreg2 in Stata. Could anyone help me in this regard? Thank you, and here is an example data and code.

    Code:
    ----------------------- copy starting from the next line -----------------------
    
    
    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input int depth long(northing easting) byte collection
    7620 60840 29240 3
    7627 60840 29840 3
    7633 60840 30200 3
    7636 60840 30350 3
    7642 60840 30650 3
    7645 60840 30800 3
    7657 60840 31280 3
    7666 60840 31640 3
    7669 60840 31730 3
    7677 60840 32000 3
    7685 60840 32270 3
    7698 60840 32720 3
    7710 60840 33080 3
    7723 60840 33500 3
    7724 60840 33530 3
    7732 60840 33770 3
    7733 60840 33800 3
    7746 60840 34190 3
    7756 60840 34520 3
    7768 60840 34880 3
    7772 60840 35030 3
    7777 60840 35195 3
    7778 60840 35240 3
    7791 60840 35720 3
    7795 60840 35840 3
    7796 60840 35900 3
    7813 60840 36680 3
    7814 60840 36740 3
    7820 60840 37040 3
    7821 60840 37100 3
    7824 60840 37280 3
    7835 60840 37940 3
    7837 60840 38024 3
    7840 60840 38210 3
    7842 60840 38300 3
    7847 60840 38600 3
    7849 60840 38660 3
    7852 60840 38840 3
    7866 60840 39476 3
    7869 60840 39650 3
    7870 60840 39680 3
    7872 60840 39800 3
    7872 60840 39830 3
    7875 60840 40040 3
    7875 60840 40100 2
    7871 60840 40784 3
    7863 60840 41240 3
    7859 60840 41420 3
    7858 60840 41450 3
    7850 60840 41780 3
    7833 60840 42320 3
    7829 60840 42440 3
    7819 60840 42740 3
    7817 60840 42800 3
    7809 60840 43010 3
    7782 60840 43700 3
    7781 60840 43730 3
    7770 60840 44000 3
    7762 60840 44180 3
    7761 60840 44198 3
    7759 60840 44240 3
    7742 60840 44660 3
    7740 60840 44690 3
    7723 60840 45080 3
    7705 60840 45500 3
    7698 60840 45680 3
    7674 60840 46250 3
    7663 60840 46520 3
    7654 60840 46760 3
    7646 60840 46940 3
    7646 60840 46955 3
    7622 60840 47600 3
    7611 60840 47900 3
    7607 60840 48020 3
    7600 60840 48200 3
    7590 60840 48500 3
    7580 60840 48800 3
    7562 60840 49400 3
    7558 60840 49520 3
    7556 60840 49610 3
    7638 61410 29240 3
    7644 61410 29840 3
    7649 61410 30200 3
    7651 61410 30350 3
    7657 61410 30650 3
    7661 61410 30800 3
    7673 61410 31280 3
    7682 61410 31640 3
    7685 61410 31730 3
    7693 61410 32000 3
    7701 61410 32270 3
    7714 61410 32720 3
    7725 61410 33080 3
    7739 61410 33500 3
    7740 61410 33530 3
    7748 61410 33770 3
    7749 61410 33800 3
    7762 61410 34190 3
    7773 61410 34520 3
    7784 61410 34880 3
    end
    label values collection type
    label def type 2 "Estimated", modify
    label def type 3 "Interpolated", modify
    xi: ivreg2h depth (northing=) easting collection , cluster (depth) first outreg2 using Table1.doc,replace dec(3) keep(northing) addtext(Other controls, Yes)
    Last edited by Bahre Gebkir; 19 Dec 2024, 06:18.

  • #2
    outreg2 and ivreg2h are from SSC (FAQ Advice #12). See example 9 of the documentation:


    Example 9. Adding r( ) e( ) scalars


    Additional statistics may be added with addstat( ) or addtext( ). Values stored in macros r( ), e( ), or s( ) can be included directly. You can see what values
    are available by typing ereturn list or return list.

    To test the equality of two of the estimated coefficients and report the results in the table, note that test will sometimes return chi-squared, then you would
    instead use addstat(chi-square test, r(chi2)):

    reg mpg foreign weight length
    test foreign length
    outreg2 using myfile, adds(F-test, r(F), Prob > F, `r(p)') replace
    seeout
    To see how these statistics are stored in e(), run

    Code:
    ereturn list
    immediately after executing the ivreg2h command.

    Comment

    Working...
    X