Hello,
I have one dataset (called Natural Disaster) with three variables: Year, CountryCode, and TotalAffected. Since countries can have more than one natural disaster every year, there are often multiple entries with the same Year and CountryCode
I have one dataset (called Population) with many variables: one named CountryCode, and the rest corresponding to years (from 1980-2018). So each row of this dataset contains the country's code, and that country's population over the period 1980-2018.
I want to create a new variable, PercentageAffected, in the Natural Disaster dataset. This is equal to (TotalAffected/Population in that year and in that country).
To do that I would have to create a Population variable in the Natural Disaster dataset.
I'm not sure how to transfer the population data from my Population dataset into the Natural Disaster dataset, such that the new Population variable in the Natural Disaster dataset contains the value of the population corresponding to the correct CountryCode and Year.
I would appreciate help with this, and please let me know if this question was unclear. Thanks!
Related Posts with Combining two datasets on two variables.
Margins at the median and all the other variables at zero levelHello people, I have run my LOGIT regression and now I want to obtain the marginal effect at the me…
Restrict household with children age 7-23Hello all, i am currently doing my thesis using the data from IFLS. i want to estimate the effect of…
how to solve the problem of stata: error while loading shared libraries: libpng16.so.16: cannot open shared object file in linuxShown as above, I am a non-root user of a linux server, and cannot use sudo in linux server. After i…
Cohorte for the top 10 pct.Hi statalist, I have a dataset containing 10 variables and approx 1.000.000 observations. I want to…
How to find the level of intangible assets in different years?Good morning everybody. I would like to find the level of intangible assets in different years (simi…
Subscribe to:
Post Comments (Atom)
0 Response to Combining two datasets on two variables.
Post a Comment