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 at the end of May, and its replacement, statalist.org is already up and running.


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

Re: st: application of post-estimation commands


From   mcross@exemail.com.au
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: application of post-estimation commands
Date   Fri, 16 Sep 2011 15:32:23 +1000

Many thanks to Nick and Austin for their replies.

Cheers,

Mike.




You can save the coefficients to scalars e.g.

scalar intercept = _b[_cons]
scalar weightcoeff  = _b[weight]

and use those scalars in calculations later in the same session,
referring to them by name. Make sure that you don't use the same names
for scalars as for any variables No function, in the Stata sense, is
involved here.

You can -update- your Stata to 8.2 for free. See

http://www.stata.com/support/faqs/res/history.html

Nick

On Mon, Sep 12, 2011 at 4:55 AM,  <mcross@exemail.com.au> wrote:

 * I'm a beginner using Stata 8.1.

 * Regarding the following -

sysuse auto, clear

gen wtsq = weight^2

regress mpg weight wtsq

predict mpghat

twoway (scatter mpg weight) (line mpghat weight, sort)

 * Let's say I'm happy with the above fitted model.

 * In future, how can I predict mpg as a function

 * of weight using the same equation from above?

 * In other words, I want to save the above

 * function and use it in different .dta files.

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index