Dear All

I am working on a data set where I have to create (project) variables for age and position from 2021 to 2040 based on the age and position for 2020. The age projection is that it should start from age_2020 and then create variables 2021 till age_2040. by adding one year each and once the age reaches 58 the projection should stop for that person.

For position however the following condition needs to be taken into account to create the variables for position from pos_2021 to pos_2040.:

The position will increase from P5 to P4 to P3 to P2 to P1 to either ES3 or EX3. The lowest is P5 and from there it will increase in this order P5 P4 P3 P2 P1 EX3 or ES3. Now a person can take any position based on what is position is in the year 2020 (ie the variable pos_2020).

The condition for promotion is based on the following and is different for different position :

1 For position P4 to P3 to P2 promotion

Category 1- 3% (3 years) (for a random 3% of the total persons with p4 or p3 give them promotion every 3 years to p3 or if they are in p3 to p2)

Category 2- 7% (4 years) (or a random 7% of the total persons with p4 or p3 give them promotion every 4 years to p3 or if they are in p3 to p2))

Category 3- 85% (7 years) (or a random 85% of the total persons with p4 or p3 give them promotion every 7 years to p3 or if they are in p3 to p2))

Category 4- 5% (Retain) (for a random 5% of the total persons with p4 or p3 don't give them promotion )


2. from position P5 to P4 promotion – 5 years (promotion every 5 years) Those with p5 in Pos_2020 promotion to be happen every 5 years

3. from P2 to P1 promotion – Promotion of P1 to EX positions + P1 exiting age (that is the person is less than 59 then only promote to EX or ES if they are in P1)

From a the sample a random 15 executive (EX3) and 9 specialist (Es3) are selected every year so random 9 persons with position P1 should be selected as Es3 and random 15 P1 position should be selected as Ex3 every year. (the age should be checked)

For all person once they reach age 58 should exit which means the projection should stop for that person

In the end my final data set will have variables from age_20 to age_40 and pos_2020 to pos_2040

here is an example of my dataset

----------------------- copy starting from the next line -----------------------
Code:
* Example generated by -dataex-. For more info, type help dataex
clear
input float pos_2020 byte age_2020
11 43
11 44
11 45
11 45
11 44
11 47
11 46
12 46
11 46
11 44
12 44
11 48
11 45
11 47
11 45
11 47
11 50
11 46
11 46
12 45
11 44
11 43
11 47
11 44
11 44
12 43
11 50
11 45
11 49
13 43
13 43
12 43
13 43
13 42
13 42
14 44
13 43
13 41
13 42
13 42
13 43
13 45
11 45
13 44
14 41
12 44
14 45
12 44
11 46
12 47
12 41
11 43
11 44
11 50
11 45
11 42
11 43
11 45
11 48
11 45
11 46
11 42
11 43
11 45
11 48
11 42
11 44
11 45
11 46
12 43
11 44
11 44
11 45
11 47
11 46
11 42
11 47
11 46
11 44
11 47
12 45
11 43
11 44
11 42
11 47
11 42
11 47
11 47
11 45
11 45
14 52
13 42
12 49
12 51
12 44
12 42
13 38
15 40
14 39
14 38
end
label values pos_2020 positionl
label def positionl 11 "P1", modify
label def positionl 12 "P2", modify
label def positionl 13 "P3", modify
label def positionl 14 "P4", modify
label def positionl 15 "P5", modify
------------------ copy up to and including the previous line ------------------

Listed 100 out of 7755 observations