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
Related Posts with Generate new variable using a partner id
Panel Data StandardizationHello, I want to standardize my independent variable before running the regression. I have a panel …
Too Many ValuesHi all, I'm working with a dataset with around 350.000 rows and 20 columns. When I try to encode so…
How can I omit one factor variable from log file?Hello everyone! I have a log file of regress with factor (categorical) variable (i.variable). This f…
Overlay non-twoway graphsHi Statalisters, I would like to overlay two non-twoway type graphs - e.g., graph dot and graph hba…
Power, graph delta as vertical axis but as a share of baseline take-up rateI am running power calculations and I'm graphing the output with the delta on the vertical axis. C…
Subscribe to:
Post Comments (Atom)
0 Response to Generate new variable using a partner id
Post a Comment