*Code to replicate the output and figure in Barriga Cabanillas, Michler, Michuda, and Tjernström use "adoption.dta", clear capture log close sjlog using sjout, replace randcoef lnp08 lnp10 lnp14, choice(icp08 icp10 icp14) /// controls(lns08 lnf08 lnc08 lnl08 lnhl08 lno08 lnrf08 sdrf08 gender08 hhsize08 dpr08 land08 offinc08 /// lns10 lnf10 lnc10 lnl10 lnhl10 lno10 lnrf10 sdrf10 gender10 hhsize10 dpr10 land10 offinc10 /// lns14 lnf14 lnc14 lnl14 lnhl14 lno14 lnrf14 sdrf14 gender14 hhsize14 dpr14 land14 offinc14 /// edu age blacksoil sandysoil mixedsoil lnmark ) meth(CRC) keep sjlog close, replace *Recover theta hat egen h1_bar = mean(icp08) egen h2_bar = mean(icp10) egen h3_bar = mean(icp14) egen h12_bar = mean(int_4) egen h13_bar = mean(int_5) egen h23_bar = mean(int_6) egen h123_bar = mean(int_7) gen l0 = -_b[l1]*h1_bar - _b[l2]*h2_bar - _b[l3]*h3_bar - _b[l4]*h12_bar - _b[l5]*h13_bar - _b[l6]*h23_bar - _b[l7]*h123_bar gen theta = l0 + _b[l1]*icp08 + _b[l2]*icp10 + _b[l3]*icp14 + _b[l4]*int_4 + _b[l5]*int_5 + _b[l6]*int_6 + _b[l7]*int_7 lab var theta "comparative advantage" sjlog using theta, replace gen theta1 = l0 + _b[l1]*0 + _b[l2]*0 + _b[l3]*0 + _b[l4]*0 + _b[l5]*0 + _b[l6]*0 + _b[l7]*0 lab var theta1 "never adopt" gen theta2 = l0 + _b[l1]*1 + _b[l2]*1 + _b[l3]*1 + _b[l4]*1 + _b[l5]*1 + _b[l6]*1 + _b[l7]*1 lab var theta2 "always adopt" gen theta3 = l0 + _b[l1]*0 + _b[l2]*1 + _b[l3]*1 + _b[l4]*0 + _b[l5]*0 + _b[l6]*1 + _b[l7]*0 lab var theta3 "early adopters" gen theta4 = l0 + _b[l1]*0 + _b[l2]*0 + _b[l3]*1 + _b[l4]*0 + _b[l5]*0 + _b[l6]*0 + _b[l7]*0 lab var theta4 "late adopters" gen theta5 = l0 + _b[l1]*1 + _b[l2]*0 + _b[l3]*0 + _b[l4]*0 + _b[l5]*0 + _b[l6]*0 + _b[l7]*0 lab var theta5 "early dis-adopters" gen theta6 = l0 + _b[l1]*1 + _b[l2]*1 + _b[l3]*0 + _b[l4]*1 + _b[l5]*0 + _b[l6]*0 + _b[l7]*0 lab var theta6 "late dis-adopters" gen theta7 = l0 + _b[l1]*1 + _b[l2]*0 + _b[l3]*1 + _b[l4]*0 + _b[l5]*1 + _b[l6]*0 + _b[l7]*0 lab var theta7 "mixed adopters" gen theta8 = l0 + _b[l1]*0 + _b[l2]*1 + _b[l3]*0 + _b[l4]*0 + _b[l5]*0 + _b[l6]*0 + _b[l7]*0 lab var theta8 "mixed dis-adopters" sjlog close, replace *graph bar (mean) theta1 (mean) theta2 (mean) theta3 (mean) theta4 (mean) theta5 /// * (mean) theta6 (mean) theta7 (mean) theta8 gen r1 = _b[b] + _b[phi]*theta1 lab var r1 "returns for never adopters" gen r2 = _b[b] + _b[phi]*theta2 lab var r2 "returns for always adopters" gen r3 = _b[b] + _b[phi]*theta3 lab var r3 "returns for early adopters" gen r4 = _b[b] + _b[phi]*theta4 lab var r4 "returns for late adopters" gen r5 = _b[b] + _b[phi]*theta5 lab var r5 "returns for early dis-adopters" gen r6 = _b[b] + _b[phi]*theta6 lab var r6 "returns for late dis-adopters" gen r7 = _b[b] + _b[phi]*theta7 lab var r7 "returns for mixed adopters" gen r8 = _b[b] + _b[phi]*theta8 lab var r8 "returns for mixed dis-adopters" sjlog using graph, replace graph bar (mean) r2 (mean) r3 (mean) r4 (mean) r7 (mean) r8 (mean) r6 (mean) /// r5 (mean) r1, bar(1, color(black)) bar(2, color(black*0.8)) /// bar(3, color(black*0.7)) bar(4, color(black*0.6)) bar(5, color(black*.5)) /// bar(6, color(black*0.4)) bar(7, color(black*0.3)) bar(8, color(black*0.2)) /// legend(on order(1 5 2 6 3 7 4 8) col(2) lab(1 "Always adopter") /// lab(2 "Early adopter") lab(3 "Late adopter") lab(4 "Mixed adopter") /// lab(5 "Mixed dis-adopter") lab(6 "Late dis-adopter") /// lab(7 "Early dis-adopter") lab(8 "Never adopter")) scheme(sj) sjlog close, replace graph export "returns.eps", as(eps) replace