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.
Are there any unconventional ways to launch Stata?In my set up, I have a host machine and two VMS. Both VMs have Stata installed on them. I need to be…
Fractional logit model and panel dataHi all, I am using a "fractional logit" model (as suggested by another paper) on my panel data (DV:…
DestringI have data with observations that are numeric but appear red and so cannot manipulate some formulas…
Very large variance in PROBIT regressionhi, I had a problem with the variance when I run IVPROBIT regression. I have a number of binary vari…
Multiply the intercept by a constant and output via "outreg2"Hi, I would like to annualize (x12) the alpha (intercept) of an asset pricing regression before out…
Subscribe to:
Post Comments (Atom)
0 Response to cumulative sum that restarts at 0, if observe "0" in the original column.
Post a Comment