Hello Everyone!
I have a question about generating a sequence in Stata with a condition. I have a variable ( var= 0,0,0,1,0,0,1,0,0,0) and want to generate a sequence with a break whenever var=1 and then restarts. The new variable will be like this (newvar = 1,2,3, . , 1, 2, ., 1, 2, 3). I would appreciate your help in this respect.
Moeen
Related Posts with Sequencing with a condition
How to change dot appearance in a marginsplot with recast(dot)?Hello all, Title is self explanatory. I'm presenting margins output in a marginsplot, and I'm choos…
Performing OLS after Lasso Model SelectionHi All, no specific code question here but rather a statistical one. I am trying to create a linear …
calculating true confidence intervals across binomial distributionsI'm attempting to reproduce in Stata a technique from a statistical coding textbook ("Analysis of Ca…
Identifying area of overlap from geoinpoly Hello everyone I'm working with two maps of the UK, with polygons of similar sizes. Specifically, …
Multiple response data cleaningHi Stata forum, I am working on a variable that has been difficult to clean. Panel data, long forma…
Subscribe to:
Post Comments (Atom)
0 Response to Sequencing with a condition
Post a Comment