Hello everyone,
I’m stuck on a problem regarding generation of a new variable.
My original dataset looks like this.
Each Offer ID is uniquely assigned a Point. And some offer ID are uniquely assigned an Accept ID. Individuals from the Offer ID can be also Accept the offers made by individuals in the Offer ID. Therefore, the Accept IDs are from the column of Offer IDs.
I’d like to generate a new variable “Acceptor Points” which assigns the Points for the Acceptor IDs. The Acceptor Points is taken from the Points column with respect to the Acceptor IDs.
Ideally my dataset should look like this.
How would I go about coding the new variable “Acceptor Points”?
I’m stuck on a problem regarding generation of a new variable.
My original dataset looks like this.
Offer ID | Points | Accept ID |
3456 | 2 | |
6789 | 6 | 3456 |
5678 | 6 | |
8760 | 3 | 5678 |
5672 | 4 | 6789 |
I’d like to generate a new variable “Acceptor Points” which assigns the Points for the Acceptor IDs. The Acceptor Points is taken from the Points column with respect to the Acceptor IDs.
Ideally my dataset should look like this.
Offer ID | Points | Accept ID | Acceptor Points |
3456 | 2 | ||
6789 | 6 | 3456 | 2 |
5678 | 6 | ||
8760 | 3 | 5678 | 6 |
5672 | 4 | 6789 | 6 |
Comment