Dear Statalist,
I have a dataset containing the information about the consolidated accounts of different firms. Each company is assigned a unique Company-ID in a string variable. In a second string variable, the owner of the respective firm is listed with his Company-ID. I would like to drop all observations, whose Owner-ID is found as the Company ID in another observation. I tried to find a way to do that with the help of "if", however, I didn't find a way to compare two variables across observations. Any help on this is highly appreciated.
Example:
In the example, the third observation should be dropped, because the owner-ID equals the Company-ID of the first observation.
Many thanks in advance
Steven
I have a dataset containing the information about the consolidated accounts of different firms. Each company is assigned a unique Company-ID in a string variable. In a second string variable, the owner of the respective firm is listed with his Company-ID. I would like to drop all observations, whose Owner-ID is found as the Company ID in another observation. I tried to find a way to do that with the help of "if", however, I didn't find a way to compare two variables across observations. Any help on this is highly appreciated.
Example:
Company-ID | Revenue | Owner-ID |
A1 | 10 | D4 |
B2 | 11 | E5 |
C3 | 12 | A1 |
Many thanks in advance
Steven
Comment