After I run the following regression:
bysort FYEAR SIC: regress TACCATw ATLAGINVw REVATLAGw PPEATLAGw if !missing(TACCATw) & !missing(ATLAGINVw) & !missing(REVATLAGw) & !missing(PPEATLAGw)

I want to predict the residuals with the following code:
predict DACC, resid
However, stata says "last estimates not found r(301):
"error . . . . . . . . . . . . . . . . . . . . . . . . Return code 301
last estimates not found;
You typed an estimation command, such as regress, without
arguments or attempted to perform a test or typed predict,
but there were no previous estimation results."

Does anybody have an idea how this can be fixed? Thank you in advance!