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
export `sjlog` when error is included in the code I would like to put the following code: Code: sjlog using "${route_sjlog_files}\example_35" , rep…
having problem in recodingDear Statalist, I am facing problem in decoding string variable. For example, the following command…
Can my survivor function even look like this?The graph of my survivor function looks like this. I was wondering is that even reasonable? I learne…
Testing for heteroskedasticty using FE OLS and RE GLSHi everyone, I am currently trying to test for heteroskedasticity using an unbalanced panel and FE …
Merging several columns to categories of one variableHi, I have to merge the five columns (poor to excellent) as five categories of one variable health …
Subscribe to:
Post Comments (Atom)
0 Response to Generate new variable using a partner id
Post a Comment