Hi everyone,
I have a trade dataset by firm, product and destination. I would like to replicate the same product-destination pairs for each firm. My data is not rectangular so that's why I can't use the fillin command.
Please find below a hypothetical example of my data:
And this is a hypothetical example from the product-destination data that I would like to replicate for each firm (and I have them in a separate dataset):
And this is the end result that I would like to have:
I would be grateful if you could advise on how to do this. Please note that my data is not rectangular so I can't use the fillin command.
Many thanks in advance.
I have a trade dataset by firm, product and destination. I would like to replicate the same product-destination pairs for each firm. My data is not rectangular so that's why I can't use the fillin command.
Please find below a hypothetical example of my data:
Code:
* Example generated by -dataex-. For more info, type help dataex clear input byte(firm product) str3 destination 1 1 "EGY" 1 1 "LYB" 1 1 "PSE" 2 1 "EGY" 3 1 "LYB" 1 2 "TUR" 1 2 "FRA" 1 2 "SPA" 2 2 "TUR" 3 2 "TUR" end
Code:
* Example generated by -dataex-. For more info, type help dataex clear input byte product str3 destination 1 "EGY" 1 "LYB" 1 "PSE" 2 "TUR" 2 "FRA" 2 "SPA" end
Code:
* Example generated by -dataex-. For more info, type help dataex clear input byte(firm product) str3 destination 1 1 "EGY" 1 1 "LYB" 1 1 "PSE" 2 1 "EGY" 2 1 "LYB" 2 1 "PSE" 3 1 "EGY" 3 1 "LYB" 3 1 "PSE" 1 2 "TUR" 1 2 "FRA" 1 2 "SPA" 2 2 "TUR" 2 2 "FRA" 2 2 "SPA" 3 2 "TUR" 3 2 "FRA" 3 2 "SPA" end
I would be grateful if you could advise on how to do this. Please note that my data is not rectangular so I can't use the fillin command.
Many thanks in advance.
Comment