Announcement

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

  • Saving multiple stored estimates to file

    Hello all,

    Basic info: Stata 11, fully updated ado and exe ; Windows 7 64Bit ; 16GB RAM

    I'm running several regression models(~81) and stored their estimates using estimates store command.
    Unfortunately I was not aware that the stored estimates are dropped when I exit stata. that is a shame as the models take a long time to be estimated and the computer is in a research room and my access to it is limited.
    I then found out about the estimates save command that produces a STER file where the estimates are saved. unfortunately, I wasn't able to find an option to save all stored estimates to the file, and using the STER file (estimates use) seem to only give me one of the saved estimates(corresponding to number(%) in the estimates use command).
    What I'm looking for is essentially a way to save estimates, such that all of the saved estimates can be produced in another instance of stata, even without the data. essentially, what I want is to be able to see all the saved estimates as much the same way as I could list, display and reproduce stored estimates with a command such as estimates dir.

    I hope I'm being clear on this as much as possible..
    Any help would be much appreciated!

  • #2
    Have a look at some of the packages written by Roger Newson, starting with parmest.
    Code:
    ssc d parmest

    Comment


    • #3
      Code:
      estimates save, append
      http://www.stata.com/manuals13/restimatessave.pdf

      Comment


      • #4
        I'm familiar with "estimates save, append" command. but:
        do I need to use it after running every model? or can I store several estimates and then use the command to save all of them? because I wasn't successful in that.
        Also, after Iv'e saved several estimates to file with append, when I open stata and then enter "estimates use estimatesfile", i'm only able to use 1 of the estimates saved in that file... am I wrong?

        Comment


        • #5
          #1 What is the problem with saving after every model? If you are just running a 1000 models, how do you think Stata would know that later you would want to save the results? Should it save all of them just in case? No. It will store only the last estimates. Unless you tell it to save the results, new results will clear the previous ones. There is only one e().

          #2 Same manual I pointed to: 1st paragraph on page 2. There are only two pages there. Should be manageable.

          Comment


          • #6
            1. It's not a problem, but since Iv'e already stored several model estimates, a command to save all of those stored estimates would be very useful.
            2. this doesn't really help me as it still just gives me the option to load just 1 saved estimate at a time. i want to use all of the saved estimate.

            I'll try to explain again: after running and storing say 9 models - I can, while still within that session, replay the estimates and display them in various way with estimats table, estout etc.
            what I want to accomplish is the same thing but after Iv'e started a new stata session.

            Comment


            • #7
              http://www.radyakin.org/statalist/20...702_1300997.do

              http://www.radyakin.org/statalist/20...02_1300997.png
              Click image for larger version

Name:	20150702_1300997.png
Views:	1
Size:	24.7 KB
ID:	1301064

              Comment


              • #8
                simple, elegant and exactly what I wanted. thank you so much!

                Comment


                • #9
                  Speaking of .STER files, is there an alternative to those? A quick hexdump shows they are quite inefficient, with useless strings (Stata path) and lots of empty regions...
                  I once asked tech support about them but it seems they are mostly an undocumented mata structure dumped to disk.

                  Comment


                  • #10
                    Code that I have now developed to save all my stored estimates in one go:

                    Code:
                    estimates dir
                    global estlist `r(names)'
                    local j = 0
                    foreach est of global estlist{
                        est rest `est'
                        if `j' > 0 estimates save filename, append
                        if `j' == 0 estimates save filename, replace
                        local j = 1
                    }
                    For some reason that goes over my head, a local did for estlist did not work, so I resorted to a global.

                    Comment

                    Working...
                    X