#delimit; clear _all; set memory 60m; use FILEPATH:\TIB.dta; log using FILEPATH:\humanrights_ISQ.log, replace ; regr demaut W S; quietly; predict demres, residual; sort ccode year; by ccode: replace x=year-year[_n-1]; keep if x>0 & x~=.; /*replace ai=ai3; drop ai2 ai3;*/ tsset ccode year; gen lag_ai=L1.ai; regr lgdp W S; predict incres, residual; gen autonW=auton*W; gen autondem=auton*demaut; tsset, clear; noisily; replace xconst2=xconst; replace xrcomp2=xrcomp; replace xropen2=xropen; replace parreg2=parreg; replace parcomp2=parcomp; quietly; gen civilwar=0; replace civilwar=1 if CL_WAR==1; replace IS_WAR=0 if IS_WAR==.; gen transition=(xconst2<0); replace transition=. if xconst2==.; replace xconst2=. if xconst2<0; replace xrcomp2=. if xrcomp2<0; replace xropen2=. if xropen2<0; replace parcomp2=. if parcomp2<0; replace parreg2=. if parreg2<0; gen con1=0; replace con1=1 if xconst2==(1); replace con1=. if xconst2==.; gen con2=0; replace con2=1 if xconst2==(2); replace con2=. if xconst2==.; gen con3=0; replace con3=1 if xconst2==(3); replace con3=. if xconst2==.; gen con4=0; replace con4=1 if xconst2==(4); replace con4=. if xconst2==.; gen con5=0; replace con5=1 if xconst2==(5); replace con5=. if xconst2==.; gen con6=0; replace con6=1 if xconst2==(6); replace con6=. if xconst2==.; gen com1=0; replace com1=1 if xrcomp2==(1); replace com1=. if xrcomp2==.; gen com2=0; replace com2=1 if xrcomp2==(2); replace com2=. if xrcomp2==.; gen com3=0; replace com3=1 if xrcomp2==(3); replace com3=. if xrcomp2==.; gen open1=0; replace open1=1 if xropen2==(1); replace open1=. if xropen2==.; gen open2=0; replace open2=1 if xropen2==(2); replace open2=. if xropen2==.; gen open3=0; replace open3=1 if xropen2==(3); replace open3=. if xropen2==.; gen open4=0; replace open4=1 if xropen2==(4); replace open4=. if xropen2==.; gen par1=0; replace par1=1 if parcomp2==(1); replace par1=. if parcomp2==.; gen par2=0; replace par2=1 if parcomp2==(2); replace par2=. if parcomp2==.; gen par3=0; replace par3=1 if parcomp2==(3); replace par3=. if parcomp2==.; gen par4=0; replace par4=1 if parcomp2==(4); replace par4=. if parcomp2==.; gen par5=0; replace par5=1 if parcomp2==(5); replace par5=. if parcomp2==.; gen preg1=0; replace preg1=1 if parreg2==(1); replace preg1=. if parreg2==.; gen preg2=0; replace preg2=1 if parreg2==(2); replace preg2=. if parreg2==.; gen preg3=0; replace preg3=1 if parreg2==(3); replace preg3=. if parreg2==.; gen preg4=0; replace preg4=1 if parreg2==(4); replace preg4=. if parreg2==.; replace xconst2=(xconst2-1)/6; replace xrcomp2=xrcomp2/3; replace xropen2=xropen2/4; replace parcomp2=parcomp2/5; replace parreg2=(parreg2-1)/4; format parcomp2 xconst2 xrcomp2 xropen2 parreg2 %6.3f; gen con=0; replace con=1 if xconst2==1; replace con=. if xconst2==.; gen com=0; replace com=1 if xrcomp2==1; replace com=. if xrcomp2==.; gen ropen=0; replace ropen=1 if xropen2==1; replace ropen=. if xropen2==.; gen preg=0; replace preg=1 if parreg2==1; replace preg=. if parreg2==.; gen par=0; replace par=1 if parcomp2==1; replace par=. if parcomp2==.; tsset ccode year; gen F5ai=F5.ai; gen L5con=L5.con; gen L5com=L5.com; gen L5open=L5.ropen; gen L5par=L5.par; gen L5preg=L5.preg; gen L5S=L5.S; gen L1com=L1.com; gen L1con=L1.con; gen L1open=L1.ropen; gen L1par=L1.par; gen L1preg=L1.parreg2; gen L2com=L2.com; gen L2con=L2.con; gen L2open=L2.ropen; gen L2par=L2.par; gen L2preg=L2.parreg2; gen L3com=L3.com; gen L3con=L3.con; gen L3open=L3.ropen; gen L3par=L3.par; gen L3preg=L3.parreg2; gen L4com=L4.com; gen L4con=L4.con; gen L4open=L4.ropen; gen L4par=L4.par; gen L4preg=L4.parreg2; gen F5parcomp2=F5.parcomp2; gen L5parcomp2=L5.parcomp2; gen L5parreg2=L5.parreg2; gen L5xconst2=L5.xconst2; gen L5xrcomp2=L5.xrcomp2; gen L5xropen2=L5.xropen2; gen L3parcomp2=L3.parcomp2; gen L3parreg2=L3.parreg2; gen L3xconst2=L3.xconst2; gen L3xrcomp2=L3.xrcomp2; gen L3xropen2=L3.xropen2; gen L3ai=L3.ai; gen d5ai=F5ai-ai; tsset,clear; sort ccode year; egen minconyr1=min(year) if con==1, by(ccode); by ccode: replace minconyr1=0 if minconyr1==.; egen minconyr=max(minconyr1), by(ccode); egen minparyr1=min(year) if par==1, by(ccode); replace minparyr1=0 if minparyr1==.; egen minparyr=max(minparyr1), by(ccode); egen mincomyr1=min(year) if com==1, by(ccode); replace minconyr1=0 if mincomyr1==.; egen mincomyr=max(mincomyr1), by(ccode); egen minopenyr1=min(year) if ropen==1, by(ccode); replace minopenyr1=0 if minopenyr1==.; egen minopenyr=max(minopenyr1), by(ccode); egen minpregyr1=min(year) if preg==1, by(ccode); replace minpregyr1=0 if minpregyr1==.; egen minpregyr=max(minpregyr1), by(ccode); egen mncomp=mean(xrcomp2), by(ccode); replace mncomp=(xrcomp2>mncomp); replace mncomp=. if xrcomp2==.; egen mnreg=mean(parreg2), by(ccode); replace mnreg=(parreg2>mnreg); replace mnreg=. if parreg2==.; egen mnconst=mean(xconst2), by(ccode); replace mnconst=(xconst2>mnconst); replace mnconst=. if xconst2==.; egen mnopen=mean(xropen2), by(ccode); replace mnopen=(xropen2>mnopen); replace mnopen=. if xropen2==.; /* Creating midpoint of scale and below*/ gen midptcon=xconst2<=.5; gen midptcom=xrcomp2<=.33; gen midptopen=xropen2<=.5; gen midptpar=parcomp2<=.4; gen midptreg=parreg2<=.5; tsset ccode year; gen F5lrgdpc=F5.lrgdpc; gen dem80=0; replace dem80=1 if demaut>=.8; replace dem80=. if demaut==.; regr F5lrgdpc xconst2 xrcomp2 xropen2 parcomp2 parreg2 par com con ropen; predict incomeres, residual; gen war=civilwar; replace war=1 if IS_WAR==1; tsset,clear; /* ***** 2 Key Results Below ***** */; ologit F5ai ai war lpop demaut dem80 , cluster(ccode); predict Wai1 Wai2 Wai3 Wai4 Wai5; gen predWai=1 if Wai1>Wai2&Wai1>Wai3&Wai1>Wai4&Wai1>Wai5&Wai1~=.; replace predWai=2 if Wai2>Wai1&Wai2>Wai3&Wai2>Wai4&Wai2>Wai5&Wai2~=.; replace predWai=3 if Wai3>Wai1&Wai3>Wai2&Wai3>Wai4&Wai3>Wai5&Wai3~=.; replace predWai=4 if Wai4>Wai1&Wai4>Wai2&Wai4>Wai3&Wai4>Wai5&Wai4~=.; replace predWai=5 if Wai5>Wai1&Wai5>Wai2&Wai5>Wai3&Wai5>Wai4&Wai5~=.; replace predWai=. if Wai1==.; tab predWai F5ai, all; drop Wai* ; drop predWai; ologit F5ai ai war lpop incomeres demaut dem80 , cluster(ccode); predict Wai1 Wai2 Wai3 Wai4 Wai5; gen predWai=1 if Wai1>Wai2&Wai1>Wai3&Wai1>Wai4&Wai1>Wai5&Wai1~=.; replace predWai=2 if Wai2>Wai1&Wai2>Wai3&Wai2>Wai4&Wai2>Wai5&Wai2~=.; replace predWai=3 if Wai3>Wai1&Wai3>Wai2&Wai3>Wai4&Wai3>Wai5&Wai3~=.; replace predWai=4 if Wai4>Wai1&Wai4>Wai2&Wai4>Wai3&Wai4>Wai5&Wai4~=.; replace predWai=5 if Wai5>Wai1&Wai5>Wai2&Wai5>Wai3&Wai5>Wai4&Wai5~=.; replace predWai=. if Wai1==.; tab predWai F5ai, all; ologit F5ai ai lpop civilwar demaut, cluster(ccode); predict Dai1 Dai2 Dai3 Dai4 Dai5; gen predDai=1 if Dai1>Dai2&Dai1>Dai3&Dai1>Dai4&Dai1>Dai5&Dai1~=.; replace predDai=2 if Dai2>Dai1&Dai2>Dai3&Dai2>Dai4&Dai2>Dai5&Dai2~=.; replace predDai=3 if Dai3>Dai1&Dai3>Dai2&Dai3>Dai4&Dai3>Dai5&Dai3~=.; replace predDai=4 if Dai4>Dai1&Dai4>Dai2&Dai4>Dai3&Dai4>Dai5&Dai4~=.; replace predDai=5 if Dai5>Dai1&Dai5>Dai2&Dai5>Dai3&Dai5>Dai4&Dai5~=.; replace predDai=. if Dai1==.; tab predDai F5ai, all; gen pr=((PR*-1)+7)/7; gen election=com; ologit xconst2 xrcomp2 parcomp2 parreg2 xropen2 ; ologit xrcomp2 parcomp2 parreg2 xropen2 xconst2; ologit parcomp2 parreg2 xropen2 xconst2 xrcomp2 ; ologit parreg2 xropen2 xconst2 xrcomp2 parcomp2 ; ologit xropen2 xconst2 xrcomp2 parcomp2 parreg2 ; ologit xconst2 xrcomp2 parcomp2 parreg2 xropen2 par com ropen; ologit xconst2 xrcomp2 parcomp2 parreg2 xropen2 par con com ropen; ologit xconst2 L5xrcomp2 L5parcomp2 L5parreg2 L5xropen2 L5par L5con L5com L5open; /* **** Run the next 2 ologits manually after do file finishes*/ /* To do so, copy the command to the stata command line and hit enter*/ /* ologit xropen2 xconst2 xrcomp2 parcomp2 parreg2 par con com ologit xropen2 xconst2 xrcomp2 parcomp2 parreg2 par con com ropen */ ologit xropen2 L5xconst2 L5xrcomp2 L5parcomp2 L5parreg2 L5par L5con L5com L5open; ologit parcomp2 xrcomp2 xconst2 parreg2 xropen2 con com ropen; /* Run the next ologit manually after do file finishes.*/ /* To do so, copy the command to the com mand liner in Stata and hit enter*/ /*ologit parcomp2 xrcomp2 xconst2 parreg2 xropen2 par con com ropen */ ologit parcomp2 L5xconst2 L5xrcomp2 L5parreg2 L5xropen2 L5par L5con L5com L5open; ologit parreg2 xconst2 xrcomp2 parcomp2 xropen2 con com ropen; /* Run the next ologit manually after do file finishes.*/ /* To do so, copy the command to the com mand liner in Stata and hit enter*/ /*ologit parreg2 xconst2 xrcomp2 parcomp2 xropen2 par con com ropen */ ologit parreg2 L5xrcomp2 L5parcomp2 L5xconst2 L5xropen2 L5par L5con L5com L5open; ologit xrcomp2 L5xconst2 L5parcomp2 L5parreg2 L5xropen2 L5par L5con L5com L5open; /* Run the next 2 ologits manually after do file finishes.*/ /* To do so, copy the command to the command line in Stata and hit enter*/ /*ologit xrcomp2 xconst2 parcomp2 parreg2 xropen2 par con com ropen ologit xrcomp2 xconst2 parcomp2 parreg2 xropen2 par con ropen*/ /* ****** 2 KEY RESULTs BELOW ****** */; ologit F5ai ai lpop war xrcomp2 xconst2 xropen2 parcomp2 parreg2 com par ropen con, cluster(ccode); ologit F5ai ai lpop incomeres war xrcomp2 xconst2 xropen2 parcomp2 parreg2 com par ropen con, cluster(ccode); /* ********* Additional 4 Tests for Footnote ******** */; /* *** First drops ropen due to multicollinearity, second drops com *** */; ologit F5ai ai lpop war xrcomp2 xconst2 xropen2 parcomp2 parreg2 com par con, cluster(ccode); ologit F5ai ai lpop war xrcomp2 xconst2 xropen2 parcomp2 parreg2 par ropen con, cluster(ccode); ologit F5ai ai lpop incomeres war xrcomp2 xconst2 xropen2 parcomp2 parreg2 com par con, cluster(ccode); ologit F5ai ai lpop incomeres war xrcomp2 xconst2 xropen2 parcomp2 parreg2 par ropen con, cluster(ccode); gen Competition=0; replace Competition=1 if parcomp2>=.2; replace Competition=2 if parcomp2>=.4; replace Competition=3 if parcomp2>=.6; replace Competition=4 if parcomp2>=.8; replace Competition=5 if parcomp2==1; replace Competition=. if parcomp2==.; replace Competition=.2 if Competition==1; replace Competition=.4 if Competition==2; replace Competition=.6 if Competition==3; replace Competition=.8 if Competition==4; replace Competition=1 if Competition==5; format Competition %3.1f; sort Competition; graph box F5ai, by(Competition) over(F5parcomp2) l1t("Human Rights Violations") b1t("Participation Competition, year+5"); tab parcomp2 mncomp; tab parcomp2 mnreg; tab parcomp2 mnconst; tab parcomp2 mnopen; log close;