hello everyone,
i have two datasets. lets call them A and B
The first one (A) includes many variables, the one of interest here is the birth year.
the second dataset (B) is just a list of years with coresponding values.
Is there any way to create a new variable in dataset A, which takes the value from B, if the variable birthyear from A matches the variable year from B ?
I could not find any topic with a similar problem, and already looked into the help section for merge and egen. Also tried to work with different frames. nothing worked.
Thanks.
i have two datasets. lets call them A and B
The first one (A) includes many variables, the one of interest here is the birth year.
| individual | ... | birth year |
| 1 | ... | 1960 |
| 2 | ... | 1996 |
| 3 | ... | 1982 |
| ... | ... | ... |
| 1000 | .. | 1968 |
the second dataset (B) is just a list of years with coresponding values.
| year | value |
| 1950 | 12 |
| 1951 | 11 |
| ... | ... |
| 1999 | 14 |
Is there any way to create a new variable in dataset A, which takes the value from B, if the variable birthyear from A matches the variable year from B ?
I could not find any topic with a similar problem, and already looked into the help section for merge and egen. Also tried to work with different frames. nothing worked.
Thanks.

Comment