I have this data frame:
transaction ID | day number | Predicted value |
---|---|---|
12 | 1 | .001 |
12 | 2 | .002 |
12 | 1 | .001 |
12 | 2 | .002 |
13 | 1 | .001 |
13 | 2 | .002 |
13 | 3 | .002 |
13 | 4 | .003 |
I want to take the cumulative sum of the each set of predicted values based on the sequential day numbers (i.e. cumsum of the first 2 rows, cumsum of the next 2, and the cumsum of the last 4)
so the results would be .003, .003, .008