So I'm doing a regression on some data and then want to create predicted values on a different data set, but I want a random draw of residuals included. Something like:
But I don't want the plain predicted values, I want simulated residuals in there such that roughly half of the predicted values are higher and half are lower than the plain predicted values.
Obviously I could do this by hand or do it in mi. But is there an easier way?
Code:
reg y x
use other_data, clear
predict yhat
Obviously I could do this by hand or do it in mi. But is there an easier way?
Comment