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
ado programming option helpHello Forum, I have successfully written a ado-command, unfortunately I have problem with one littl…
showing the significant star in the output of t-test using asdocHi, I am using asdoc command for the exporting the output and I have a question. I wonder how can we…
Specifying the start date of a generated time-series variableHi, What is the simplest method to count quarters from Feb 1972 to Apr 1993? I am generating a qua…
Specifying the start date of a generated time-seriesHi, What is the simplest method to count quarters from Feb 1972 to Apr 1993? I am generating a qua…
Treatment effect within a group. Implementation in Stata.Dear all, I have the following task. I want to estimate the effect of winning a particular auction o…
Subscribe to:
Post Comments (Atom)
0 Response to Generate new variable using a partner id
Post a Comment