<>
***
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" <[email protected]>
To: <[email protected]>
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/