Hello Everyone.
I have a panel dataset with price indexes for different sectors and countries, across years. So it is a 3 dimensional panel which I can easily make a two dimensional panel by grouping. The issue is some sectors are broad 2-digit classifications eg 10, while some have 4-digit classifications eg 1011 or 3-digit classifications eg 103. I want to replace the price index of a 2-digit or 3-digit sector with the price index of a 4-digit sector by country. So for instance, if price index of sector 10 = 100, price index of sector 103 = 100.1 and price index of sector 1011 = 105 for Mexico, then I would like all the indexes to be set to 105 for Mexico. I have four variables that I would like to do this replacement for based on the sector codes and the only condition is that the first two numbers must be a match. So for instance, I can assign the values of sector 10 to sector 1011, but not the values of sector 11 to 1011.
Any help I can get is appreciated.
I have a panel dataset with price indexes for different sectors and countries, across years. So it is a 3 dimensional panel which I can easily make a two dimensional panel by grouping. The issue is some sectors are broad 2-digit classifications eg 10, while some have 4-digit classifications eg 1011 or 3-digit classifications eg 103. I want to replace the price index of a 2-digit or 3-digit sector with the price index of a 4-digit sector by country. So for instance, if price index of sector 10 = 100, price index of sector 103 = 100.1 and price index of sector 1011 = 105 for Mexico, then I would like all the indexes to be set to 105 for Mexico. I have four variables that I would like to do this replacement for based on the sector codes and the only condition is that the first two numbers must be a match. So for instance, I can assign the values of sector 10 to sector 1011, but not the values of sector 11 to 1011.
Any help I can get is appreciated.
Comment