Hi All,
I am working with the input output tables. With (Andrew's) help, I managed to transform the dataset from matrix to long format. However, now I am trying to link BEA industry codes to NAICS and managed to do that mapping.
Since I wan to see how much one industry uses from another and vice-versa, I want to do two things.
1) BEA (code_supplier) to NAICS (naics_supplier) - how many NAICS codes are linked to BEA. For that, I created the tag and wanted variables. However, I want to sum the values column if there is 1 NAICS linked to multiple BEA codes. I am not sure how to achieve that. Is there a way to see such cases?
2) I want to produce values for each unique industry pair and how to see these pairs stacked over one another. For instance - soybean farming supplier (NAICS 111110) supplying to wheat farming user (NAICS 111140) is 455 and vice versa (wheat farming supplying to soybean farming is how much?). I want to produce unique pairwise combinations of buyers and sellers along with their values. I am not sure how to obtain this result. My dataset currently looks like this. I only want to have three columns based on the dataset (using NAICS) buyers, sellers, and value.
Thanks for your help in advance!
Preety
I am working with the input output tables. With (Andrew's) help, I managed to transform the dataset from matrix to long format. However, now I am trying to link BEA industry codes to NAICS and managed to do that mapping.
Since I wan to see how much one industry uses from another and vice-versa, I want to do two things.
1) BEA (code_supplier) to NAICS (naics_supplier) - how many NAICS codes are linked to BEA. For that, I created the tag and wanted variables. However, I want to sum the values column if there is 1 NAICS linked to multiple BEA codes. I am not sure how to achieve that. Is there a way to see such cases?
2) I want to produce values for each unique industry pair and how to see these pairs stacked over one another. For instance - soybean farming supplier (NAICS 111110) supplying to wheat farming user (NAICS 111140) is 455 and vice versa (wheat farming supplying to soybean farming is how much?). I want to produce unique pairwise combinations of buyers and sellers along with their values. I am not sure how to obtain this result. My dataset currently looks like this. I only want to have three columns based on the dataset (using NAICS) buyers, sellers, and value.
Code:
* Example generated by -dataex-. For more info, type help dataex clear input str6 code_supplier str96 description_supplier str6 code_user str96 description_user str119 naics_title_supplier long naics_supplier str6 naics_user strL naics_title_user long(value total_output_user) byte(tag wanted) "S00401" "Scrap" "4200ID" "Customs duties" "" . "" "" 0 38513 0 0 "S00300" "Noncomparable imports" "4200ID" "Customs duties" "" . "" "" 0 38513 0 0 "S00402" "Used and secondhand goods" "4200ID" "Customs duties" "" . "" "" 0 38513 0 0 "S00900" "Rest of the world adjustment" "4200ID" "Customs duties" "" . "" "" 0 38513 0 0 "4200ID" "Customs duties" "4200ID" "Customs duties" "" . "" "" 0 38513 0 0 "4200ID" "Customs duties" "1111A0" "Oilseed farming" "" . "111110" "Soybean Farming" 0 38216 0 0 "S00402" "Used and secondhand goods" "1111A0" "Oilseed farming" "" . "111110" "Soybean Farming" 0 38216 0 0 "S00900" "Rest of the world adjustment" "1111A0" "Oilseed farming" "" . "111110" "Soybean Farming" 0 38216 0 0 "S00300" "Noncomparable imports" "1111A0" "Oilseed farming" "" . "111110" "Soybean Farming" 111 38216 0 0 "S00401" "Scrap" "1111A0" "Oilseed farming" "" . "111110" "Soybean Farming" 0 38216 0 0 "S00900" "Rest of the world adjustment" "1111A0" "Oilseed farming" "" . "111120" "Oilseed (except Soybean) Farming " 0 38216 0 0 "4200ID" "Customs duties" "1111A0" "Oilseed farming" "" . "111120" "Oilseed (except Soybean) Farming " 0 38216 0 0 "S00300" "Noncomparable imports" "1111A0" "Oilseed farming" "" . "111120" "Oilseed (except Soybean) Farming " 111 38216 0 0 "S00401" "Scrap" "1111A0" "Oilseed farming" "" . "111120" "Oilseed (except Soybean) Farming " 0 38216 0 0 "S00402" "Used and secondhand goods" "1111A0" "Oilseed farming" "" . "111120" "Oilseed (except Soybean) Farming " 0 38216 0 0 "4200ID" "Customs duties" "1111B0" "Grain farming" "" . "111130" "Dry Pea and Bean Farming " 0 57882 0 0 "S00401" "Scrap" "1111B0" "Grain farming" "" . "111130" "Dry Pea and Bean Farming " 0 57882 0 0 "S00900" "Rest of the world adjustment" "1111B0" "Grain farming" "" . "111130" "Dry Pea and Bean Farming " 0 57882 0 0 "S00402" "Used and secondhand goods" "1111B0" "Grain farming" "" . "111130" "Dry Pea and Bean Farming " 0 57882 0 0 "S00300" "Noncomparable imports" "1111B0" "Grain farming" "" . "111130" "Dry Pea and Bean Farming " 371 57882 0 0 end
Preety
Comment