Hi there
I have a panel dataset comprised of yearly observations of import values for different countries. These import values are refined to different product codes (HS codes) in order to differentiate between different products which have been imported.
I have added another variable which determines whether the product in each observation is either an "Intermediate good", a "capital good" or a "final good".
I want to group countries based on which category they imported most of for that year.
I thought generating dummy variables was the best way to go about this but I'm not too sure how I can achieve that. It seems like it would involve many conditions and a mixture of variables so I'm not too sure where to start.
As an example, I am hoping to capture the dummy like this:
The dummy should take the relevant value, IF Spain's value of imports in 2018 was largest in "intermediate goods".
And if France's value of imports in 2019 was largest in "final goods", they should take that relevant dummy value.
Thank you in advance, any help would be much appreciated.
James
I have a panel dataset comprised of yearly observations of import values for different countries. These import values are refined to different product codes (HS codes) in order to differentiate between different products which have been imported.
I have added another variable which determines whether the product in each observation is either an "Intermediate good", a "capital good" or a "final good".
I want to group countries based on which category they imported most of for that year.
I thought generating dummy variables was the best way to go about this but I'm not too sure how I can achieve that. It seems like it would involve many conditions and a mixture of variables so I'm not too sure where to start.
As an example, I am hoping to capture the dummy like this:
The dummy should take the relevant value, IF Spain's value of imports in 2018 was largest in "intermediate goods".
And if France's value of imports in 2019 was largest in "final goods", they should take that relevant dummy value.
Thank you in advance, any help would be much appreciated.
James