Hi,
I have disaggregated data for more than 50 industries for more than 100 countries. The issue that I am facing is that I would like to have the column for my converted variable (value_added_perworker in logarithmic scale) for year 1980 next to the column for this converted variable in year 2018 ( I have attached a picture of my intended plan). The syntaxes I've applied so far are:
gen lval_per_worker_1980= lval_per_worker if year==1980
gen lval_per_worker_2018= lval_per_worker if year==2018
However, the columns for those years do not match and Stata reads them as "no observations" (though the observations exist). So far, I've tried exporting values in Excel and manually matching the columns. However, the process gets really tedious for so many countries, years and industries (isic)
Is there any way to address this issue?
Thanks,
I have disaggregated data for more than 50 industries for more than 100 countries. The issue that I am facing is that I would like to have the column for my converted variable (value_added_perworker in logarithmic scale) for year 1980 next to the column for this converted variable in year 2018 ( I have attached a picture of my intended plan). The syntaxes I've applied so far are:
gen lval_per_worker_1980= lval_per_worker if year==1980
gen lval_per_worker_2018= lval_per_worker if year==2018
However, the columns for those years do not match and Stata reads them as "no observations" (though the observations exist). So far, I've tried exporting values in Excel and manually matching the columns. However, the process gets really tedious for so many countries, years and industries (isic)
Is there any way to address this issue?
Thanks,
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input int(country year) str2 isic str3 isiccomb byte sourcecode long(Establishments Employment) double(Wages OutputINDSTAT4 ValueAdded GrossFixed) long FemaleEmployees float(val_per_worker lval_per_worker) 4 1973 "15" "15" 3 . 4321 . . . . . . . 4 1973 "16" "16" 3 . 0 . . . . . . . 4 1973 "17" "17" 3 . 12555 . . . . . . . 4 1973 "18" "18A" 3 . 725 . . . . . . . 4 1973 "19" "18A" 3 . . . . . . . . . 4 1973 "20" "20C" 3 . 1941 . . . . . . . 4 1973 "21" "21" 3 . 0 . . . . . . . 4 1973 "22" "22" 3 . 1287 . . . . . . . 4 1973 "23" "23" 3 . 0 . . . . . . . 4 1973 "24" "24" 3 . 259 . . . . . . . 4 1973 "25" "25" 3 . 360 . . . . . . . 4 1973 "26" "26" 3 . 1295 . . . . . . . 4 1973 "27" "27" 3 . 0 . . . . . . . 4 1973 "28" "28" 3 . 0 . . . . . . . 4 1973 "29" "29C" 3 . 0 . . . . . . . 4 1973 "30" "29C" 3 . . . . . . . . . 4 1973 "31" "31A" 3 . 0 . . . . . . . 4 1973 "32" "31A" 3 . . . . . . . . . 4 1973 "33" "33" 3 . 0 . . . . . . . 4 1973 "34" "34A" 3 . 0 . . . . . . . 4 1973 "35" "34A" 3 . . . . . . . . . 4 1973 "36" "20C" 3 . . . . . . . . . 4 1973 "D" "D" 3 . 22743 . . . . . . . 4 1974 "15" "15" 3 . 4845 . . . . . . . 4 1974 "16" "16" 3 . 0 . . . . . . . 4 1974 "17" "17" 3 . 14243 . . . . . . . 4 1974 "18" "18A" 3 . 720 . . . . . . . 4 1974 "19" "18A" 3 . . . . . . . . . 4 1974 "20" "20C" 3 . 2044 . . . . . . . 4 1974 "21" "21" 3 . 0 . . . . . . . 4 1974 "22" "22" 3 . 1326 . . . . . . . 4 1974 "23" "23" 3 . 0 . . . . . . . 4 1974 "24" "24" 3 . 3281 . . . . . . . 4 1974 "25" "25" 3 . 427 . . . . . . . 4 1974 "26" "26" 3 . 1235 . . . . . . . 4 1974 "27" "27" 3 . 0 . . . . . . . 4 1974 "28" "28" 3 . 0 . . . . . . . 4 1974 "29" "29C" 3 . 0 . . . . . . . 4 1974 "30" "29C" 3 . . . . . . . . . 4 1974 "31" "31A" 3 . 0 . . . . . . . 4 1974 "32" "31A" 3 . . . . . . . . . 4 1974 "33" "33" 3 . 0 . . . . . . . 4 1974 "34" "34A" 3 . 0 . . . . . . . 4 1974 "35" "34A" 3 . . . . . . . . . 4 1974 "36" "20C" 3 . . . . . . . . . 4 1974 "D" "D" 3 . 28121 . . . . . . . 4 1975 "15" "15" 3 . 5103 . . . . . . . 4 1975 "16" "16" 3 . 0 . . . . . . . 4 1975 "17" "17" 3 . 17202 . . . . . . . 4 1975 "18" "18A" 3 . 874 . . . . . . . 4 1975 "19" "18A" 3 . . . . . . . . . 4 1975 "20" "20C" 3 . 2321 . . . . . . . 4 1975 "21" "21" 3 . 0 . . . . . . . 4 1975 "22" "22" 3 . 1447 . . . . . . . 4 1975 "23" "23" 3 . 0 . . . . . . . 4 1975 "24" "24" 3 . 4046 . . . . . . . 4 1975 "25" "25" 3 . 507 . . . . . . . 4 1975 "26" "26" 3 . 1646 . . . . . . . 4 1975 "27" "27" 3 . 0 . . . . . . . 4 1975 "28" "28" 3 . 0 . . . . . . . 4 1975 "29" "29C" 3 . 0 . . . . . . . 4 1975 "30" "29C" 3 . . . . . . . . . 4 1975 "31" "31A" 3 . 0 . . . . . . . 4 1975 "32" "31A" 3 . . . . . . . . . 4 1975 "33" "33" 3 . 0 . . . . . . . 4 1975 "34" "34A" 3 . 0 . . . . . . . 4 1975 "35" "34A" 3 . . . . . . . . . 4 1975 "36" "20C" 3 . . . . . . . . . 4 1975 "D" "D" 3 . 33146 . . . . . . . 4 1976 "15" "15" 3 . 4540 . . . . . . . 4 1976 "16" "16" 3 . 0 . . . . . . . 4 1976 "17" "17" 3 . 20520 . . . . . . . 4 1976 "18" "18A" 3 . 840 . . . . . . . 4 1976 "19" "18A" 3 . . . . . . . . . 4 1976 "20" "20C" 3 . 2317 . . . . . . . 4 1976 "21" "21" 3 . 0 . . . . . . . 4 1976 "22" "22" 3 . 1465 . . . . . . . 4 1976 "23" "23" 3 . 0 . . . . . . . 4 1976 "24" "24" 3 . 4479 . . . . . . . 4 1976 "25" "25" 3 . 583 . . . . . . . 4 1976 "26" "26" 3 . 1335 . . . . . . . 4 1976 "27" "27" 3 . 0 . . . . . . . 4 1976 "28" "28" 3 . 0 . . . . . . . 4 1976 "29" "29C" 3 . 0 . . . . . . . 4 1976 "30" "29C" 3 . . . . . . . . . 4 1976 "31" "31A" 3 . 0 . . . . . . . 4 1976 "32" "31A" 3 . . . . . . . . . 4 1976 "33" "33" 3 . 0 . . . . . . . 4 1976 "34" "34A" 3 . 0 . . . . . . . 4 1976 "35" "34A" 3 . . . . . . . . . 4 1976 "36" "20C" 3 . . . . . . . . . 4 1976 "D" "D" 3 . 36079 . . . . . . . 4 1977 "15" "15" 3 . 6309 . . . . . . . 4 1977 "16" "16" 3 . 0 . . . . . . . 4 1977 "17" "17" 3 . 20540 . . . . . . . 4 1977 "18" "18A" 3 . 920 . . . . . . . 4 1977 "19" "18A" 3 . . . . . . . . . 4 1977 "20" "20C" 3 . 2240 . . . . . . . 4 1977 "21" "21" 3 . 0 . . . . . . . 4 1977 "22" "22" 3 . 1747 . . . . . . . end
Comment