*** Replication Do File for "Helping Hand Versus Long Arm of the Law" *** May 10, 2013 *** Data Notes: *** All baseline data are indicated by the pre-fix b_ **** Follow-up survey data are indicated by the pre-fix v_ **** November follow-up survey data indicated by the pre_fix nov_v *** Set Directory cd C:\BrazilInformal\DataforPaper\ * Open Data use MinasPublicData.dta, clear *************************** Variable Construction *********************************************** *** Generate some key outcomes from Final Round data * Interview status gen InterviewedFinal=v06e==1|v07e==1|v08e==1 replace InterviewedFinal=. if v06e==. gen ClosedFinal=(v06e>=3 & v06e<=9)|(v07e>=3 & v07e<=9)|(v08e>=3 & v08e<=9)|(v10==2|v10==3)|v19==2 replace ClosedFinal=. if v06e==. gen AbsentorRefuseFinal=(v08e==2|v08e==3|v08e==10|v08e==11)|(v07e==10|v07e==11)|(v06e==10|v06e==11) replace AbsentorRefuseFinal=. if v06e==. replace inNovember=0 if inNovember==. * Municipal Inspections in past 12 months gen v_inspectALF=1 if v120a>0 & v120a~=. & v120a<99 replace v_inspectALF=0 if v_inspectALF==. & InterviewedFinal==1 replace v_inspectALF=. if v120a==1000001 label var v_inspectALF "Inspected by Prefeitura in last 12 months" * Treatment Variables ** Free Cost vs Information vs Control replace freecost=0 if assignedforFollow==1 & assignment=="Control" & inBase==1 replace communication=0 if assignedforFollow==1 & assignment=="Control" & inBase==1 gen control1=freecost==0 & communication==0 & inBase==1 label var control1 "Control group for comparing to communication blocks" gen TreatStatus1=1 if freecost==1 replace TreatStatus1=2 if communication==1 replace TreatStatus1=3 if control1==1 label var TreatStatus1 "Treatment Status for Control vs Free Cost/Comm." label define ts1 1 "Free Cost" 2 "Communication" 3 "Control" label values TreatStatus1 ts1 *** Control vs Control in Inspector Block vs Assigned to Inspector in Inspector Block *** Need to reweight this data to take account of sampling gen getinspector=1 if assignment=="Inspector" & Assigninspe==1 gen inspectorcontrol=1 if assignment=="Inspector" & assignedforFollowup==1 & Assigninspe==0 gen control2=1 if assignment=="Control" & assignedforF==1 replace getinspector=0 if inspectorcontrol==1|control2==1 replace inspectorcontrol=0 if getinspector==1|control2==1 replace control2=0 if getinspector==1|inspectorcontrol==1 label var control2 "Control group for comparing to inspector blocks" label var inspectorcontrol "Control firm in an inspector block" label var getinspector "Assigned to get inspector" gen TreatStatus2=1 if getinspector==1 replace TreatStatus2=2 if inspectorcontrol==1 replace TreatStatus2=3 if control2==1 label var TreatStatus2 "Treatment Status for Control vs Inspectors" label define ts2 1 "Get Inspector" 2 "Inspector Control" 3 "Control" label values TreatStatus2 ts2 * generate weights gen weight=1 if TreatStatus2==1 replace weight=1190/593 if TreatStatus2==2 replace weight=1 if control1==1 replace weight=2121/709 if weight==. & control2==1 svyset [pweight=weight] * Data from Listing Variables available for all firms gen listed_commerce=natureza=="COMERCIO" gen listed_services=natureza=="SERVICO" gen trunc_ativ=substr(atividad, 1, 5) gen listed_placa=placa=="SIM" gen listed_employees=real(funcio) replace listed_employees=. if listed_employees>100 * approximate area of firm premises in square meters gen listed_area=real(area) * density of block (firms listed divided by block area) gen listed_density=density *** Baseline Data for Communication and Control1 firms * Claimed formalization gen b_claimssimples=cond(b_baselineSIMPLES==2,1,0) if b_baselineSIMPLES~=. gen b_claimsjucemg=cond(b_q111~="", 1, 0) if inBase==1 gen b_claimscnpj=cond(b_q112~="", 1, 0) if inBase==1 gen b_claimsalf=cond(b_q113~="", 1, 0) if inBase==1 gen b_hours=b_q14dia*b_q14hor gen b_keepsrecords=cond(b_q23=="Sim", 1, 0) if inBase==1 * Calculate value of capital stock owned for var b_q411b b_q412b b_q413b b_q414b b_q43: replace X=0 if X==. & inBase==1 gen b_owncapital=b_q43 replace b_owncapital=b_owncapital+b_q411b if b_q411a=="Próprio" replace b_owncapital=b_owncapital+b_q412b if b_q412a=="Próprio" replace b_owncapital=b_owncapital+b_q413b if b_q413a=="Próprio" replace b_owncapital=b_owncapital+b_q414b if b_q414a=="Próprio" replace b_owncapital=. if b_q43>1000000 gen b_annualrevenue=b_q46 if b_q46<3000000 gen b_monthlyprofit=b_q47 if b_q47<100000 gen b_inspectoralf=cond(b_q518a>0, 1, 0) if b_q518a~=. gen b_inspectorstate=cond(b_q518b>0, 1, 0) if b_q518b~=. gen b_inspectortax=cond(b_q518c>0, 1, 0) if b_q518c~=. gen b_married=b_q65=="Casado(a)" if inBase==1 gen b_primaryorless=b_q71=="1ª Série"|b_q71=="2ª Série"|b_q71=="3ª Série"|b_q71=="4ª Série"|b_q71=="Nenhum" replace b_primary=. if inBase==0 gen b_completedhighschool=b_q71=="3º Ano"|b_q71=="Ensino Superior (Graduação)"|b_q71=="Doutorado"|b_q71=="Mestrado" replace b_completedhighschool=. if inBase==0 * some time-invariant follow-up variables gen v_female=cond(v16==2, 1, 0) if v16>0 & v16<=2 gen v_age = v17 if v17>0 & v17<98 gen v_primaryorless=v139<=4 replace v_primaryorless=. if InterviewedFinal~=1 gen v_completedhighschool=v139>=12 & v139<=15 replace v_completedhighschool=. if InterviewedFinal~=1 gen v_fatherprimary=v141<=4 replace v_fatherprimary=. if InterviewedFinal~=1 gen v_fathercompletedhs=v141>=12 & v141<=15 replace v_fathercompletedhs=. if InterviewedFinal~=1 *** Formalized in any way according to admin data gen anyformal_maybe=simples_maybe==1|mei_maybe==1|alf_maybe==1 gen anyformal=simples_yes==1|mei_yes==1|alf_yes==1 *** Measures of knowledge and inspections for Table 6 gen useaccountant=v42==1 replace useaccountant=. if InterviewedFinal==0|InterviewedFinal==.|v19~=1 gen baseaccountant=b_q57=="Sim" gen knowaccountantcost=v43>=200 & v43<=400 replace knowaccountantcost=. if InterviewedFinal==0|InterviewedFinal==.|v19~=1 gen baseknowaccountantcost=b_q58>=200 & b_q58<=400 gen claimstoknowhowformalize=v112==1|v19~=1 replace claimstoknowhowformalize=. if v112==0|v112==.|v19~=1 gen baseclaimstoknow=b_q53=="Sim" gen knowscost=v113>=200 & v113<=400 replace knowscost=. if InterviewedFinal==0|InterviewedFinal==.|v19~=1 gen baseknowscost=b_q54>=200 & b_q54<=400 replace baseknowscost=. if inBase==0 gen knowstax=v114>=4 & v114<=8 replace knowstax=. if InterviewedFinal==0|InterviewedFinal==.|v19~=1 gen baseknowstax=b_q55>=4 & b_q55<=8 replace baseknowstax=. if inBase==0 gen receivedinfotoformalize=v122==1 replace receivedinfotoformalize=. if InterviewedFinal==0|InterviewedFinal==.|v19~=1 gen wasfinedornotified=v121==1 replace wasfinedornot=. if InterviewedFinal==0|InterviewedFinal==.|v19~=1 gen firmaroundinspected=v124==1 replace firmaroundinspected=. if InterviewedFinal==0|InterviewedFinal==.|v19~=1 *** trust in govt variables for table 9 gen trustgovstate=v147 replace trustgovstate=. if v147==90|InterviewedFinal==0|InterviewedFinal==.|v19~=1 gen truststateofficials=v149 replace truststateofficials=. if v149==90|InterviewedFinal==0|InterviewedFinal==.|v19~=1 gen truststateinspector=v155 replace truststateinspector=. if v155==90|InterviewedFinal==0|InterviewedFinal==.|v19~=1 gen governinowninterest=v156==1 replace governinowninterest=. if v156==9|InterviewedFinal==0|InterviewedFinal==.|v19~=1 ***************************************** TABLES *************************************** *********** Table 1: Treatment Assignment ************** * number of blocks by treatment assignment bysort assignment: distinct setor_new * number of firms listed by treatment assignment tab assignment * Firms surveyed at baseline by treatment assignment tab assignment if control1==1|freecost==1|communication==1 * Breakdown of communication/freecost firms by type tab freecost tab communication *** Random Sample of Firms in Control assigned for Follow-up tab assignedforF if control2==1 & control1==0 *** Firms in Inspector Treatment tab getinspector *** Indirect inspector for follow-up tab inspectorcontrol if assignedforF==1 *********** Table 2 : Randomization Check of Control vs Communication Blocks *************** *** Table components * First get control group means /* #delimit ; collapse (mean) listed* b_female b_age b_primaryorless b_completedhighschool b_married b_ageofbusiness b_hours b_totalworkers b_keepsrecords b_annualrevenue b_monthlyprofit b_owncapital b_claims* b_inspector* if control1==1; */ #delimit ; sum listed_commerce listed_services listed_placa listed_employees listed_area b_female b_age b_primaryorless b_completedhighschool b_married b_ageofbusiness b_hours b_totalworkers b_keepsrecords b_annualrevenue b_monthlyprofit b_owncapital b_claims* b_inspector* if control1==1; #delimit ; foreach var in listed_commerce listed_services listed_placa listed_employees listed_area b_female b_age b_primaryorless b_completedhighschool b_married b_ageofbusiness b_hours b_totalworkers b_keepsrecords b_annualrevenue b_monthlyprofit b_owncapital b_claimssimples b_claimsjuc b_claimscnpj b_claimsalf b_inspectoralf b_inspectorstate b_inspectortax {; xi: reg `var' freecost communication i.strata if inBase==1, cluster(setor_new); outreg2 freecost communication using table2paper.out, append; }; #delimit cr * Now do same for sample interviewed at follow-up /* #delimit ; collapse (mean) listed_commerce listed_services listed_placa listed_employees listed_area b_female b_age b_primaryorless b_completedhighschool b_married b_ageofbusiness b_hours b_totalworkers b_keepsrecords b_annualrevenue b_monthlyprofit b_owncapital b_claimssimples b_claimsjuc b_claimscnpj b_claimsalf b_inspectoralf b_inspectorstate b_inspectortax if control1==1 & InterviewedFinal==1; */ #delimit ; sum listed_commerce listed_services listed_placa listed_employees listed_area b_female b_age b_primaryorless b_completedhighschool b_married b_ageofbusiness b_hours b_totalworkers b_keepsrecords b_annualrevenue b_monthlyprofit b_owncapital b_claims* b_inspector* if control1==1 & InterviewedFinal==1; #delimit ; foreach var in listed_commerce listed_services listed_placa listed_employees listed_area b_female b_age b_primaryorless b_completedhighschool b_married b_ageofbusiness b_hours b_totalworkers b_keepsrecords b_annualrevenue b_monthlyprofit b_owncapital b_claimssimples b_claimsjuc b_claimscnpj b_claimsalf b_inspectoralf b_inspectorstate b_inspectortax {; xi: reg `var' freecost communication i.strata if inBase==1 & InterviewedFinal==1, cluster(setor_new); outreg2 freecost communication using table2b.out, append slow(500); }; #delimit cr ************* Table 3: Randomization Check for Control Vs Inspector Comparison *********************** * Full sample #delimit ; foreach var in listed_commerce listed_services listed_placa listed_employees listed_area {; svy: mean `var' if control2==1; }; #delimit ; foreach var in listed_commerce listed_services listed_placa listed_employees listed_area {; xi: reg `var' getinspector inspectorcontrol i.strata if TreatStatus2~=. [pweight=weight], cluster(setor_new); outreg2 getinspector inspectorcontrol using table3paper.out, append; }; #delimit cr * Follow-up Sample #delimit ; foreach var in listed_commerce listed_services listed_placa listed_employees listed_area {; svy: mean `var' if control2==1 & InterviewedFinal==1; }; #delimit ; foreach var in listed_commerce listed_services listed_placa listed_employees listed_area {; xi: reg `var' getinspector inspectorcontrol i.strata if TreatStatus2~=. & InterviewedFinal==1 [pweight=weight], cluster(setor_new); outreg2 getinspector inspectorcontrol using table3paper.out, append; }; #delimit cr * time-invariant follow-up variables #delimit ; foreach var in v_female v_age v_primary v_completed v_fatherprimary v_fathercompleted {; svy: mean `var' if control2==1 & InterviewedFinal==1; }; #delimit ; foreach var in v_female v_age v_primary v_completed v_fatherprimary v_fathercompleted {; xi: reg `var' getinspector inspectorcontrol i.strata if TreatStatus2~=. & InterviewedFinal==1 [pweight=weight], cluster(setor_new); outreg2 getinspector inspectorcontrol using table3paper.out, append; }; #delimit cr ********************* Table 4: Attrition Table ************************************* ** Control vs Communication sum InterviewedFinal ClosedFinal AbsentorR if control1==1 & inBase==1 foreach var in InterviewedFinal ClosedFinal AbsentorR { xi: reg `var' freecost communication i.strata if inBase==1, cluster(setor_new) outreg2 freecost communication using Table4paper.out, append } ** Control vs Inspector foreach var in InterviewedFinal ClosedFinal AbsentorR { svy: mean `var' if control2==1 } foreach var in InterviewedFinal ClosedFinal AbsentorR { xi: reg `var' getinspector inspectorcontrol i.strata [pweight=weight], cluster(setor_new) outreg2 getinspector inspectorcontrol using Table3a.out, append } ***************** Table 5: Attrition on Outcomes? ************************************* foreach var in anyformal_maybe { cap drop `var'_freecost `var'_communication gen `var'_freecost=`var'*freecost gen `var'_communication=`var'*communication xi: reg InterviewedFinal `var' `var'_freecost `var'_communication freecost communication i.strata if inBase==1, cluster(setor_new) outreg2 `var' `var'_freecost `var'_communication using Table5paper.out, append } foreach var in anyformal_maybe { cap drop `var'_getinspector `var'_inspectorcontrol gen `var'_getinspector=`var'*getinspector gen `var'_inspectorcontrol=`var'*inspectorcontrol xi: reg InterviewedFinal `var' `var'_getinspector `var'_inspectorcontrol getinspector inspectorcontrol i.strata [pweight=weight], cluster(setor_new) outreg2 `var' `var'_getinspector `var'_inspectorcontrol using Table5.out, append } #delimit cr *************** Table 6: Impacts on Inspections, Knowledge, Accountant Use ****************** ** Control vs Communication sum claimstoknowhowformalize knowscost knowstax useaccountant knowaccountantcost v_inspectALF receivedinfotoformalize firmaroundinspected wasfinedornot if control1==1 & inBase==1 foreach var in claimstoknowhowformalize knowscost knowstax useaccountant knowaccountantcost v_inspectALF receivedinfotoformalize firmaroundinspected wasfinedornot { xi: reg `var' freecost communication i.strata if inBase==1, cluster(setor_new) outreg2 freecost communication using Table6Paper.out, append } ** Control vs Inspector foreach var in claimstoknowhowformalize knowscost knowstax useaccountant knowaccountantcost v_inspectALF receivedinfotoformalize firmaroundinspected wasfinedornot { svy: mean `var' if control2==1 } foreach var in claimstoknowhowformalize knowscost knowstax useaccountant knowaccountantcost v_inspectALF receivedinfotoformalize firmaroundinspected wasfinedornot { xi: reg `var' getinspector inspectorcontrol i.strata [pweight=weight], cluster(setor_new) outreg2 getinspector inspectorcontrol using Table6Paperb.out, append } **************** Table 7: Impacts on Admin Records of Formalization ****************************************** ****Control vs Communication sum simples_yes simples_maybe mei_yes mei_maybe alf_yes alf_maybe anyformal anyformal_maybe if control1==1 & inBase==1 foreach var in simples_yes simples_maybe mei_yes mei_maybe alf_yes alf_maybe anyformal anyformal_maybe { xi: reg `var' freecost communication i.strata if inBase==1, cluster(setor_new) outreg2 freecost communication using Table7Paper.out, append } * Control vs Inspector sum simples_yes simples_maybe mei_yes mei_maybe alf_yes alf_maybe anyformal anyformal_maybe if assignment=="Control" * define treatment variables for full sample, not just those followed up gen getinspector1=getinspector replace getinspector1=0 if getinspector==. & (assignment=="Control"|assignment=="Inspector") gen inspectorcontrol1=inspectorcontrol replace inspectorcontrol1=1 if assignment=="Inspector" & getinspector1==0 replace inspectorcontrol1=0 if assignment=="Control" foreach var in simples_yes simples_maybe mei_yes mei_maybe alf_yes alf_maybe anyformal anyformal_maybe { xi: reg `var' getinspector1 inspectorcontrol1 i.strata if assignment=="Control"|assignment=="Inspector", cluster(setor_new) outreg2 getinspector1 inspectorcontrol1 using Table7PaperB.out, append } ***************** Table 8: IV regression of getting an inspection on having ALF *************************** xi: ivreg alf_yes (v_inspectALF = getinspector1) i.strata if (assignment=="Control"|assignment=="Inspector") & inspectorcontrol==0, cluster(setor_new) outreg2 v_inspectALF using table8.out, replace xi: ivreg alf_maybe (v_inspectALF = getinspector1) i.strata if (assignment=="Control"|assignment=="Inspector") & inspectorcontrol==0, cluster(setor_new) outreg2 v_inspectALF using table8.out, append xi: ivreg anyformal (v_inspectALF = getinspector1) i.strata if (assignment=="Control"|assignment=="Inspector") & inspectorcontrol==0, cluster(setor_new) outreg2 v_inspectALF using table8.out, append xi: ivreg anyformal_maybe (v_inspectALF = getinspector1) i.strata if (assignment=="Control"|assignment=="Inspector") & inspectorcontrol==0, cluster(setor_new) outreg2 v_inspectALF using table8.out, append *********************** Table 9 : Impact on trust and view of government ***************** ** Freecost vs communication sum trustgovstate truststateoffi truststateins governinowninterest if control1==1 & inBase==1 foreach var in trustgovstate truststateoffi truststateins governinowninterest { xi: reg `var' freecost communication i.strata if inBase==1, cluster(setor_new) outreg2 freecost communication using Table9Paper.out, append } ** Control vs Inspector foreach var in trustgovstate truststateoffi truststateins governinowninterest { svy: mean `var' if control2==1 } foreach var in trustgovstate truststateoffi truststateins governinowninterest { xi: reg `var' getinspector inspectorcontrol i.strata [pweight=weight], cluster(setor_new) outreg2 getinspector inspectorcontrol using Table9Paperb.out, append }