Announcement

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

  • Is there a way to permanently store eststo?

    I posted this question also to StackOverflow.

    My code is complicated that it has many "clear all" commands.

    Is it possible to store eststo so that it does not wiped out by clear command?

    I want those stored eststo to use later.

  • #2
    No.

    Comment


    • #3
      Per Jared's comment, I can't think of a direct way to do this with -eststo- (See -ssc describe estout- for this package.) However, one could use the built-in -estimates save- command to save each estimate to a file, to be retrieved later and then manipulated, possibly with -eststo- or other commands in -eststoo-. I'm thinking of something like this, which may or may not be relevant to Jay's purposes:
      Code:
      clear all
      sysuse auto
      regress price weight mpg
      estimates save c:/temp/model1  // Use a perm file so as to survive -clear all-
      //
      regress price headroom foreign
      estimates save c:/temp/model2
      clear all
      est dir // for demo
      forval m = 1/2  {
        estimates use c:/temp/model`m'
        eststo test`m'
      }
      est dir

      Comment


      • #4
        Originally posted by Mike Lacy View Post
        Per Jared's comment, I can't think of a direct way to do this with -eststo- (See -ssc describe estout- for this package.) However, one could use the built-in -estimates save- command to save each estimate to a file, to be retrieved later and then manipulated, possibly with -eststo- or other commands in -eststoo-. I'm thinking of something like this, which may or may not be relevant to Jay's purposes:
        Code:
        clear all
        sysuse auto
        regress price weight mpg
        estimates save c:/temp/model1 // Use a perm file so as to survive -clear all-
        //
        regress price headroom foreign
        estimates save c:/temp/model2
        clear all
        est dir // for demo
        forval m = 1/2 {
        estimates use c:/temp/model`m'
        eststo test`m'
        }
        est dir
        Thank you! I will try this now as you suggested.

        Comment


        • #5
          Originally posted by Mike Lacy View Post
          Per Jared's comment, I can't think of a direct way to do this with -eststo- (See -ssc describe estout- for this package.) However, one could use the built-in -estimates save- command to save each estimate to a file, to be retrieved later and then manipulated, possibly with -eststo- or other commands in -eststoo-. I'm thinking of something like this, which may or may not be relevant to Jay's purposes:
          I did and it worked!!!
          Since I am in environment where copy and paste is not allowed, let me put it as a screenshot.
          Click image for larger version

Name:	image.png
Views:	1
Size:	48.2 KB
ID:	1692908

          Comment


          • #6
            Yeah the offending thing in this case would be clear all. If you didn't use that, then okay, but otherwise you'd need to save it to a tempfile, which I guess is also the solution!

            Comment


            • #7
              In creating the preceding fragment, I learned that -clear all- removes tempfiles, but -clear- doesn't.

              Comment


              • #8
                Originally posted by Mike Lacy View Post
                Per Jared's comment, I can't think of a direct way to do this with -eststo- (See -ssc describe estout- for this package.) However, one could use the built-in -estimates save- command to save each estimate to a file, to be retrieved later and then manipulated, possibly with -eststo- or other commands in -eststoo-. I'm thinking of something like this, which may or may not be relevant to Jay's purposes:
                Code:
                clear all
                sysuse auto
                regress price weight mpg
                estimates save c:/temp/model1 // Use a perm file so as to survive -clear all-
                //
                regress price headroom foreign
                estimates save c:/temp/model2
                clear all
                est dir // for demo
                forval m = 1/2 {
                estimates use c:/temp/model`m'
                eststo test`m'
                }
                est dir
                There is also Ben Jann 's excellent estwrite / estread package, which enhances built-in estimates save considerably IMO:

                https://github.com/benjann/estwrite

                Comment

                Working...
                X