Dear all,
I encounter some challenges in computing a variable in Stata 14.2 from my dataset:
I want to construct a dummy variable, that tells me if an individual (variable name: person_id), who was working together with other individual(s) in 2007 (the last year of observation) in the same firm (variable name: org_number), has accumulated previous joint working experience in another firm (i.e., prior to 2007 - that would be 2005 and 2006) with at least one of the individuals he/she was working in 2007.
That means I am interested if an individual has accumulated work experience in the previous years (i.e., 2005 and 2006) with at least one of his/her "2007 coworker/s", in another firm than the one firm they were both working for in 2007 (hence 2007 is the reference year). This should be coded as “1”.
If the individual had no prior work experience accumulated in the previous years in another firm with his "2007 co-workers", this should be coded as “0.” My dataset has following structure (just an excerpt as confidential):
CODE]
* Example generated by -dataex-. To install: ssc install dataex
clear
input byte(person_id org_number2007 org_number2006 org_number2005)
1 1 1 1
2 1 1 4
3 1 1 4
4 1 1 .
5 2 4 5
6 2 7 6
7 2 7 6
8 3 4 3
9 3 4 4
10 4 8 8
end
[/CODE]
For instance person_id 2 and person_id3 have accumulated joint work experience in year 2005 in a firm that was different to 2007), therefore they should receive a “1” in 2005.
I encounter difficulties in writing a code that identifies the same individuals that worked together in 2007 and which can track the same individuals to the years before. Is there any command in Stata that could fix this problem?
Any help is highly appreciated!
Best,
Miriam
I encounter some challenges in computing a variable in Stata 14.2 from my dataset:
I want to construct a dummy variable, that tells me if an individual (variable name: person_id), who was working together with other individual(s) in 2007 (the last year of observation) in the same firm (variable name: org_number), has accumulated previous joint working experience in another firm (i.e., prior to 2007 - that would be 2005 and 2006) with at least one of the individuals he/she was working in 2007.
That means I am interested if an individual has accumulated work experience in the previous years (i.e., 2005 and 2006) with at least one of his/her "2007 coworker/s", in another firm than the one firm they were both working for in 2007 (hence 2007 is the reference year). This should be coded as “1”.
If the individual had no prior work experience accumulated in the previous years in another firm with his "2007 co-workers", this should be coded as “0.” My dataset has following structure (just an excerpt as confidential):
CODE]
* Example generated by -dataex-. To install: ssc install dataex
clear
input byte(person_id org_number2007 org_number2006 org_number2005)
1 1 1 1
2 1 1 4
3 1 1 4
4 1 1 .
5 2 4 5
6 2 7 6
7 2 7 6
8 3 4 3
9 3 4 4
10 4 8 8
end
[/CODE]
For instance person_id 2 and person_id3 have accumulated joint work experience in year 2005 in a firm that was different to 2007), therefore they should receive a “1” in 2005.
I encounter difficulties in writing a code that identifies the same individuals that worked together in 2007 and which can track the same individuals to the years before. Is there any command in Stata that could fix this problem?
Any help is highly appreciated!
Best,
Miriam
Comment