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
Displaying rho after biprobit, margins in the output tableDear Statalist members, I would be very thankful for an advice. I am running a biprobit model, and u…
Change format of elapsed time from seconds to mm:ssI have 1.5 mile run times recorded in seconds. I would like to keep this variable as seconds for the…
adjusted R-squared using area versus reghdfeDear Statalist community, I have a model that controls for many fixed effects and clustered standar…
Oaxaca-Blinder Decomposition for ordinal dependent variablesDear Statalist, I am trying to find a way to run a detailed Oaxaca-Blinder decomposition for an ordi…
Is it possible to overlay a stacked bar plot and a line plot?I have two figures that I want to overlay in a single figure. The first is created using Code: grap…
Subscribe to:
Post Comments (Atom)
0 Response to Sequencing with a condition
Post a Comment