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
Need help re-arranging dataHi my dataset looks like this right now: clear input long mrn str10 date str11 diagnosis long date_n…
linking data with a keyHello I need some help linking this data set So the variable taskdefinitionid is the numerical cod…
How to change a line pattern within a same graph? Hi, I would like to plot a graph using Code: twoway line and draw a different graph pattern after …
Need help with dataset with multiple datesHi I am working with a dataset which ahs multiple dates for the same diagnosis for a patient and I o…
Panel data: xtoverid rejects RE for model with only time controls; odd result or information?Dear Statalisters, I am using interrupted time series methods on household panel data. I have month…
Subscribe to:
Post Comments (Atom)
0 Response to Name groups of consecutive number series
Post a Comment