Hi, I have a simple question. I would like to have a cumulate sum that restarts if observing 0 in the original column. I have a simple example. Is there an easy way to do this? I tried several ways to do this, but couldn't figure out a way to do this.
ex)x is a column of original data and y is the desired outcome
x y
1 1
1 2
1 3
1 4
1 5
0 0
1 1
1 2
1 3
1 4
Related Posts with cumulative sum that restarts at 0, if observe "0" in the original column.
And/or symbolIs there an and/or command in Stata? I would like to generate a variable (recoverev) that would equa…
How to remove all characters that are not part of a predefined list?How can I remove from a STRING VARIABLE all characters that are not part of a predefined list? For e…
Using a string variable as xlabel for plotsDear all, I would like to plot the weekly values of my three variables (1) amount of tests performe…
Individual fixed effects vs. school fixed effectsHi all, I am deciding between a school and year fixed effects model and an individual fixed effects…
Help with reclink: perform fuzzy matches of a variable within exact matches of another variableI am trying to perform a record linking in which I have two variables: 'cod' is a 6-digit code store…
Subscribe to:
Post Comments (Atom)
0 Response to cumulative sum that restarts at 0, if observe "0" in the original column.
Post a Comment