Below I have included an example of a wide dataset in which children have ages reported at each wave (ex: wave 5 age is k5agebg). In some instances, age is set to ".m" but we know that interviews are 2 years a part. How can I make .m's on my age variables be equal to the next value minus 2 if currently .m? In the example, k11agebg should be 35 on the first observation and 26 on the second. k10agebg would be 33 on the first observation and 24 on the second. I've done similar things with panel data, but am a bit stumped on solving this in the wide format.

Code:
. list hhidpn kidid k1age k2agebg k3agebg k4agebg k5agebg k6agebg k7agebg k8agebg k9agebg k10agebg k11agebg k12agebg kabyearbg if hhidpn == 920672010 , sepby(hhidpn)

        +------------------------------------------------------------------------------------------------------------------------------------------------------------+
        |    hhidpn        kidid   k1age   k2agebg   k3agebg   k4agebg   k5agebg   k6agebg   k7agebg   k8agebg   k9agebg   k10agebg   k11agebg   k12agebg   kabyea~g |
        |------------------------------------------------------------------------------------------------------------------------------------------------------------|
128812. | 920672010   9206720101       .         .         .         .         .         .         .         .         .         .m         .m         37       1977 |
128813. | 920672010   9206720102       .         .         .         .         .         .         .         .         .         .m         .m         28       1986 |
        +------------------------------------------------------------------------------------------------------------------------------------------------------------+
Code:
* Example generated by -dataex-. For more info, type help dataex
clear
input long hhidpn str10 kidid byte(k1age k2agebg k3agebg k4agebg k5agebg k6agebg k7agebg k8agebg k9agebg k10agebg k11agebg k12agebg) int kabyearbg
920672010 "9206720101" . . . . . . . . . .m .m 37 1977
920672010 "9206720102" . . . . . . . . . .m .m 28 1986
end