Dear all,
We are trying to make a new variable which gives every number within a consecutive series of numbers a ''name'', which is the highest number within that consecutive series. So each consecutive series starts with a ''1'' and we need to attach the highest number to every number within that series. To make this more clear see our example underneath;
Var 1 - NewVar
1 4
2 4
3 4
4 4
1 8
2 8
3 8
4 8
5 8
6 8
7 8
8 8
1 4
2 4
3 4
4 4
This might be a very basic question but we somehow can't figure out how to do it. We would be very thankful if anyone could help!
Kind regards,
Jonathan
Related Posts with Name groups of consecutive number series
binary choice model after collapseis it possible to use binary choice models to predict pr(y|x) after collapsing the data by group? …
list if conditionsI used the following code to list the observations in a variable if the binary "check" is 0. But in …
How to shorten multiple line of codes relevant?In my data, I have a numeric number called year which have value from 2 to 22, I want to replace thi…
Manually calculating IV standard errors and getting STATA to use them in the regression tableI found the following script from one of the other threads to be helpful in calculating IV standard …
Why many commands do not work?Hello dear stata community I am kind of new to stata but I have been facing issues with many command…
Subscribe to:
Post Comments (Atom)
0 Response to Name groups of consecutive number series
Post a Comment