I have the following sample:
Code:
Year | Staff ID | Hotel_ID | Industry code | Waitress | Receptionist 2009 | 124665 | 23453 | 20 | 1 | 0 2010 | 436455 | 34534 | 30 | 0 | 1 2002 | 543645 | 37684 | 10 | 0 | 1 2009 | 124665 | 32478 | 20 | 0 | 1 2009 | 979987 | 34545 | 50 | 0 | 1 2013 | 097077 | 34556 | 30 | 1 | 0 2013 | 097077 | 34432 | 50 | 0 | 1
Code:
bysort staff_ID year: egen aux1 = max(Waitress) bysort staff_ID year: egen aux2 = max(Receptionist) gen wanted = aux1 & aux2
Important notes:
I am only interested in waitresses who are serving as a receptionist in other hotels (if any) and not vice versa. Also, note that waitresses can not take more than one receptionist position but can take multiple waitresses positions in other hotels in the same year.
All staff are allocated with a unique ID regardless of being a waitress or receptionist.
0 Response to Identifying waitresses who serve as receptionists in other hotels in which hotels have the same two-digit industry code
Post a Comment