Hi Dear Profs and colleagues,
Thank you so much for the assistance you have done so far, I really appreciated the time you take to guide, solve and help us.
My question has 2 sections.
Section A:
I have two dataset
First one is the total number of new arriving immigrants from source country K at time t (decennial: 1960-1970-1990-2000-2010)
The second dataset is the immigrant share from source country K, which was in skill group ij (Expgroup sk_rat_qurtile) in 1960.
Target is: multiplying IMshare by new_arrive
To reach this end:
As you can see, 5111* 0.0 = 123.73
Probably, I made a mistake in my assumptions or .....
Do you have any ideas what can be my mistake?
Section B:
The second part of my question:
After obtaining "Predicted_no" in the previous section, I am going to divide it by the total number of workers in a given skill group at t-10. The question is what is t-10 and how can I do that?
Any ideas or suggestions are appreciated.
Cheers,
Paris
Thank you so much for the assistance you have done so far, I really appreciated the time you take to guide, solve and help us.
My question has 2 sections.
Section A:
I have two dataset
First one is the total number of new arriving immigrants from source country K at time t (decennial: 1960-1970-1990-2000-2010)
Code:
use data_1 input str21 Country int Year long new_arrive "FR" 2010 5111 "FR" 2011 5293 "FR" 2012 5201 "FR" 2013 5268 "FR" 2014 6541 "FR" 2015 8440 "FR" 2016 11293 "FR" 2017 15319 "FR" 2018 19771 "FR" 2019 23125 "FR" 2020 24935 "FR" 2021 26719 "IT" 2010 5067 "IT" 2011 5338 "IT" 2012 5222 "IT" 2013 5121 "IT" 2014 5328 "IT" 2015 6130 "IT" 2016 8523 "IT" 2017 12925 "IT" 2018 18862 "IT" 2019 25408 "IT" 2020 28159 "IT" 2021 30819 "AN" 2010 23233 "AN" 2011 21329 "AN" 2012 19873 "AN" 2013 19967 "AN" 2014 19478 "AN" 2015 18088 "AN" 2016 16876 "AN" 2017 16764 "AN" 2018 18310 "AN" 2019 22592 "AN" 2020 24409 "AN" 2021 25751 "CV" 2010 43510 "CV" 2011 43475 "CV" 2012 42388 "CV" 2013 42011 "CV" 2014 40563 "CV" 2015 38346 "CV" 2016 36193 "CV" 2017 34706 "CV" 2018 34444 "CV" 2019 37110 "CV" 2020 36466 "CV" 2021 33988 "GB" 2010 19304 "GB" 2011 18131 "GB" 2012 17462 "GB" 2013 17574 "GB" 2014 17728 "GB" 2015 16817 "GB" 2016 15306 "GB" 2017 14951 "GB" 2018 15960 "GB" 2019 18780 "GB" 2020 19664 "GB" 2021 20346 "MO" 2010 3109 "MO" 2011 2995 "MO" 2012 2901 "MO" 2013 2825 "MO" 2014 2813 "MO" 2015 2787 "MO" 2016 2823 "MO" 2017 2814 "MO" 2018 2999 "MO" 2019 3488 "MO" 2020 3675 "MO" 2021 3795 "ST" 2010 10175 "ST" 2011 10274 "ST" 2012 10174 "ST" 2013 10169 "ST" 2014 10028 "ST" 2015 9405 "ST" 2016 8840 "ST" 2017 8478 "ST" 2018 9023 "ST" 2019 10078 "ST" 2020 10646 "ST" 2021 11176 "BR" 2010 119195 "BR" 2011 111295 "BR" 2012 105518 "BR" 2013 91238 "BR" 2014 85288 "BR" 2015 80515 "BR" 2016 79569 "BR" 2017 83061 "BR" 2018 104504 "BR" 2019 150919 "BR" 2020 183875 "BR" 2021 204669 "CH" 2010 15600 "CH" 2011 16595 "CH" 2012 17186 "CH" 2013 18445 end
Code:
use data_2 input str2 Country float Expgroup byte sk_rat_quartile float IMshare "AN" 2 1 .10526316 "AN" 2 2 .05263158 "AN" 3 1 .05263158 "AN" 3 3 .02631579 "AN" 3 4 .05263158 "AN" 4 1 .07894737 "AN" 4 2 .02631579 "AN" 4 4 .02631579 "AN" 5 1 .02631579 "AN" 5 2 .05263158 "AN" 5 3 .02631579 "AN" 5 4 .07894737 "AN" 6 1 .07894737 "AN" 6 2 .05263158 "AN" 6 3 .02631579 "AN" 6 4 .02631579 "AN" 7 1 .07894737 "AN" 7 2 .02631579 "AN" 7 3 .02631579 "AN" 8 1 .02631579 "AN" 8 3 .02631579 "AN" 8 4 .02631579 "BR" 1 1 .02838454 "BR" 1 2 .029344695 "BR" 1 3 .0256241 "BR" 1 4 .005040807 "BR" 2 1 .081253 "BR" 2 2 .06277005 "BR" 2 3 .05142823 "BR" 2 4 .014402305 "BR" 3 1 .10783725 "BR" 3 2 .07459193 "BR" 3 3 .04860778 "BR" 3 4 .015722515 "BR" 4 1 .09115458 "BR" 4 2 .05244839 "BR" 4 3 .02994479 "BR" 4 4 .012542007 "BR" 5 1 .06018963 "BR" 5 2 .03612578 "BR" 5 3 .017342774 "BR" 5 4 .009301488 "BR" 6 1 .04086654 "BR" 6 2 .02262362 "BR" 6 3 .009661546 "BR" 6 4 .007081133 "BR" 7 1 .0243639 "BR" 7 2 .011461833 "BR" 7 3 .004740758 "BR" 7 4 .0044407104 "BR" 8 1 .011041767 "BR" 8 2 .004800768 "BR" 8 3 .00300048 "BR" 8 4 .0018602976 "CH" 1 1 .015873017 "CH" 1 2 .04761905 "CH" 1 3 .031746034 "CH" 1 4 .031746034 "CH" 2 1 .031746034 "CH" 2 2 .071428575 "CH" 2 3 .05555556 "CH" 2 4 .023809524 "CH" 3 1 .007936508 "CH" 3 2 .0952381 "CH" 3 3 .007936508 "CH" 3 4 .023809524 "CH" 4 2 .0873016 "CH" 4 3 .03968254 "CH" 4 4 .015873017 "CH" 5 1 .015873017 "CH" 5 2 .1031746 "CH" 5 3 .031746034 "CH" 5 4 .023809524 "CH" 6 2 .05555556 "CH" 6 3 .03968254 "CH" 6 4 .031746034 "CH" 7 1 .015873017 "CH" 7 2 .023809524 "CH" 7 4 .031746034 "CH" 8 1 .015873017 "CH" 8 2 .015873017 "CH" 8 4 .007936508 "CV" 1 1 .04908464 "CV" 1 2 .0379411 "CV" 1 3 .02892014 "CV" 1 4 .006633059 "CV" 2 1 .067922525 "CV" 2 2 .05386044 "CV" 2 3 .040329 "CV" 2 4 .010612895 "CV" 3 1 .06659591 "CV" 3 2 .029450784 "CV" 3 3 .016715309 "CV" 3 4 .007959671 "CV" 4 1 .080658 "CV" 4 2 .02600159 "CV" 4 3 .008755638 "CV" 4 4 .00557177 "CV" 5 1 .09312815 "CV" 5 2 .02467498 end
Code:
g Predicted_no=IMshare*new_arrive
Code:
use data_1
joinby Country using data_2
g Predicted_no=IMshare*new_arrive
. list if Country=="FR"
+------------------------------------------------------------------------------+
| Country Year new_ar~e Expgroup sk_rat~e share IMshare Predic~o |
|------------------------------------------------------------------------------|
1. | FR 2010 5111 1 3 26 0.0 123.73 |
2. | FR 2010 5111 3 3 46 0.0 218.9069 |
3. | FR 2010 5111 1 1 21 0.0 99.93575 |
4. | FR 2010 5111 6 4 21 0.0 99.93575 |
5. | FR 2010 5111 2 3 41 0.0 195.1127 |
|------------------------------------------------------------------------------|
6. | FR 2010 5111 2 2 35 0.0 166.5596 |
7. | FR 2010 5111 3 4 76 0.1 361.6722 |
8. | FR 2010 5111 8 1 4 0.0 19.03538 |
9. | FR 2010 5111 8 2 7 0.0 33.31192 |
10. | FR 2010 5111 7 2 6 0.0 28.55307 |
|------------------------------------------------------------------------------|
11. | FR 2010 5111 7 4 16 0.0 76.14153 |
12. | FR 2010 5111 5 2 32 0.0 152.2831 |
13. | FR 2010 5111 4 3 41 0.0 195.1127 |
14. | FR 2010 5111 3 1 65 0.1 309.325 |
15. | FR 2010 5111 7 1 5 0.0 23.79423 |
|------------------------------------------------------------------------------|
16. | FR 2010 5111 8 3 7 0.0 33.31192 |
17. | FR 2010 5111 4 1 92 0.1 437.8138 |
18. | FR 2010 5111 3 2 67 0.1 318.8427 |
19. | FR 2010 5111 2 1 30 0.0 142.7654 |
20. | FR 2010 5111 6 1 33 0.0 157.0419 |
|------------------------------------------------------------------------------|
21. | FR 2010 5111 8 4 10 0.0 47.58846 |
22. | FR 2010 5111 5 1 72 0.1 342.6369 |
23. | FR 2010 5111 1 2 25 0.0 118.9711 |
24. | FR 2010 5111 6 2 12 0.0 57.10614 |
25. | FR 2010 5111 5 4 39 0.0 185.595 |
|------------------------------------------------------------------------------|
26. | FR 2010 5111 4 2 54 0.1 256.9777 |
27. | FR 2010 5111 4 4 66 0.1 314.0838 |
28. | FR 2010 5111 7 3 7 0.0 33.31192 |
29. | FR 2010 5111 6 3 11 0.0 52.3473 |
30. | FR 2010 5111 1 4 23 0.0 109.4535 |
|------------------------------------------------------------------------------|
31. | FR 2010 5111 5 3 37 0.0 176.0773 |
32. | FR 2010 5111 2 4 47 0.0 223.6657 |
33. | FR 2011 5293 5 4 39 0.0 192.2039 |
34. | FR 2011 5293 7 4 16 0.0 78.85289 |
35. | FR 2011 5293 8 4 10 0.0 49.28305 |
|------------------------------------------------------------------------------|
36. | FR 2011 5293 4 3 41 0.0 202.0605 |
37. | FR 2011 5293 8 3 7 0.0 34.49814 |
38. | FR 2011 5293 8 1 4 0.0 19.71322 |
39. | FR 2011 5293 5 2 32 0.0 157.7058 |
40. | FR 2011 5293 4 2 54 0.1 266.1285 |
|------------------------------------------------------------------------------|
41. | FR 2011 5293 1 2 25 0.0 123.2076 |
42. | FR 2011 5293 7 3 7 0.0 34.49814 |
43. | FR 2011 5293 6 4 21 0.0 103.4944 |
44. | FR 2011 5293 8 2 7 0.0 34.49814 |
45. | FR 2011 5293 2 2 35 0.0 172.4907 |
|------------------------------------------------------------------------------|
46. | FR 2011 5293 5 3 37 0.0 182.3473 |
47. | FR 2011 5293 3 1 65 0.1 320.3398 |
48. | FR 2011 5293 4 1 92 0.1 453.4041 |
49. | FR 2011 5293 4 4 66 0.1 325.2682 |
50. | FR 2011 5293 2 4 47 0.0 231.6303 |
|------------------------------------------------------------------------------|
51. | FR 2011 5293 6 3 11 0.0 54.21136 |
52. | FR 2011 5293 2 3 41 0.0 202.0605 |
53. | FR 2011 5293 1 4 23 0.0 113.351 |
54. | FR 2011 5293 6 2 12 0.0 59.13966 |
55. | FR 2011 5293 3 4 76 0.1 374.5512 |
|------------------------------------------------------------------------------|
56. | FR 2011 5293 3 3 46 0.0 226.7021 |
57. | FR 2011 5293 1 3 26 0.0 128.1359 |
58. | FR 2011 5293 5 1 72 0.1 354.838 |
59. | FR 2011 5293 7 1 5 0.0 24.64153 |
60. | FR 2011 5293 3 2 67 0.1 330.1965 |
|------------------------------------------------------------------------------|
61. | FR 2011 5293 6 1 33 0.0 162.6341 |
62. | FR 2011 5293 2 1 30 0.0 147.8492 |
63. | FR 2011 5293 1 1 21 0.0 103.4944 |
64. | FR 2011 5293 7 2 6 0.0 29.56983 |
65. | FR 2012 5201 6 3 11 0.0 53.26909 |
|------------------------------------------------------------------------------|
66. | FR 2012 5201 4 2 54 0.1 261.5028 |
67. | FR 2012 5201 7 1 5 0.0 24.21322 |
68. | FR 2012 5201 8 3 7 0.0 33.89851 |
69. | FR 2012 5201 7 4 16 0.0 77.48231 |
70. | FR 2012 5201 8 2 7 0.0 33.89851 |
|------------------------------------------------------------------------------|
71. | FR 2012 5201 5 4 39 0.0 188.8631 |
72. | FR 2012 5201 6 4 21 0.0 101.6955 |
73. | FR 2012 5201 2 4 47 0.0 227.6043 |
74. | FR 2012 5201 3 1 65 0.1 314.7719 |
75. | FR 2012 5201 7 3 7 0.0 33.89851 |
|------------------------------------------------------------------------------|
76. | FR 2012 5201 4 3 41 0.0 198.5484 |
77. | FR 2012 5201 7 2 6 0.0 29.05586 |
78. | FR 2012 5201 2 3 41 0.0 198.5484 |
79. | FR 2012 5201 4 4 66 0.1 319.6145 |
80. | FR 2012 5201 5 2 32 0.0 154.9646 |
|------------------------------------------------------------------------------|
Probably, I made a mistake in my assumptions or .....
Do you have any ideas what can be my mistake?
Section B:
The second part of my question:
After obtaining "Predicted_no" in the previous section, I am going to divide it by the total number of workers in a given skill group at t-10. The question is what is t-10 and how can I do that?
Any ideas or suggestions are appreciated.
Cheers,
Paris

Comment