Hi,
I use the following equation for calculating return for a portfolio of stocks.

gen MOMf3_p1= ( for4r1 [_n-4] + for3r1 [_n-3] + for2r1 [_n-2])/3

for4r1 to for2r1 are returns
_n denotes time
the issue is if one of the returns above go missing the answer I get is a "."
I understand I cannot use egen function to resolve this.
Is there a way?
Thank you.
Sampath