[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
Re: st: regress and then extrapolate with new dependent vars but same coefficients
At 09:56 AM 7/19/2006, Olga Gorbachev Melloni wrote:
One way is to use the adjust command.
I need to run an exercise in which after running a regression and
predicting the y_hat, I need to replace one of the dependent
variables with zeros and then use the saved coefficients to predict
a hypothetical value for y_hat(given x1==0), in order to compare the
predicted values from these two exercises.
Does any one know how to do this quickly, without saving all the
coefficients and manually predicting for the second step? I am
running a regression with 174 dependent variables (mostly dummies)
and it would take some time to predict manually.
I've checked on the faq for this and was unable to find anything, i
might have overlooked the answer and apologize in advance if it has
been asked and answered already and would appreciate any references if so.
reg y x1 x2 x3
adjust x1=0, gen(yhat2)
clonevar newx1 = x1
reg y newx1 x2 x3
replace newx1 = 0
Richard Williams, Notre Dame Dept of Sociology
OFFICE: (574)631-6668, (574)631-6463
WWW (personal): http://www.nd.edu/~rwilliam
WWW (department): http://www.nd.edu/~soc
* For searches and help try: