Statalist


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

st: Re: How to use estimated coefficients in subsequent calculations


From   "Martin Weiss" <martin.weiss1@gmx.de>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: Re: How to use estimated coefficients in subsequent calculations
Date   Wed, 15 Apr 2009 21:10:39 +0200

<>

***
sysuse auto, clear
reg pr tr tu rep
predict phat
di _b[_cons]
gen phatlessconstant=phat- _b[_cons]
su phat*
***


HTH
Martin
_______________________
----- Original Message ----- From: "sdm1" <sdm1@york.ac.uk>
To: <statalist@hsphsun2.harvard.edu>
Sent: Wednesday, April 15, 2009 8:40 PM
Subject: st: How to use estimated coefficients in subsequent calculations


I'm using the predict command -- predict yhat, xb -- to apply the
coefficients from estimation on one data set to another data set. However,
I'd like to be able subtract the estimated constant term from the
prediction.  How do I refer to the estimated constant (say, b[0]) to do
this:  generate yhatwithoutcons=yhat-b[0]?

Thanks.

Steve

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