My data looks like this:
Obs change Md_mg M_mg
1 0 0 8.7912
2 1 0.00232 .
3 2 0.00304 .
4 3 0.0032 .
5 4 0.00304 .
6 5 0.00784 .
7 6 0.0248 .
8 7 0.0328 .
9 8 0.044 .
10 9 0.0224 .
11 10 0.0312 .
12 11 0.028 .
13 12 0.0328 .
14 13 0.0256 .
15 14 0.028 .
16 0 0 8.8992
17 1 0.00248 .
18 2 0.00288 .
19 3 0.00304 .
20 4 0.00312 .
21 5 0.00776 .
22 6 0.0216 .
23 7 0.0328 .
24 8 0.0448 .
25 9 0.0224 .
26 10 0.036 .
27 11 0.0312 .
28 12 0.0336 .
29 13 0.028 .
30 14 0.0264 .
I *simply* want to fill in the missing values for M_mg in a check book balancing type of process, subtracting Md_mg each time; in other words for observation 2 M_mg should equal 8.78888, for observation 3 it should equal 8.78584, and so on. Resetting at the change variable 0 (0 is first.).
I've tried various combinations of the retain statement, first., etc. and appear to be stuck. Help appreciated! Thank you. NWV