I have a dataset of dyads in groups in long format.
I need to generate a variable "dyad_id" that identifies distinct dyads in the dataset.
This simple toy dataset illustrates the problem.
The group identifier is "project_id" and the members in each dyad are identified by "member_id".
| project_id | member_id | dyad_id |
| 1 | 1 | 1 |
| 1 | 2 | 1 |
| 2 | 3 | 2 |
| 2 | 4 | 2 |
| 3 | 1 | 3 |
| 3 | 3 | 3 |
| 4 | 1 | 1 |
| 4 | 2 | 1 |
Any and all input on this problem would be greatly appreciated.
Thanks!
Sincerely,
Erik
0 Response to Generate distinct id for dyads in groups in long format
Post a Comment