Hello,
To merge, I need to make a specific identifier for each row as you can see below
I executed the code like this
"gen dyad_year=ccode1*1000000000 + ccode2*10000 + year"
What I expected to see in dyad_year for the first row is
2000201920
and the second row in dyad_year is
2000201921
and same for the remaining rows.
But, when I executed the code above, the results like this
I am wondering why my code does not work.
Thank you
To merge, I need to make a specific identifier for each row as you can see below
Code:
clear ccode1 ccode2 year dyad 2 20 1920 2020 2 20 1921 2020 2 20 1922 2020 2 20 1923 2020 2 20 1924 2020 end
"gen dyad_year=ccode1*1000000000 + ccode2*10000 + year"
What I expected to see in dyad_year for the first row is
2000201920
and the second row in dyad_year is
2000201921
and same for the remaining rows.
But, when I executed the code above, the results like this
Code:
ccode1 ccode2 year dyad dyad_year 2 20 1920 2020 2000201984 2 20 1921 2020 2000201984 2 20 1922 2020 2000201984 2 20 1923 2020 2000201984 2 20 1924 2020 2000201984 end
I am wondering why my code does not work.
Thank you
Comment