Hello everyone. I am doing some exploratory analyses which requires estimating different model specifications. Please, how do I replace predicted values from an old regression with predicted values from a new regression without having to generate another variable. Here's what I mean:
I estimate the following regression
And compute the predicted values
Then I run another regression
Attempting to generate phat again results in the error
Please, how can I generate phat that overwrites the values of the existing phat each time I estimate a different regression?
Code:
sysuse auto.dta
Code:
reg price mpg mpg weight
Code:
predict phat, xb
Code:
reg price mpg weight foreign turn displacement
Code:
predict phat, xb phat already defined r(110)
Comment