/* ******************************************************************* LAST UPDATE: Oct 2018 THIS FILE DOES THE FOLLOWING 1) Expolores the WIOD data used in Doda, B. (2018). Tales from the tails: Sector-level carbon intensity distribution. Climate Change Economics, forthcoming. 2) Provides the empirical analysis, tables, figures behind Section 4 INPUT: data file which can be constructed following the instructions in Section 2. OUTPUT: various tables and graphs saved in "\doda2018_CCE_results" ******************************************************************* */ clear graph drop _all use "...\WIOD_data_oct2017.dta", replace cd "...\doda2018_CCE_S4results" drop if sector==35 drop if cou=="LUX" drop if cou=="CYP" drop if cou=="MLT" drop if year>2009 ********************************************************** ********************************************************** *PRODUCTIVITY BASED ON GROSS OUTPUT (see OECD manual 2000) xtset panelid year sort panelid year gene lab_shr=lab/go by panelid: gene labour_shr_bar=0.5*(lab_shr+l.lab_shr) by panelid: gene labour_gr=emp/l.emp gene cap_shr=cap/go by panelid: gene capital_shr_bar=0.5*(cap_shr+l.cap_shr) by panelid: gene capital_gr=k_gfcf/l.k_gfcf gene ii_shr=ii/go by panelid: gene ii_shr_bar=0.5*(ii_shr+l.ii_shr) by panelid: gene ii_gr=(ii/ii_p)/(l.ii/l.ii_p) gene comb=labour_gr^labour_shr_bar * capital_gr^capital_shr_bar * ii_gr^ii_shr_bar gene lmfp = log(go_qi / comb) gene mfp = go_qi / comb ********************************************************** ********************************************************** * EMP gene lemp=log(emp) gene lhour=log(h_emp) gene lhour_hs=log(h_emp*h_hs) gene lhour_ms=log(h_emp*h_ms) gene lhour_ls=log(h_emp*h_ls) * VA concepts: rename va va_ncu gene va_cncu=va_ncu/va_p*100 gene va_usd=va_ncu*exr sort country sector year by country sector: gene aux=va_usd if year==1995 by country sector: egen base=max(aux) by country sector: gene va_cusd=base*va_qi/100 drop aux base gene lva_cncu=log(va_cncu) gene lva_cusd=log(va_cusd) * CO2 gene lco2=log(co2) * emissions intensity gene int_cusd=(co2/va_cusd) gene int_cncu=(co2/va_cncu) gene lint_cusd=log(int_cusd) gene lint_cncu=log(int_cncu) * prod (labour productivity) gene prod_cusd=va_cusd/emp gene prod_cncu=va_cncu/emp gene lprod_cusd=log(va_cusd/emp) gene lprod_cncu=log(va_cncu/emp) ************************************************************************ * Rich and poor countries based on economy wide output per worker (2009) sort country year sector gene aux=lprod_cusd if sec==36 by country year: egen lopw_cusd=max(aux) drop aux sum lopw_cu if year==2009 & sec==36, d scalar med2009=r(p50) gene aux=0 replace aux=1 if lopw_cu>med2009 by country: egen rich=max(aux) drop aux * Rich and poor countries based on economy wide output per worker (1995) sum lopw_cu if year==1995 & sec==36, d scalar med1995=r(p50) gene aux=0 replace aux=1 if lopw_cu>med1995 by country: egen rich95=max(aux) drop aux * Rich and poor countries based on WB classficiation (1995) gene richWB95=rich replace richWB95=1 if cou=="PRT" *browse cou rich* if year==2009 & sec==36 ************************************************************************ * economy wide lmfp sort country year sector gene aux=lmfp if sec==36 by country year: egen lmfp_36=max(aux) drop aux * capital stock gene lk_cncu=log(k_gfcf) gene li_cncu=log(gfcf/gfcf_p*100) ** sort country sector year by country sector: gene aux=k_gfcf if year==1995 by country sector: egen base=max(aux) gene k_qi=k_gfcf/base*100 drop base aux gene k_usd=k_gfcf*exr by country sector: gene aux=k_usd if year==1995 by country sector: egen base=max(aux) by country sector: gene k_cusd=base*k_qi/100 drop aux base gene lk_cusd=log(k_cusd) gene lkint_cusd=lk_cusd-lemp gene lkint_cncu=lk_cncu-lemp gene kint_cusd=exp(lkint_cusd) * sector rankings within country each year by emp, int and emis * lowest of emp/co2/int get the smallest rank sort year country by year country: egen emp_rank=rank(emp) if sector~=36 by year country: egen co2_rank=rank(co2) if sector~=36 by year country: egen int_rank=rank(int_cncu) if sector~=36 by year country: egen prod_rank=rank(prod_cncu) if sector~=36 * average ranks (over time) sort country sector year by country sector: egen emp_arank=mean(emp_rank) if sector~=36 by country sector: egen co2_arank=mean(co2_rank) if sector~=36 by country sector: egen int_arank=mean(int_rank) if sector~=36 by country sector: egen prod_arank=mean(prod_rank) if sector~=36 sort year country by year country: egen emp_rtop=rank(emp_arank) if sector~=36 by year country: egen co2_rtop=rank(co2_arank) if sector~=36 by year country: egen int_rtop=rank(int_arank) if sector~=36, field by year country: egen prod_rtop=rank(prod_arank) if sector~=36 by year country: egen emp_rbot=rank(emp_arank) if sector~=36 by year country: egen co2_rbot=rank(co2_arank) if sector~=36 by year country: egen int_rbot=rank(int_arank) if sector~=36, track by year country: egen prod_rbot=rank(prod_arank) if sector~=36 **************************************************** * generate shares for key vars ***************************************************** *emissions sort year country sector by year country: gene aux=co2 if sector==36 by year country: egen co2_tot=max(aux) gene co2_share=co2/co2_tot drop aux *employment by year country: gene aux=emp if sector==36 by year country: egen emp_tot=max(aux) gene emp_share=emp/emp_tot drop aux *value added by year country: gene aux=va_ncu if sector==36 by year country: egen va_tot=max(aux) gene va_share=va_ncu/va_tot drop aux *k_stock by year country: gene aux=k_gfcf if sector==36 by year country: egen k_tot=max(aux) gene k_share=k_gfcf/k_tot drop aux *k_stock by year country: gene aux=gfcf if sector==36 by year country: egen i_tot=max(aux) gene i_share=gfcf/i_tot drop aux ************* * FACT 2 ************* gene dhci=0 gene dlci=0 sort country year sector by country year: replace dhci=1 if int_rtop<=5 by country year: replace dlci=1 if int_rbot<=5 * table HCI & LCI *TABLE 4(begin) * choose from {GBR,FRA,USA,JPN,CHN,BRA} local X JPN sort country year int_rtop list country desc1 int_cu co2_share va_share int_ara year if dhci==1 & year== 2009 & cou=="`X'" sum int_cusd if dhci==1 & year== 2009 & cou=="`X'" browse year country desc1 code co2_share va_share dhci dlci if dhci==1 & year==2009 & cou=="`X'" local X JPN sort country year int_rbot list country desc1 int_cu co2_share va_share int_ara year if dlci==1 & year== 2009 & cou=="`X'" sum int_cusd if dlci==1 & year== 2009 & cou=="`X'" browse year country desc1 code co2_share va_share dhci dlci if dlci==1 & year==2009 & cou=="`X'" *sort desc1 country year int_rtop *browse desc1 country year int_cusd int_rtop if (dhci==1) & year== 2009 *sort desc1 country year int_rbot *browse desc1 country year int_cusd int_rbot if (dlci==1) & year== 2009 *TABLE 4(end) ******************************************************************************* * Create Identifier for extreme country-sector-year observations * Defined as csy-observations which are more than 3 sy-stdev away from sy-mean * there are 33 such observations & ext_sec excludes the country-sectors which contain those observations sort sector year country by sector year: egen sy_mean=mean(int_cu) by sector year: egen sy_std=sd(int_cu) gene sy_up=sy_m+3*sy_s gene sy_down=sy_m-3*sy_s gene ext_obs=0 replace ext_obs=1 if int_cu>sy_up & int_cu~=. replace ext_obs=1 if int_cu