Can you please help me with the following:
I have a data set which has the age (age_20) and position (pos_20). Now I want to create new variables age_21 to age_40 (project till 2040)
and project the position based on the following condition :
Promotion is from
p5 (lowest)
p4
p3
p3
p2
p1
Ex3 (highest)
Es3 (highest)
The condition for promotion is based on the following and is different for different position :
1.P4 to P3 to P2 promotion
Category 1- 3% (3 years) (for a random 3% of the total give them promotion every 3 years)
Category 2- 7% (4 years) (for a random 7% of the total give them promotion every 4 years)
Category 3- 85% (7 years) (for a random 85% of the total give them promotion every 7 years)
Category 4- 5% (Retain) (for a random 5% of the total don't give them promotion )
from position P5 to P4 promotion – 5 years (promotion every 5 years)
from P2 to P1 promotion – Promotion of P1 to EX positions + P1 exiting Civil Service(age)
From a the sample a random 15 executive and 9 specialist 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.
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
Thank you in advance
0 Response to Create new variables based on condition and other variables
Post a Comment