Announcement

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

  • Save to excel multiple tests using eststo and esttab

    Hello,
    I'm trying to save to excel multiple tests using eststo and esttab.
    It works well when i run only one test, for example:

    reg a b c d e
    test b=c
    eststo, add (p_diff r(p))
    esttab using regional.csv, b(4) t(2) ar2(3) scalars (p_diff N) ....

    The problem is when I include multiple tests, for example

    reg a b c d e i.date i.geographical_focus i.country
    test b=c
    test d=e
    test c=d
    eststo, add (p_diff r(p))
    esttab using regional.csv, b(4) t(2) ar2(3) scalars (p_diff N) ....

    In this case stata only saves the last test.

    I would appreciate if some one could help me out
    Antonio

  • #2
    Code:
    reg a b c d e i.date i.geographical_focus i.country
    test b=c
    eststo, add (p_diffbc r(p))
    test d=e
    eststo, add (p_diffde r(p))
    test c=d
    eststo, add (p_diffcd r(p))
    esttab . using regional.csv, b(4) t(2) ar2(3) scalars (p_diffbc p_diffde p_diffcd N)
    Perhaps a cleaner alternative:

    Code:
    reg a b c d e i.date i.geographical_focus i.country
    eststo
    test b=c
    estadd p_diffbc = r(p)
    test d=e
    estadd p_diffde = r(p)
    test c=d
    estadd p_diffcd = r(p)
    esttab . using regional.csv, b(4) t(2) ar2(3) scalars (p_diffbc p_diffde p_diffcd N)
    Last edited by Nils Enevoldsen; 21 Apr 2017, 10:30.

    Comment

    Working...
    X