Announcement

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

  • exporting results after rbiprobit

    Hello,

    How can I export the treatment and marginal effects, rho, and its Wald statistic with significance stars after rbiprobit?

    An example:
    Code:
    webuse class10, clear
    rbiprobit graduate = income i.roommate i.hsgpagrp, endog(program = i.campus i.scholar income i.hsgpagrp)
    rbiprobit tmeffects, tmeffect(ate)
    rbiprobit margdec, dydx(income) effect(total) predict(p11)
    When I run:
    Code:
    eststo tmeffect: rbiprobit tmeffects, tmeffect(ate)
    esttab tmeffect
    or,
    Code:
    eststo meffect: rbiprobit margdec, dydx(income) effect(total) predict(p11)
    esttab meffect

    It gives me the coefficients and not the treatment/marginal effect.

    Thank you.


  • #2
    export to what?

    The last two peices of code merely store the results (using names tmeffect and meffect; you could have easily named them "pink" and "blue"). esttab simply reposts the results you've named. Thus, you get coefficients. The code for tmeffects is not invoked.

    If you want the ATE in esttab, then you need to use estadd

    Comment


    • #3
      Thank you, George.

      Comment


      • #4
        Code:
        clear all
        webuse class10, clear
        eststo e1: qui rbiprobit graduate = income i.roommate i.hsgpagrp, endog(program = i.campus i.scholar income i.hsgpagrp)
        rbiprobit tmeffects, tmeffect(ate)
        *estadd matrix r(table)
        estadd scalar estimate = r(table)[1,1] : e1
        estadd scalar zscore = r(table)[3,1] : e1
        estadd scalar zprob = r(table)[5,1] : e1
        ereturn list
        esttab e1 , stats(N estimate zscore zprob, labels("N" "ATE" "ATE-zstat" "ATE-prob"))

        Comment


        • #5
          Hello George,

          I also want to add Wald statistic of rho with significance stars. I tried this, but I am not able to get the Wald statistic. Also, how can I add significance stars to it?
          Code:
          webuse class10, clear
          rbiprobit graduate = income i.roommate i.hsgpagrp, endog(program = i.campus i.scholar income i.hsgpagrp)
          estadd local Waldstatistic "`:di %5.2f `= e(chi2_c)''"
          eststo tmeffect: rbiprobit tmeffects, tmeffect(ate) post
          estadd scalar Waldstatistic = `Waldstatistic'
          esttab tmeffect, s(N Waldstatistic , label( "Observations" "Wald statistic"))
          Please help.

          Comment


          • #6
            Code:
            webuse class10, clear
            rbiprobit graduate = income i.roommate i.hsgpagrp, endog(program = i.campus i.scholar income i.hsgpagrp)
            local wald = e(chi2_c)
            eststo tmeffect: rbiprobit tmeffects, tmeffect(ate) post
            estadd scalar wald = `wald' : tmeffect
            esttab tmeffect , stats(N wald , label( "Observations" "Wald statistic"))

            Comment


            • #7
              Thank you, George. It works. Could you also show how to add significance stars to the Wald?

              I tried this after visiting other posts on the forum:

              Code:
              webuse class10, clear
              rbiprobit graduate = income i.roommate i.hsgpagrp, endog(program = i.campus i.scholar income i.hsgpagrp)
              local wald = e(chi2_c)
              local pval = 0.0005
              eststo tmeffect: rbiprobit tmeffects, tmeffect(ate) post
              estadd scalar wald = "`= cond(`pval'<0.01,"`:di %5.3f `= `wald'''***")'" : tmeffect
              esttab tmeffect , stats(N wald , label( "Observations" "Wald statistic")
              Last edited by Varsha Vaishnav; 18 Jun 2024, 15:46.

              Comment


              • #8
                Not sure you can. But this gets you the probability.

                Code:
                webuse class10, clear
                rbiprobit graduate = income i.roommate i.hsgpagrp, endog(program = i.campus i.scholar income i.hsgpagrp)
                local wald = e(chi2_c)
                local waldp: di %5.4f 1- chi2(1,`wald')
                eststo tmeffect: rbiprobit tmeffects, tmeffect(ate) post
                estadd scalar wald = `wald' : tmeffect
                estadd local waldp = `waldp' : tmeffect
                esttab tmeffect , stats(N wald waldp, label( "Observations" "Wald statistic" "Wald Prob"))

                Comment


                • #9
                  Thank you, George.

                  Comment


                  • #10
                    This works.

                    Code:
                    webuse class10, clear
                    estimates clear
                    rbiprobit graduate = income i.roommate i.hsgpagrp, endog(program = i.campus i.scholar income i.hsgpagrp)
                    esttab , stats(chi2_c , star(chi2_c))
                    scalar chi2_c = e(chi2_c)
                    local p : di %5.4f r(stats)[2,1]
                    eststo tmeffect: rbiprobit tmeffects, tmeffect(ate) post
                    estadd scalar chi2_c = chi2_c : tmeffect
                    estadd scalar p = `p' : tmeffect
                    esttab tmeffect , stats(N chi2_c , star(chi2_c) label( "Observations" "Wald statistic"))

                    Comment


                    • #11
                      Or

                      Code:
                      webuse class10, clear
                      estimates clear
                      rbiprobit graduate = income i.roommate i.hsgpagrp, endog(program = i.campus i.scholar income i.hsgpagrp)
                      esttab , stats(chi2_c , star(chi2_c))
                      local chi2_c = r(stats)[1,1]
                      local p = r(stats)[2,1]
                      eststo tmeffect: rbiprobit tmeffects, tmeffect(ate) post
                      estadd scalar chi2_c = `chi2_c' : tmeffect
                      estadd scalar p = `p' : tmeffect
                      esttab tmeffect , stats(N chi2_c , star(chi2_c) label( "Observations" "Wald statistic"))

                      Comment


                      • #12
                        Better

                        Code:
                        webuse class10, clear
                        rbiprobit graduate = income i.roommate i.hsgpagrp, endog(program = i.campus i.scholar income i.hsgpagrp)
                        local chi2_c = e(chi2_c)
                        local p = 1- chi2(1,`chi2_c')
                        eststo tmeffect: rbiprobit tmeffects, tmeffect(ate) post
                        estadd scalar chi2_c = `chi2_c' : tmeffect
                        estadd scalar p = `p' : tmeffect
                        esttab tmeffect , stats(N chi2_c, star(chi2_c) label( "Observations" "Wald statistic"))

                        Comment


                        • #13
                          Perfect! Thank you, George.

                          Comment

                          Working...
                          X