Announcement

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

  • rclass and eclass

    Dear all,

    I have two programs: foo1 and foo2. Foo1 is an rclass program. Foo2 is an eclass program. At some point, foo1 calls foo2 to estimate certain models and then continues. Foo1 stores results in r(), while foo2 in e().

    Is it possible to return estimation results from foo2 after foo1 ends given that the latter is an rclass program?

    Thank you.


  • #2
    I think you can ask foo2 to store e-results and they will stay visible after foo1 ends. It has to happen within foo2 though, not in foo1.

    Comment


    • #3
      Jesse's idea is right, within one condition. The e() results returned by foo2 will remain visible through and after foo1 if neither foo2 nor foo1 invokes any other eclass command after foo2 posts its results. But if any other eclass command is called, its results will overwrite those originally posted in foo2.

      If foo2 needs to use another eclass command after the one whose results you want to retain, or if foo1 needs to use another eclass command after it calls foo2, then you could copy the e() results of interest into scalars or matrices as appropriate and return them in r(), where they will not be overwritten by a different eclass command. (If you have to do this within foo2, so that it returns its originally e() results in r(), be sure to include a -return add- command to foo1 immediately after it calls foo2.)

      Comment


      • #4
        You can actually return the e() results directly from within foo1. For example, immediately after you call foo2 just type:

        Code:
        return matrix mat1 = `e(b)'

        Comment


        • #5
          Also see

          Code:
          help estimates
          help _estimates
          Best
          Daniel

          Comment

          Working...
          X