Hi Statalist,
I had a small question that I was hoping to get help with. I refer to the table below to explain:
Time |
Firm |
Client |
Count |
1 |
A |
James |
. |
1 |
A |
John |
. |
1 |
A |
Jack |
. |
2 |
A |
James |
2 |
2 |
A |
John |
2 |
2 |
A |
Percy |
2 |
2 |
A |
Tom |
2 |
3 |
A |
Percy |
1 |
3 |
A |
Phil |
1 |
4 |
A |
. |
0 |
5 |
A |
Jake |
0 |
This table is a very simplified fragment of a much larger firm and client level dataset. The problem I have is that I want to generate a variable count such that it counts the recurring names in successive time periods. For instance, at Time 1, firm A had three clients. At Time 2, the firm had four clients and only two recurring clients (James and John) from the previous period. Going from Time 2 to Time 3, the count is 1 since we have only one recurring client (Percy). From Time 3 to 4, the count is zero since there were no clients. The count from Time 4 to 5 is also zero since Jake was not a client at Time 4.
In the actual dataset I have nearly 300 firms and 2500 clients over 200 time periods and the data has is in long form similar to the sample above.
Any suggestions would be appreciated. Thank you.
Best,
Omar
0 Response to Generating Count of Recurring names in Successive Time Periods
Post a Comment