Dear group,
I have a question about looping over two tables. In my first table, I have a list of individuals for which I have the age, country of residence, gender and year of interview (I've inserted the first five observations below). In the second table, I have the official retirement ages for each year, country and gender. (I've inserted 5 retirement ages below)
In the first table, I created a variable called official retirement age.
What I have to do is to go through each individual in the first table and see if for the 4 variables (age, country, gender and year) there is a match with the second table. If yes, then I want to take the official retirement age from the second table and put it into the retirement age variable for that individual in the first table.
I understand that I have to do 2 loops, one that loops over the individuals and another one inside this loop that loops over the variables and if they match in the two tables, take the retirement age from the second table to the first table. Unfortunately, I don't know how to write this in code.
Could anyone help me with it?
Thank you in advance,
Rita Samudra
Related Posts with Looping over two tables
Which model to use? Panel Data Fixed-Effects ModelDear members! I am running a log-log model (almost all variables are in logs) with panel data of T=…
generate a new variable that takes on the value of a separate variableI have data that are long. I would like to generate a new variable that takes on the value of a sepa…
esttabDear Researchers, I am using the generalized DID model and the code is below: Code: xtreg perf i.Ev…
ppml_panel_sg : Ramsey RESET testHi, How can I evaluate the Ramsey RESET test if I am using the ppml_panel_sg estimator: ppml_panel…
marginsplot (interaction plot) change marker position or symbolsHello all, I would like to seek help in margins plot. I searched the forum but could not find the a…
Subscribe to:
Post Comments (Atom)
0 Response to Looping over two tables
Post a Comment