Announcement

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

  • Estimate store using lincom

    Hi everyone,

    I hope you are doing great. I am trying to store the results of a lincom to later use them in a coefficient test with results from other regressions, but the regular <estimate store> is not working. Somehow, when using this command, the results Stata saves are the ones from the original regression and not the lincom. Anyone knows what can I do. I have already saved the results from the other regression I will be testing.

    Thanks

  • #2
    -lincom- is not an estimation command; it does not change anything in -e()-, so you cannot capture its results with -estimates store-. The results of -lincom- are captured, briefly, in -r()- If you run -return list- after your -lincom- command you will see what is available. Those results can then be stored in scalars or local macros. There is not, however, a single command analogous to -estimates store- that will do them all at once. You must write a separate command creating the scalar or local macro for each of the particular results you want to store. Bear in mind, also, that anything saved in -r()- will disappear if a subsequent command overwrites it. So you should place these commands to save results from -r()- immediately after the -lincom- command itself.

    Comment


    • #3
      Hi Tessa
      I thing you have 3 options :
      1. You can try the option "post" after lincom. THat usually stores the results in equation form that you can use est store for later use (haven't tried it yet)
      2. Use nlcome. This does have post option
      3. You can always "store" anything as equation by using the following:

      Code:
      program adde, eclass
         ereturn `0'
      end
      
      matrix b=[1,2,3]
      matrix V=b'*b
      matrix colname b = n1 n2 n3
      matrix colname V = n1 n2 n3
      matrix rowname V = n1 n2 n3
      adde post b V
      ereturn display
      WHere you just need to substitute b and V.
      HTH

      Comment


      • #4
        Thanks, Fernando and Clyde, your answers were very helpful.

        Comment


        • #5
          I'm a bit late to the party, but you could use xlincom from ssc which does store the results in e() when using the post option (which lincom doesn't have), so they can be stored by estimates store. You can also use the repost option to store both the original regression results and the lincom result in e() as multiple equations to make testing easy.
          Code:
          ssc install xlincom
          sysuse auto
          reg price mpg weight
          xlincom mpg + weight, post

          Comment


          • #6
            Wouter Wakker, this helped me a lot, thank you!!

            Comment

            Working...
            X