Dear all, I am new to STATA (IC14.2).
I want to calculate a variable, that gives me the percentage of entering people & exiting people of a group.
For example:
I have comapny ABC inc. and for this company I have several years (e.g.2000-2010).
In every year for this company, I have e.g. 6, sometimes 7 executives or group members .
Now I want to compare year 2000 (e.g. 6 team member names) with year 2001 (6 or 7 or 5 members, can change depeneding on comapny ).
I want to check the percentage of new names in 2001 and of names, that are no longer on the team in 2001!
Then I want to repeat this process, comparing years 2001 and 2002, than compare 2002 and 2003 and so forth.
Next same process with company DEF inc. etc.
(My Stata Dataset has over 30.000 lines) and I want to do a command that calculates the number of percentages of exiting and entering persons (new names or new personid's / or missing person names in the following year for each company and each year)
I hope I could explain it good enough
Can anyone please help me?
I want to calculate a variable, that gives me the percentage of entering people & exiting people of a group.
For example:
I have comapny ABC inc. and for this company I have several years (e.g.2000-2010).
In every year for this company, I have e.g. 6, sometimes 7 executives or group members .
Now I want to compare year 2000 (e.g. 6 team member names) with year 2001 (6 or 7 or 5 members, can change depeneding on comapny ).
I want to check the percentage of new names in 2001 and of names, that are no longer on the team in 2001!
Then I want to repeat this process, comparing years 2001 and 2002, than compare 2002 and 2003 and so forth.
Next same process with company DEF inc. etc.
(My Stata Dataset has over 30.000 lines) and I want to do a command that calculates the number of percentages of exiting and entering persons (new names or new personid's / or missing person names in the following year for each company and each year)
I hope I could explain it good enough

Can anyone please help me?
| year | company | compid | personname | personid |
| 2000 | ABC inc. | 1234 | Anderson | 24364 |
| 2000 | ABC inc. | 1234 | Hemp | 22880 |
| 2000 | ABC inc. | 1234 | Davis | 3879 |
| 2000 | ABC inc. | 1234 | Switz | 10203 |
| 2000 | ABC inc. | 1234 | Cadogan | 6 |
| 2000 | ABC inc. | 1234 | Ford | 913 |
| 2000 | ABC inc. | 1234 | Barker | 24362 |
| 2000 | ABC inc. | 1234 | Sobti | 20624 |
| 2001 | ABC inc. | 1234 | O'Brien | 24363 |
| 2001 | ABC inc. | 1234 | Hemp | 22880 |
| 2001 | ABC inc. | 1234 | Cadogan | 6 |
| 2001 | ABC inc. | 1234 | Anderson | 24364 |
| 2001 | ABC inc. | 1234 | Davis | 3879 |
| 2001 | ABC inc. | 1234 | Sniff | 25854 |
| 2001 | ABC inc. | 1234 | Switz | 10203 |
| 2001 | ABC inc. | 1234 | Barker | 24362 |
| 2001 | ABC inc. | 1234 | Ford | 913 |
| 2001 | ABC inc. | 1234 | Roscitt | 22879 |
| 2000 | DEF inc. | 2184 | London | 24784 |
| 2000 | DEF inc. | 2184 | Miller | 6175 |
| 2000 | DEF inc. | 2184 | Fenn | 6177 |
| 2000 | DEF inc. | 2184 | Freeland | 23443 |
| 2000 | DEF inc. | 2184 | Schoonover | 24785 |
| 2000 | DEF inc. | 2184 | Lenzmeier | 6176 |
| 2000 | DEF inc. | 2184 | Keskey | 15375 |
| 2000 | DEF inc. | 2184 | Walden | 21726 |
| 2000 | DEF inc. | 2184 | Schulze | 126 |
| 2001 | DEF inc. | 2184 | Fenn | 6177 |
| 2001 | DEF inc. | 2184 | London | 24784 |
| 2001 | DEF inc. | 2184 | Keskey | 15375 |
| 2001 | DEF inc. | 2184 | Freeland | 23443 |
| 2001 | DEF inc. | 2184 | Lenzmeier | 6176 |
| 2001 | DEF inc. | 2184 | Jackson | 13283 |
| 2001 | DEF inc. | 2184 | Schoonover | 24785 |
| 2001 | DEF inc. | 2184 | Miller | 6175 |
| 2001 | DEF inc. | 2184 | Schulze | 126 |

Comment