*Blok 1 *Klargør data fra Blom-Hansen, Houlberg & Serritzlew (2014) use "The economic cots of running the political system_20131120_2.dta" gen byte amalgamated = 0 replace amalgamated = d_amalgamated if year >2006 drop d_amalgamated keep if fil==1 keep muni amalgamated admin_costs_pc_11pl year cpr d_popgrp1 /// children_oneparentfamilies_p socialhousingp_0605_0809_1110 /// fiscalpressure traveltime_pc_05og0607 adm_dec_degree_10pl_20072008 order cpr municipalityname year admin_costs_pc_11pl amalgamated /// children_oneparentfamilies_p lab var municipalityname "Municipality name" lab var year Year lab var amalgamated Amalgamated rename cpr id lab var id "Municipality id" rename admin_costs_pc_11pl admin_costs lab var admin_costs "Administrative costs per capita (2011 prices)" rename children_oneparentfamilies_p children_oneparent lab var children_oneparent "Children in one-parant families (%)" rename d_popgrp1 small_island rename socialhousingp_0605_0809_1110 socialhousing rename traveltime_pc_05og0607 dispersal rename adm_dec_degree_10pl_20072008 adm_dec_degree compress save "BlomHansenEtAL",replace *Blok 2* use "BlomHansenEtAL",clear //åbner data *Figur 5 br //datamatricen *Figur 6 xtsum admin_cost,i(id) *Figur 6* xtsum admin_costs,i(id) *Figur 7 xtline admin_costs, ///xtline og den afhængige variabel i(id) t(year) /// specificerer enheds- og tids-variablene overlay ///alle linjer i én figur legend(off) ///slår legend fra xlabel(2005(1)2011) ///bestiller labels fra 2005 til 2011 på x-aksen ylabel(,nogrid) //slår vandrette streger fra *Figur 8 regress admin_costs i.year,cluster(id) //GNS + CI henover år margins, at(year=(2005(1)2011)) //overflytter resultater til margins marginsplot, /// plotter med marginsplot ytitle("Administrative udgifter per capita (kroner)") /// xtitle(År) ///ændrer titlen på Y- og X-aksen title("") ylab(,nogrid) //fjerner titel og vandrette streger *Figur 9 tabulate amalgamated year *generering af TG ud fra amalgamated egen TG = max(amalgamated), by(id) *Figur 10: Tabulering af TG og tid tab TG year *Figur 11 regress admin_costs TG##year if year == 2006 | year==2007, cluster(id) ***Blok 3/Figur 12*** /*01*/ regress admin_costs TG##year if year == 2006 | year==2007, cluster(id) /*02*/ margins, at(TG=(0 1) year=(2006 2007)) post /*03*/ matrix A = e(b) /*04*/ matrix list A /*05*/ global M00 = A[1,1] /*06*/ global M01 = A[1,2] /*07*/ global M10 = A[1,3] /*08*/ global M11 = A[1,4] /*09*/ global M11c = A[1,3]+(A[1,2]-A[1,1]) /*10*/ tw (scatteri $M00 2006 $M01 2007, connect(line) m(o) mc(gs10) lc(gs10)) /// /*11*/ (scatteri $M10 2006 $M11c 2007, connect(line) m(o) mc(gs10) lc(gs10) mc(gs10) lp(dash)) /// /*12*/ (scatteri $M10 2006 $M11 2007, connect(line) m(o)) /// /*13*/ , /// /*14*/ xlabel(2006 2007) /// /*15*/ xscale(range(2005.9 2007.1)) /// /*16*/ ylabel(,nogrid) /// /*17*/ xtitle(År) ytitle("Administrative omkostninger pr. indbygger", size(medsmall)) /// /*18*/ legend(label (1 "Kontrolgruppens udvikling") label (3 "Treatmentgruppens udvikling") /// /*19*/ label (2 "Kontrakfaktisk udvikling") /// /*20*/ order(1 3 2)) *Blok 4/Figur 13 regress admin_costs TG##year if year >= 2006, cluster(id) *Figur 14 margins, at(TG=(0 1) year=(2006 (1) 2011)) post mat A = e(b) global M00 = A[1,1] global M01 = A[1,2] global M02 = A[1,3] global M03 = A[1,4] global M04 = A[1,5] global M05 = A[1,6] global M10 = A[1,7] global M11 = A[1,8] global M12 = A[1,9] global M13 = A[1,10] global M14 = A[1,11] global M15 = A[1,12] global M10c = A[1,7] global M11c = A[1,7]+(A[1,2]-A[1,1]) global M12c = A[1,9]+(A[1,3]-A[1,2]) global M13c = A[1,9]+(A[1,4]-A[1,2]) global M14c = A[1,9]+(A[1,5]-A[1,2]) global M15c = A[1,9]+(A[1,6]-A[1,2]) tw /// (scatteri $M00 2006 $M01 2007 $M02 2008 $M03 2009 $M04 2010 $M05 2011 /// , connect(line) m(o) mc(gs10) lc(gs10)) /// (scatteri $M10c 2006 $M11c 2007 $M12c 2008 $M13c 2009 $M14c 2010 $M15c 2011 /// , connect(line) m(o) mc(gs10) lc(gs10) mc(gs10) lp(dash)) /// (scatteri $M10 2006 $M11 2007 $M12 2008 $M13 2009 $M14 2010 $M15 2011, connect(line) m(o)) /// , /// xlabel(2006 (1) 2011) xscale(range(2005.9 2011.1)) ylabel(,nogrid) xtitle(År) /// ytit("Administrative omkostninger pr. indbygger", size(medsmall)) /// legend(label (3 "Treatmentgruppens udvikling") label (2 "Kontrakfaktisk udvikling") /// label (1 "Kontrolgruppens udvikling") order(1 3 2) position(6)) *Blok 5/Figur 15 regress admin_costs TG##ib2006.year, cluster(id) *Figur 16 margins, at(TG=(0 1) year=(2005(1) 2011)) post mat A =e(b) global M00 = A[1,1] global M01 = A[1,2] global M02 = A[1,3] global M03 = A[1,4] global M04 = A[1,5] global M05 = A[1,6] global M06 = A[1,7] global M10 = A[1,8] global M11 = A[1,9] global M12 = A[1,10] global M13 = A[1,11] global M14 = A[1,12] global M15 = A[1,13] global M16 = A[1,14] global M10c = A[1,9]+(A[1,1]-A[1,2]) global M11c = A[1,9] global M12c = A[1,9]+(A[1,3]-A[1,2]) global M13c = A[1,9]+(A[1,4]-A[1,2]) global M14c = A[1,9]+(A[1,5]-A[1,2]) global M15c = A[1,9]+(A[1,6]-A[1,2]) global M16c = A[1,9]+(A[1,7]-A[1,2]) tw /// (scatteri $M00 2005 $M01 2006 $M02 2007 $M03 2008 $M04 2009 $M05 2010 $M06 2011 /// , connect(line) m(o) mc(gs10) lc(gs10)) /// (scatteri $M10c 2005 $M11c 2006 $M12c 2007 $M13c 2008 $M14c 2009 $M15c 2010 $M16c 2011 /// , connect(line) m(o) mc(gs10) lc(gs10) mc(gs10) lp(dash)) /// (scatteri $M10 2005 $M11 2006 $M12 2007 $M13 2008 $M14 2009 $M15 2010 $M16 2011, connect(line) m(o)) /// , /// xlabel(2005 (1) 2011) xscale(range(2004.9 2011.1)) ylabel(,nogrid) xtitle(År) /// ytitle("Administrative omkostninger pr. indbygger", size(medsmall)) /// legend(label (3 "Treatmentgruppens udvikling") label (2 "Kontrakfaktisk udvikling") /// label (1 "Kontrolgruppens udvikling") order(1 3 2) position(6)) *Figur 17+18 reg admin_costs TG##ib2006.year /// children_oneparent small_island,cluster(id)