Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: OLS: How to save constants as a new variable?


From   Alan Neustadtl <[email protected]>
To   [email protected]
Subject   Re: st: OLS: How to save constants as a new variable?
Date   Sun, 22 May 2011 10:04:23 -0400

You can store any coefficient from your last estimated model in a
local macro and use it later in the same program.  The following shows
some ways to access the coefficients.

Best,
Alan
/***********/
sysuse auto, clear
reg mpg c.weight##c.weight
di _b[_cons]
di _b[weight]
di _b[c.weight#c.weight]

local constant _b[_cons]
di `constant'
/***********/

On Sat, May 21, 2011 at 11:28 AM, Barbara Engels <[email protected]> wrote:
> I made some regressions and want to save the constants of the different regressions in the form of a new variable so that I can make further calculations with the vector of the constants. how can I do that?
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
>

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index