Announcement

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

  • Display Shea partial R2 in a table

    Dear all, I want to display a Shea partial R2 after running an ivreg2 on Stata 15. But in my table, the stats doesn't display
    Code:
      eststo IV2_Table4 : 
           quietly ivreg2 gdpg 
           lgdp (eda edapolicy eda2policy = lpop arms_1 egypt frz centam 
           arms_pol lgdp_pol lpop_pol lgdp2_pol lpop2_pol) 
           assas m2_1 icrge ssa easia policy 
           ethnfassas year2-year7, first endog(eda edapolicy eda2policy)
    mat first = e(first)
    scalar shea2=first[2,1]
    estadd scalar partr2_2=shea2
    scalar shea3=first[2,2]
    scalar shea4=first[2,3]
    estadd scalar partr2_3=shea3
    estadd scalar partr2_4=shea4
    esttab IV2_Table4, 
             label legend  
             cells("b(fmt(2) star)" se(par fmt(2))) 
             varwidth(35) modelwidth(15 10)  
             mtitles("2SLS") 
             stats(N r2 prs prs1 partr2_4 pr3, 
             fmt(%9.0f %9.2f %9.3f %9.3f %9.3f %9.3f) 
             labels("Observations" "R2" "Shea partial R2 Aid/GDP" "Shea partial R2 (Aid/GDP)xpolicy" 
             "Shea partial R2 (Aid/GDP)xpolicy" "Hausman test")) 
             title("TABLE 4—GROWTH REGRESSIONS: USING ALL COUNTRIES AND THE POLICY INDEX") 
             drop(year2 year3 year4 year5 year6 year7 _cons)
    Thank you for your help

  • #2
    Can you post the Stata output after you run the estadd commands?

    Comment


    • #3
      Please find attached the output of esttab. Thank you for your help
      Attached Files

      Comment


      • #4
        Not the table, I mean the Stata output up to here

        Code:
        .
        .
        .
        estadd scalar partr2_4=shea4

        Comment


        • #5
          Sorry for my last post. Here you are
          Attached Files

          Comment


          • #6
            Great! Try adding eststo: in front of the scalar commands and see if it solves it

            Code:
            eststo: scalar shea2=first[2,1]
            estadd scalar partr2_2=shea2
            eststo: scalar shea3=first[2,2]
            eststo: scalar shea4=first[2,3]

            Comment


            • #7
              Sorry but it's not working

              Comment


              • #8
                stats(N r2 prs prs1 partr2_4 pr3

                You need to define the scalars "prs" "prs1" and "pr3". N and r2 are defaults, and you have defined partr2_4, so these three statistics should show on your table.

                Comment

                Working...
                X