Hi all,

I'm trying to generate a variable (steponecpn) so that is represents the change in Cumulative Plane Number (cpn) from one month to the next.

I've accomplished this with this code:
Code:
 gen steponecpn=cpn-cpn[_n-1]
The problem that I'm having is that when there isn't a previous value (ex. when cpn[_n-1] = .) I end up with no value in my steponecpn. In these cases, I'd like to have steponecpn = cpn. Does anyone have an idea of how to do this?