hello,
I have a team with 29 employees (it could change) in 5 (it could change) groups .see table HAVE. some groups have 5 employees, and some groups have 6 employees
What I would like to obtain : divide each group into two subgroup with equal number employees whenever it is possible
for groups with 5 employees, get a subgroup number that is 1,1,1,2,2
for groups with 6 employees get a subgroup number that is 1,1,1,2,2,2
many thanks in advance for your help
Data have ;
infile datalines ;
input name $ group $1. subgroup $1. ;
datalines ;
Andrew 1
Barbara 1
Boris 1
Bryan 1
Carla 1
Christophe 2
David 2
Emma 2
Eric 2
Fred 2
Henry 2
Hugo 3
Jamal 3
Jeff 3
Kylian 3
Lionel 3
Maelle 3
Martin 4
Michael 4
Nadia 4
Nasser 4
Paul 4
Robert 4
Sacha 5
Salah 5
Samuel 5
Sophie 5
Stefan 5
Zakia 5
;
run ;
... View more