Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

[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 <>
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.

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 <> 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:
> *
> *
> *

*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index