version 10
set more off
capture log close
log using regressiontables, replace
use mydata4.dta, clear
/* first collapse remedies across parties */
generate administrator = 1 if admin0 == 1 | admin2 == 1 | admin3 == 1 | admin4 == 1 | admin5 == 1 | admin6 == 1 | admin7 == 1 | admin8 == 1 | admin9 == 1 | admin10 == 1 | admin11 == 1 | admin12 == 1 | admin13 == 1 | admin14 == 1 | admin15 == 1 |admin16 == 1 | admin17 == 1 | admin18 == 1 | admin19 == 1
generate subjectremedy = 1 if p1ssremedy == 1 | p2ssremedy == 1 | rssp3 == 1 | remedy31 == 1 | remedy41 == 1 | remedy51 == 1 | remedy61 == 1 | remedy71 == 1 | remedy81 == 1 | remedy91 == 1 | remedy101 == 1 | remedy111 == 1 | remedy121 == 1 | remedy131 == 1 | remedy141 == 1 | remedy151 == 1 | remedy161 == 1 | remedy171 == 1 | remedy181 == 1 | remedy191 == 1
generate lessOneYearBan = 1 if p1l1yban == 1 | p2l1yban == 1 | rl1yb == 1 | remedy32 == 1 | remedy42 == 1 | remedy52 == 1 | remedy62 == 1 | remedy72 == 1 | remedy82 == 2 | remedy92 == 1 | remedy102 == 1 | remedy112 == 1 | remedy122 == 1 | remedy132 == 1 | remedy142 == 1 | remedy152 == 1 | remedy162 == 1 | remedy172 == 1 | remedy182 == 1 | remedy192 == 1
generate greaterOneYearBan = 1 if p1g1yban == 1 | p2g1yban == 1 | rg1yb3 == 1 | remedy33 == 1 | remedy43 == 1 | remedy53 == 1 | remedy63 == 1 | remedy73 == 1 | remedy83 == 2 | remedy93 == 1 | remedy103 == 1 | remedy113 == 1 | remedy123 == 1 | remedy133 == 1 | remedy143 == 1 | remedy153 == 1 | remedy163 == 1 | remedy173 == 1 | remedy183 == 1 | remedy193 == 1
generate subjectprobation = 1 if p1probation == 1 | p2probation == 1 | rp3 == 1 | remedy34 == 1 | remedy44 == 1 | remedy54 == 1 | remedy64 == 1 | remedy74 == 1 | remedy84 == 1 | remedy94 == 1 | remedy104 == 1 | remedy114 == 1 | remedy124 == 1 | remedy134 == 1 | remedy144 == 1 | remedy154 == 1 | remedy164 == 1 | remedy174 == 1 | remedy184 == 1 | remedy194 == 1
generate revertparole = 1 if p1revertparole == 1 | p2revertparole == 1 | rrevparole3 == 1 | remedy35 == 1 | remedy45 == 1 | remedy55 == 1 | remedy65 == 1 | remedy75 == 1 | remedy85 == 1 | remedy95 == 1 | remedy105 == 1 | remedy115 == 1 | remedy125 == 1 | remedy135 == 1 | remedy145 == 1 | remedy155 == 1 | remedy165 == 1 | remedy175 == 1 | remedy185 == 1 | remedy195 == 1
generate civilityparole = 1 if p1civilityparole == 1 | p2civilityparole == 1 | rcivparole3 == 1 | remedy36 == 1 | remedy46 == 1 | remedy56 == 1 | remedy66 == 1 | remedy76 == 1 | remedy86 == 1 | remedy96 == 1 | remedy106 == 1 | remedy116 == 1 | remedy126 == 1 | remedy136 == 1 | remedy146 == 1 | remedy156 == 1 | remedy166 == 1 | remedy176 == 1 | remedy186 == 1 | remedy196 == 1
generate articleprobation = 1 if p1articleprobation == 1 | p2articleprobation == 1 | rartprob3 == 1 | remedy37 == 1 | remedy47 == 1 | remedy57 == 1 | remedy67 == 1 | remedy77 == 1 | remedy87 == 1 | remedy97 == 1 | remedy107 == 1 | remedy117 == 1 | remedy127 == 1 | remedy137 == 1 | remedy147 == 1 | remedy157 == 1 | remedy167 == 1 | remedy177 == 1 | remedy187 == 1 | remedy197 == 1
/*now I'm going to turn missing values into 0 */
mvencode _all, mv(0) override
drop if casename == 0
/* now, I'm going to create a new kind of conduct finding, which will be coded as 1 wherever in conduct other the coders observed wikilawyering or fighting about the arbitration process, observed by hand */
generate conductdispute = 0
replace conductdispute = 1 in 16
replace conductdispute = 1 in 18
replace conductdispute = 1 in 27
replace conductdispute = 1 in 57
replace conductdispute = 1 in 90
replace conductdispute = 1 in 110
replace conductdispute = 1 in 119
replace conductdispute = 1 in 154
/* now I'm going to drop several observations that were incompletely coded, because the arbcom dropped them for lack of evidence or for lack of consensus about what to do */
drop in 46
drop in 35
drop in 64
drop in 219
drop in 235
drop in 233
drop in 264
drop in 266
/* generate new conduct findings by collapsing across all findings */
generate impersonation = 1 if sockpuppet == 1 | meatpuppet== 1
generate editing = 1 if conflictofinterest == 1 | copyright == 1 | npov == 1 | removalofinformation == 1 | tendentiousediting == 1 | originalresearch == 1 | badcitation == 1 | removalofcitation == 1
generate consensus = 1 if editwar == 1 | revertwar3rr == 1 | wheelwar == 1
generate antisocial = 1 if legalthreat == 1 | disruption == 1 | vandalism == 1 | incivility == 1 | discourtesy == 1 | badfaith == 1 | personalattacks == 1 | ethnicracialattacks == 1 | genderattacks == 1 | homophobicattacks == 1 | stalking == 1 | harassment == 1
generate articlechaos = 1 if nationalistbattleground == 1 | ethnicbattleground == 1 | talkpages == 1
generate contempt = 1 if authority == 1 | conductdispute == 1 | blockevasion == 1 | spammingpolls== 1
/* generate new remedy findings collapsing existing remedies */
generate caution = 1 if warning == 1 | subjectprobation == 1 | revertparole == 1 | civilityparole == 1 | articleprobation == 1
generate articleban = 1 if lessOneYearBan == 1 | greaterOneYearBan == 1
generate topicalremedy = 1 if subjectremedy == 1
generate death = 1 if ban == 1
generate administratorremedy = 1 if adminsanction == 1
generate cycleDR = 1 if mediation
generate thanksremedy = 1 if thanks == 1
/*now I'm going to turn missing values into 0 */
mvencode _all, mv(0) override
/* now I'm going to fix the date */
gen date2 = date(dateclean, "MD20Y")
format date2 %td
save wikicoded, replace