Hi Statalists,

I have a problem that doesn't seem to be quite the same as all the other examples that I can find around it. I hope that someone can help.

I have a dataset:
id wave age partnerid
001 1 50 002
001 2 51 002
001 3 52 002
002 1 36 001
002 2 37 001
002 3 38 001
003 2 19 .
003 3 20 005
003 4 21 005
004 2 70 .
005 3 18 003
005 4 19 003

I need to create a new variable "age_partner" which records the age of the partner in each line.
For example:

id wave age partnerid age_partner
001 1 50 002 36
001 2 51 002 37
001 3 52 002 38

I want to be able to repeat this for several variables including gender and income.
If anyone can help, I will be very grateful.
Many thanks in advance.

Grace