I have a dataset with grouped by a particular variable. The number of observations (rows) in each group ranges from 3 to 20. I want to first sort by group and date, and then perform a cumulative sum over one of the variables, but by group: In each group, I want to sum all previous values of the variable in that group, and then record this rolling or cumulative sum as another variable. I have no idea how to do this in Stata - please help.
-
Login or Register
- Log in with
Comment