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
Creating a variable that captures if monthly salary is twice as big as the previous month and employment stays the sameHi I want to create a variable that is 1 if the monthly salary is twice as big or more than the pre…
Drop observations if two of the variables are identicalI have a dataset similar to the example below, where the index number is always the same for when Va…
Return percentiles using simulate commandHi, I am trying to improvise an example from help of Code: simulate command as shown below Code:…
Bootstrapping of mean in a subsampleI'm analyzing a sample of GPs. I want to describe the GP's with extreme values of a variable. This m…
Estimating working hours in a simultaneous equations modelHello! What would be the best way to estimate hours spent on different activities (censored, values …
Subscribe to:
Post Comments (Atom)
0 Response to Name groups of consecutive number series
Post a Comment