Hey everyone,
I need your help on how to merge the 2 waves of the WB's Enterprise survey for The Gambia. The waves in question are the 2018 and 2023. the 2023 contains 74 firms that were part of the 2018 dataset. So i want to be able to construct a short panel where firms from 2018 will be merged with those in the 2023. However, my main problem has been that the ID and IDSTD are different in the datasets. But i was able to get the ISIC rev 3 codes (mprod) and the fact that a variable stratificationpanelcode has been defined such that all firms for the year of the wave are coded fresh and if from a previous round are coded panel. So i am able to identify the 74 firms even without matching by simply observing this variable. I have tried using a one to one merge by generating a merge key in both datasets which uses the mprod and stratificationpanelcode to construct it vis gen merge_key_2018 = mprod + Stratificationpanelcode*10000.
After doing this in both datasets. then I merge using
merge 1:1 merge_key_2018 using "C:\Users\User\Desktop\dataset_2023_with_keys. dta" , keepusing(merge_key_2023)
This keeps returning variable merge_key_2018 not found r(111);
Even though the variable is in my dataset.
Is there something that i am missing that could explain what is happening?
I need your help on how to merge the 2 waves of the WB's Enterprise survey for The Gambia. The waves in question are the 2018 and 2023. the 2023 contains 74 firms that were part of the 2018 dataset. So i want to be able to construct a short panel where firms from 2018 will be merged with those in the 2023. However, my main problem has been that the ID and IDSTD are different in the datasets. But i was able to get the ISIC rev 3 codes (mprod) and the fact that a variable stratificationpanelcode has been defined such that all firms for the year of the wave are coded fresh and if from a previous round are coded panel. So i am able to identify the 74 firms even without matching by simply observing this variable. I have tried using a one to one merge by generating a merge key in both datasets which uses the mprod and stratificationpanelcode to construct it vis gen merge_key_2018 = mprod + Stratificationpanelcode*10000.
After doing this in both datasets. then I merge using
merge 1:1 merge_key_2018 using "C:\Users\User\Desktop\dataset_2023_with_keys. dta" , keepusing(merge_key_2023)
This keeps returning variable merge_key_2018 not found r(111);
Even though the variable is in my dataset.
Is there something that i am missing that could explain what is happening?
Comment