*** All Municipalitys included **** clear all use "C:\Users\TrymE\OneDrive\Dokumenter\Masteroppgave\Tourist roads\STATA\Dataset_K_2018.dta" gen ATTRACT = 0 forvalues i = 1 (1) 76 { replace ATTRACT =1 if kommune==kname`i' & year>year`i' * (this way ATTRACT is 1 only in years AFTER the attraction opens) *replace ATTRACT =1 if kommune==kname`i' & year>=year`i' * (this way ATTRACT is 1 in the year an attraction opens and all years afterwards) } gen topATTRACT = 0 forvalues i = 1 (1) 76 { replace topATTRACT=1 if kommune==kname`i' & flagship`i'==1 & year>year`i' *replace topATTRACT=1 if kommune==kname`i' & flagship`i'==1 & year>=year`i' } gen AttractionTown=0 gen topAttractionTown=0 forvalues i = 1 (1) 76 { replace AttractionTown =1 if kommune==kname`i' replace topAttractionTown =1 if kommune==kname`i' & flagship`i'==1 } gen TimeToRoad = year - tourist_road_year gen TimeToAttract = . gen TimeToTopAttract = . forvalues i = 1 (1) 76 { replace TimeToAttract = 0 if kommune==kname`i' & year==year`i' replace TimeToTopAttract = 0 if kommune==kname`i' & flagship`i'==1 & year==year`i' } replace TimeToAttract = . if year==1997 & knr==514 replace TimeToAttract = . if year==2005 & (knr==514 | knr==1860) replace TimeToAttract = . if year==2006 & knr==2018 replace TimeToAttract = . if year==2007 & knr==1860 replace TimeToAttract = . if year==2010 & (knr==1524 | knr==1421 | knr==1449 | knr==1865 | knr==1929) replace TimeToAttract = . if year==2012 & knr==544 replace TimeToAttract = . if year==2013 & (knr==430 | knr==1134 | knr==2018) replace TimeToAttract = . if year==2014 & (knr==1238 | knr==1554) replace TimeToAttract = . if year==2015 & (knr==430 | knr==514 | knr==1134 | knr==1929 | knr==2003) replace TimeToAttract = . if year==2016 & (knr==1135 | knr==1548 | knr==1551) replace TimeToAttract = . if year==2012 & (knr==2003) replace TimeToAttract = . if year==2018 & (knr==1134 | knr==1449 | knr==1860 | knr==1871) replace TimeToTopAttract = . if year==2010 & knr==1524 replace TimeToTopAttract = . if year==2014 & knr==1554 gen TopAttraction=. forvalues i = 1 (1) 76{ replace TopAttraction =0 if tourist_road==1 replace TopAttraction =1 if topAttractionTown==1 } gen Attraction=. forvalues i = 1 (1) 76{ replace Attraction =0 if tourist_road==1 replace Attraction =1 if AttractionTown==1 } * Test for characteristics of municipalities selected by Statens Vegvesen collapse longitude latitude tourist_road tourist_road_year area a300_599 a600_899 a900_1199 a1200_1499 a1500_1799 a1800 high300 high1200 pop women age05 age615 age1619 age2066 age67 netimmigr_nat net_immigr_int unemployment_gen unemployment_young income_av income_med freerev taxrev grants cpi2015 newbusiness newhotelsbars bankrupthotelsbars houseprice housesales traffic_accident fatal_acc injured_total law_violate traffic_violate Attraction TopAttraction if year <=1996, by(knr) gen femshare=(women/pop)*100 gen babyshare = (age05/pop)*100 gen youngshare = ((age615 +age1619)/pop)*100 gen workageshare = ((pop-age05-age615-age1619-age67)/pop)*100 gen oldshare = (age67/pop)*100 gen immignatshare = (netimmigr_nat/pop)*100 gen immigintshare = (net_immigr_int/pop)*100 gen unempshare = (unemployment_gen/pop)*100 gen unempyoungshare = (unemployment_young/pop)*100 gen freerevCAP = freerev/pop gen taxrevCAP = taxrev/pop gen grantsCAP = grants/pop gen newbusshare = (newbusiness/(pop/1000))*100 gen newhotelshare = (newhotelsbars/(pop/1000))*100 gen bankruptshare = (bankrupthotelsbars/(pop/1000))*100 gen housesalesshare = (housesales/(pop/1000))*100 gen accidshare = (traffic_accident/(pop/1000))*100 gen fatalshare = (fatal_acc/(pop/1000))*100 gen injuredshare = (injured_total/(pop/1000))*100 gen lovbruddshare = (law_violate/(pop/1000))*100 gen trafficlawshare = (traffic_violate/(pop/1000))*100 gen lnpop = (ln(pop)) gen realhouseprice = houseprice/cpi2015 ttest lnpop, by( TopAttraction ) unequal ttest unempshare , by( TopAttraction ) unequal ttest accidshare , by( TopAttraction ) unequal ttest lnpop, by( Attraction ) unequal ttest unempshare , by( Attraction ) unequal ttest accidshare , by( Attraction ) unequal *********************************** *********************************** ******** Analysis section ******** *********************************** *********************************** clear all set matsize 7500 use "C:\Users\TrymE\OneDrive\Dokumenter\Masteroppgave\Tourist roads\STATA\Dataset_K_2018.dta" xtset knr year gen lnpop = (ln(pop)) gen femshare=(women/pop)*100 gen youngshare = ((age615 +age1619)/pop)*100 gen workageshare = ((pop-age05-age615-age1619-age67)/pop) gen babyshare = (age05/pop)*100*100 gen oldshare = (age67/pop)*100 gen immignatshare = (netimmigr_nat/pop)*100 gen immigintshare = (net_immigr_int/pop)*100 gen unempshare = (unemployment_gen/pop)*100 gen freerevCAP = (freerev/cpi2015)/pop gen taxrevCAP = (taxrev/cpi2015)/pop gen grantsCAP = (grants/cpi2015)/pop gen realincome_av = income_av/cpi2015 gen realincome_med = income_med/cpi2015 gen realhouseprice = houseprice/cpi2015 gen newbusshare = (newbusiness/pop)*100 gen newhotelshare = (newhotelsbars/(pop/1000))*100 gen bankruptshare = (bankrupthotelsbars/pop)*100 gen housesalesshare = (housesales/(pop/1000))*100 gen accidshare = (traffic_accident/(pop/1000))*100 gen fatalshare = (fatal_acc/(pop/1000))*100 gen injuredshare = (injured_total/pop)*100 gen lovbruddshare = (law_violate/(pop/1000))*100 gen trafficlawshare = (traffic_violate/(pop/1000))*100 summ pop unempshare grantsCAP realincome_av accidshare realhouseprice if (tourist_road==1) * generate key tourist route attraction variables gen ATTRACT = 0 forvalues i = 1 (1) 76 { replace ATTRACT =1 if kommune==kname`i' & year>year`i' * (this way ATTRACT is 1 only in years AFTER the attraction opens) *replace ATTRACT =1 if kommune==kname`i' & year>=year`i' * (this way ATTRACT is 1 in the year an attraction opens and all years afterwards) } gen topATTRACT = 0 forvalues i = 1 (1) 76 { replace topATTRACT=1 if kommune==kname`i' & flagship`i'==1 & year>year`i' *replace topATTRACT=1 if kommune==kname`i' & flagship`i'==1 & year>=year`i' } gen AttractionTown=0 gen topAttractionTown=0 forvalues i = 1 (1) 76 { replace AttractionTown =1 if kommune==kname`i' replace topAttractionTown =1 if kommune==kname`i' & flagship`i'==1 } ** Calculate time before/after FIRST (flagship) attraction gen TimeToRoad = year - tourist_road_year gen TimeToAttract = . gen TimeToTopAttract = . forvalues i = 1 (1) 76 { replace TimeToAttract = 0 if kommune==kname`i' & year==year`i' replace TimeToTopAttract = 0 if kommune==kname`i' & flagship`i'==1 & year==year`i' } replace TimeToAttract = . if year==1997 & knr==514 replace TimeToAttract = . if year==2005 & (knr==514 | knr==1860) replace TimeToAttract = . if year==2006 & knr==2018 replace TimeToAttract = . if year==2007 & knr==1860 replace TimeToAttract = . if year==2010 & (knr==1524 | knr==1421 | knr==1449 | knr==1865 | knr==1929) replace TimeToAttract = . if year==2012 & knr==544 replace TimeToAttract = . if year==2013 & (knr==430 | knr==1134 | knr==2018) replace TimeToAttract = . if year==2014 & (knr==1238 | knr==1554) replace TimeToAttract = . if year==2015 & (knr==430 | knr==514 | knr==1134 | knr==1929 | knr==2003) replace TimeToAttract = . if year==2016 & (knr==1135 | knr==1548 | knr==1551) replace TimeToAttract = . if year==2012 & (knr==2003) replace TimeToAttract = . if year==2018 & (knr==1134 | knr==1449 | knr==1860 | knr==1871) replace TimeToTopAttract = . if year==2010 & knr==1524 replace TimeToTopAttract = . if year==2014 & knr==1554 forvalues i = 1 (1) 28 { replace TimeToAttract = f`i'.TimeToAttract-`i' if f`i'.TimeToAttract==0 replace TimeToAttract = l`i'.TimeToAttract+`i' if l`i'.TimeToAttract==0 replace TimeToTopAttract = f`i'.TimeToTopAttract-`i' if f`i'.TimeToTopAttract==0 replace TimeToTopAttract = l`i'.TimeToTopAttract+`i' if l`i'.TimeToTopAttract==0 } * Generate variables that are defined when there is a tourist road and equal to 1 if there is an attraction opening some time in the dataset. For plotting purposes. gen TopAttractPlot=. forvalues i = 1 (1) 76{ replace TopAttractPlot =0 if tourist_road==1 replace TopAttractPlot =1 if topAttractionTown==1 } gen AttractPlot=. forvalues i = 1 (1) 76{ replace AttractPlot =0 if tourist_road==1 replace AttractPlot =1 if AttractionTown==1 } * (Code up to here puts value 0 in the year of the attraction opening, which could be Jan or Dec of the year...) replace TimeToAttract = TimeToAttract-1 * (this way year 0 is the first full year AFTER the attraction opens) * Calculate distances to OPENED attractions (in km; as the crow flies) run "C:\Users\TrymE\OneDrive\Dokumenter\Masteroppgave\Tourist roads\STATA\vincenty.ado" forvalues i = 1 (1) 76 { vincenty latitude longitude latitude`i' longitude`i' if year>year`i', v(distance`i') inkm } egen Mindist = rowmin(distance*) egen Meandist = rowmean(distance*) * Plots of those municipalities with tourist routes comparing those with top attractions to those without. binscatter lnpop year, by (TopAttractPlot) linetype(connect) binscatter income_av year, by (TopAttractPlot) linetype(connect) binscatter unempshare year, by (TopAttractPlot) linetype(connect) binscatter grantsCAP year, by (TopAttractPlot ) linetype(connect) * Plots of those municipalities with tourist routes comparing those with attractions to those without. binscatter lnpop year, by (AttractPlot) linetype(connect) binscatter income_av year, by (AttractPlot) linetype(connect) binscatter unempshare year, by (AttractPlot) linetype(connect) binscatter grantsCAP year, by (AttractPlot ) linetype(connect) *********************************** *********************************** ******** Regression models ******** *********************************** *********************************** egen city = group(knr) gen trend =year-1989 * Generalized DiD estimate using only municipalities along tourist routes in estimation sample ATTRACT xtreg lnpop ATTRACT i.year if tourist_road==1, fe cluster(knr) xtreg unempshare ATTRACT i.year if tourist_road==1, fe cluster(knr) xtreg accidshare ATTRACT i.year if tourist_road==1, fe cluster(knr) xtreg realhouseprice ATTRACT i.year if tourist_road==1, fe cluster(knr) * Generalized DiD estimate using only municipalities along tourist routes in estimation sample topATTRACT xtreg lnpop topATTRACT i.year if tourist_road==1, fe cluster(knr) xtreg unempshare topATTRACT i.year if tourist_road==1, fe cluster(knr) xtreg accidshare topATTRACT i.year if tourist_road==1, fe cluster(knr) xtreg realhouseprice topATTRACT i.year if tourist_road==1, fe cluster(knr) * Generalized DiD estimate with municipality-specific time trends ATTRACT reg lnpop ATTRACT i.year i.knr##c.trend if tourist_road==1, cluster(knr) reg unempshare ATTRACT i.year i.knr##c.trend if tourist_road==1, cluster(knr) reg accidshare ATTRACT i.year i.knr##c.trend if tourist_road==1, cluster(knr) reg realhouseprice ATTRACT i.year i.knr##c.trend if tourist_road==1, cluster(knr) * Generalized DiD estimate with municipality-specific time trends topATTRACT reg lnpop topATTRACT i.year i.knr##c.trend if tourist_road==1, cluster(knr) reg unempshare topATTRACT i.year i.knr##c.trend if tourist_road==1, cluster(knr) reg accidshare topATTRACT i.year i.knr##c.trend if tourist_road==1, cluster(knr) reg realhouseprice topATTRACT i.year i.knr##c.trend if tourist_road==1, cluster(knr) * Generalized DiD estimate including interaction with minimal distance to nearest open attraction ATTRACT xtreg lnpop ATTRACT##c.Mindist i.year if Mindist<50, fe cluster(knr) xtreg lnpop ATTRACT##c.Mindist i.year if Mindist<75, fe cluster(knr) xtreg lnpop ATTRACT##c.Mindist i.year if Mindist<100, fe cluster(knr) xtreg unempshare ATTRACT##c.Mindist i.year if Mindist<50, fe cluster(knr) xtreg unempshare ATTRACT##c.Mindist i.year if Mindist<75, fe cluster(knr) xtreg unempshare ATTRACT##c.Mindist i.year if Mindist<100, fe cluster(knr) xtreg accidshare ATTRACT##c.Mindist i.year if Mindist<50, fe cluster(knr) xtreg accidshare ATTRACT##c.Mindist i.year if Mindist<75, fe cluster(knr) xtreg accidshare ATTRACT##c.Mindist i.year if Mindist<100, fe cluster(knr) xtreg realhouseprice ATTRACT##c.Mindist i.year if Mindist<50, fe cluster(knr) xtreg realhouseprice ATTRACT##c.Mindist i.year if Mindist<75, fe cluster(knr) xtreg realhouseprice ATTRACT##c.Mindist i.year if Mindist<100, fe cluster(knr) * Generalized DiD estimate including interaction with minimal distance to nearest open attraction topATTRACT xtreg lnpop topATTRACT##c.Mindist i.year if Mindist<50, fe cluster(knr) xtreg lnpop topATTRACT##c.Mindist i.year if Mindist<75, fe cluster(knr) xtreg lnpop topATTRACT##c.Mindist i.year if Mindist<100, fe cluster(knr) xtreg unempshare topATTRACT##c.Mindist i.year if Mindist<50, fe cluster(knr) xtreg unempshare topATTRACT##c.Mindist i.year if Mindist<75, fe cluster(knr) xtreg unempshare topATTRACT##c.Mindist i.year if Mindist<100, fe cluster(knr) xtreg accidshare topATTRACT##c.Mindist i.year if Mindist<50, fe cluster(knr) xtreg accidshare topATTRACT##c.Mindist i.year if Mindist<75, fe cluster(knr) xtreg accidshare topATTRACT##c.Mindist i.year if Mindist<100, fe cluster(knr) xtreg realhouseprice topATTRACT##c.Mindist i.year if Mindist<50, fe cluster(knr) xtreg realhouseprice topATTRACT##c.Mindist i.year if Mindist<75, fe cluster(knr) xtreg realhouseprice topATTRACT##c.Mindist i.year if Mindist<100, fe cluster(knr) *************************************************************************************************** Controlled for multiple Attraction bias ******************************************** ******************************************************************************************** clear all use "C:\Users\TrymE\OneDrive\Dokumenter\Masteroppgave\Tourist roads\STATA\Dataset_K_2018_1Attractremoveddata.dta" gen ATTRACT = 0 forvalues i = 1 (1) 42 { replace ATTRACT =1 if kommune==kname`i' & year>year`i' * (this way ATTRACT is 1 only in years AFTER the attraction opens) *replace ATTRACT =1 if kommune==kname`i' & year>=year`i' * (this way ATTRACT is 1 in the year an attraction opens and all years afterwards) } gen topATTRACT = 0 forvalues i = 1 (1) 42 { replace topATTRACT=1 if kommune==kname`i' & flagship`i'==1 & year>year`i' *replace topATTRACT=1 if kommune==kname`i' & flagship`i'==1 & year>=year`i' } gen AttractionTown=0 gen topAttractionTown=0 forvalues i = 1 (1) 42 { replace AttractionTown =1 if kommune==kname`i' replace topAttractionTown =1 if kommune==kname`i' & flagship`i'==1 } gen TimeToRoad = year - tourist_road_year gen TimeToAttract = . gen TimeToTopAttract = . forvalues i = 1 (1) 42 { replace TimeToAttract = 0 if kommune==kname`i' & year==year`i' replace TimeToTopAttract = 0 if kommune==kname`i' & flagship`i'==1 & year==year`i' } replace TimeToAttract = . if year==1997 & knr==514 replace TimeToAttract = . if year==2005 & (knr==514 | knr==1860) replace TimeToAttract = . if year==2006 & knr==2018 replace TimeToAttract = . if year==2007 & knr==1860 replace TimeToAttract = . if year==2010 & (knr==1524 | knr==1421 | knr==1449 | knr==1865 | knr==1929) replace TimeToAttract = . if year==2012 & knr==544 replace TimeToAttract = . if year==2013 & (knr==430 | knr==1134 | knr==2018) replace TimeToAttract = . if year==2014 & (knr==1238 | knr==1554) replace TimeToAttract = . if year==2015 & (knr==430 | knr==514 | knr==1134 | knr==1929 | knr==2003) replace TimeToAttract = . if year==2016 & (knr==1135 | knr==1548 | knr==1551) replace TimeToAttract = . if year==2012 & (knr==2003) replace TimeToAttract = . if year==2018 & (knr==1134 | knr==1449 | knr==1860 | knr==1871) replace TimeToTopAttract = . if year==2010 & knr==1524 replace TimeToTopAttract = . if year==2014 & knr==1554 gen TopAttraction=. forvalues i = 1 (1) 42{ replace TopAttraction =0 if tourist_road==1 replace TopAttraction =1 if topAttractionTown==1 } gen Attraction=. forvalues i = 1 (1) 42{ replace Attraction =0 if tourist_road==1 replace Attraction =1 if AttractionTown==1 } * Test for characteristics of municipalities selected by Statens Vegvesen collapse longitude latitude tourist_road tourist_road_year area a300_599 a600_899 a900_1199 a1200_1499 a1500_1799 a1800 high300 high1200 pop women age05 age615 age1619 age2066 age67 netimmigr_nat net_immigr_int unemployment_gen unemployment_young income_av income_med freerev taxrev grants cpi2015 newbusiness newhotelsbars bankrupthotelsbars houseprice housesales traffic_accident fatal_acc injured_total law_violate traffic_violate Attraction TopAttraction if year <=1996, by(knr) gen femshare=(women/pop)*100 gen babyshare = (age05/pop)*100 gen youngshare = ((age615 +age1619)/pop)*100 gen workageshare = ((pop-age05-age615-age1619-age67)/pop)*100 gen oldshare = (age67/pop)*100 gen immignatshare = (netimmigr_nat/pop)*100 gen immigintshare = (net_immigr_int/pop)*100 gen unempshare = (unemployment_gen/pop)*100 gen unempyoungshare = (unemployment_young/pop)*100 gen freerevCAP = freerev/pop gen taxrevCAP = taxrev/pop gen grantsCAP = grants/pop gen newbusshare = (newbusiness/(pop/1000))*100 gen newhotelshare = (newhotelsbars/(pop/1000))*100 gen bankruptshare = (bankrupthotelsbars/(pop/1000))*100 gen housesalesshare = (housesales/(pop/1000))*100 gen accidshare = (traffic_accident/(pop/1000))*100 gen fatalshare = (fatal_acc/(pop/1000))*100 gen injuredshare = (injured_total/(pop/1000))*100 gen lovbruddshare = (law_violate/(pop/1000))*100 gen trafficlawshare = (traffic_violate/(pop/1000))*100 gen lnpop = (ln(pop)) gen realhouseprice = houseprice/cpi2015 ttest lnpop, by( TopAttraction ) unequal ttest unempshare , by( TopAttraction ) unequal ttest accidshare , by( TopAttraction ) unequal ttest lnpop, by( Attraction ) unequal ttest unempshare , by( Attraction ) unequal ttest accidshare , by( Attraction ) unequal *********************************** *********************************** ******** Analysis section ******** *********************************** *********************************** clear all set matsize 7500 use "C:\Users\TrymE\OneDrive\Dokumenter\Masteroppgave\Tourist roads\STATA\Dataset_K_2018_1Attractremoveddata.dta" xtset knr year gen lnpop = (ln(pop)) gen femshare=(women/pop)*100 gen youngshare = ((age615 +age1619)/pop)*100 gen workageshare = ((pop-age05-age615-age1619-age67)/pop) gen babyshare = (age05/pop)*100*100 gen oldshare = (age67/pop)*100 gen immignatshare = (netimmigr_nat/pop)*100 gen immigintshare = (net_immigr_int/pop)*100 gen unempshare = (unemployment_gen/pop)*100 gen freerevCAP = (freerev/cpi2015)/pop gen taxrevCAP = (taxrev/cpi2015)/pop gen grantsCAP = (grants/cpi2015)/pop gen realincome_av = income_av/cpi2015 gen realincome_med = income_med/cpi2015 gen realhouseprice = houseprice/cpi2015 gen newbusshare = (newbusiness/pop)*100 gen newhotelshare = (newhotelsbars/(pop/1000))*100 gen bankruptshare = (bankrupthotelsbars/pop)*100 gen housesalesshare = (housesales/(pop/1000))*100 gen accidshare = (traffic_accident/(pop/1000))*100 gen fatalshare = (fatal_acc/(pop/1000))*100 gen injuredshare = (injured_total/pop)*100 gen lovbruddshare = (law_violate/(pop/1000))*100 gen trafficlawshare = (traffic_violate/(pop/1000))*100 summ pop unempshare grantsCAP realincome_av accidshare realhouseprice if (tourist_road==1) * generate key tourist route attraction variables gen ATTRACT = 0 forvalues i = 1 (1) 42 { replace ATTRACT =1 if kommune==kname`i' & year>year`i' * (this way ATTRACT is 1 only in years AFTER the attraction opens) *replace ATTRACT =1 if kommune==kname`i' & year>=year`i' * (this way ATTRACT is 1 in the year an attraction opens and all years afterwards) } gen topATTRACT = 0 forvalues i = 1 (1) 42 { replace topATTRACT=1 if kommune==kname`i' & flagship`i'==1 & year>year`i' *replace topATTRACT=1 if kommune==kname`i' & flagship`i'==1 & year>=year`i' } gen AttractionTown=0 gen topAttractionTown=0 forvalues i = 1 (1) 42 { replace AttractionTown =1 if kommune==kname`i' replace topAttractionTown =1 if kommune==kname`i' & flagship`i'==1 } ** Calculate time before/after FIRST (flagship) attraction gen TimeToRoad = year - tourist_road_year gen TimeToAttract = . gen TimeToTopAttract = . forvalues i = 1 (1) 42 { replace TimeToAttract = 0 if kommune==kname`i' & year==year`i' replace TimeToTopAttract = 0 if kommune==kname`i' & flagship`i'==1 & year==year`i' } replace TimeToAttract = . if year==1997 & knr==514 replace TimeToAttract = . if year==2005 & (knr==514 | knr==1860) replace TimeToAttract = . if year==2006 & knr==2018 replace TimeToAttract = . if year==2007 & knr==1860 replace TimeToAttract = . if year==2010 & (knr==1524 | knr==1421 | knr==1449 | knr==1865 | knr==1929) replace TimeToAttract = . if year==2012 & knr==544 replace TimeToAttract = . if year==2013 & (knr==430 | knr==1134 | knr==2018) replace TimeToAttract = . if year==2014 & (knr==1238 | knr==1554) replace TimeToAttract = . if year==2015 & (knr==430 | knr==514 | knr==1134 | knr==1929 | knr==2003) replace TimeToAttract = . if year==2016 & (knr==1135 | knr==1548 | knr==1551) replace TimeToAttract = . if year==2012 & (knr==2003) replace TimeToAttract = . if year==2018 & (knr==1134 | knr==1449 | knr==1860 | knr==1871) replace TimeToTopAttract = . if year==2010 & knr==1524 replace TimeToTopAttract = . if year==2014 & knr==1554 forvalues i = 1 (1) 28 { replace TimeToAttract = f`i'.TimeToAttract-`i' if f`i'.TimeToAttract==0 replace TimeToAttract = l`i'.TimeToAttract+`i' if l`i'.TimeToAttract==0 replace TimeToTopAttract = f`i'.TimeToTopAttract-`i' if f`i'.TimeToTopAttract==0 replace TimeToTopAttract = l`i'.TimeToTopAttract+`i' if l`i'.TimeToTopAttract==0 } * Generate variables that are defined when there is a tourist road and equal to 1 if there is an attraction opening some time in the dataset. For plotting purposes. gen TopAttractPlot=. forvalues i = 1 (1) 42{ replace TopAttractPlot =0 if tourist_road==1 replace TopAttractPlot =1 if topAttractionTown==1 } gen AttractPlot=. forvalues i = 1 (1) 42{ replace AttractPlot =0 if tourist_road==1 replace AttractPlot =1 if AttractionTown==1 } * (Code up to here puts value 0 in the year of the attraction opening, which could be Jan or Dec of the year...) replace TimeToAttract = TimeToAttract-1 * (this way year 0 is the first full year AFTER the attraction opens) * Calculate distances to OPENED attractions (in km; as the crow flies) run "C:\Users\TrymE\OneDrive\Dokumenter\Masteroppgave\Tourist roads\STATA\vincenty.ado" forvalues i = 1 (1) 42 { vincenty latitude longitude latitude`i' longitude`i' if year>year`i', v(distance`i') inkm } egen Mindist = rowmin(distance*) egen Meandist = rowmean(distance*) * Plots of those municipalities with tourist routes comparing those with top attractions to those without. binscatter lnpop year, by (TopAttractPlot) linetype(connect) binscatter income_av year, by (TopAttractPlot) linetype(connect) binscatter unempshare year, by (TopAttractPlot) linetype(connect) binscatter grantsCAP year, by (TopAttractPlot ) linetype(connect) * Plots of those municipalities with tourist routes comparing those with attractions to those without. binscatter lnpop year, by (AttractPlot) linetype(connect) binscatter income_av year, by (AttractPlot) linetype(connect) binscatter unempshare year, by (AttractPlot) linetype(connect) binscatter grantsCAP year, by (AttractPlot ) linetype(connect) *********************************** *********************************** ******** Regression models ******** *********************************** *********************************** egen city = group(knr) gen trend =year-1989 * Generalized DiD estimate using only municipalities along tourist routes in estimation sample ATTRACT xtreg lnpop ATTRACT i.year if tourist_road==1, fe cluster(knr) xtreg unempshare ATTRACT i.year if tourist_road==1, fe cluster(knr) xtreg accidshare ATTRACT i.year if tourist_road==1, fe cluster(knr) xtreg realhouseprice ATTRACT i.year if tourist_road==1, fe cluster(knr) * Generalized DiD estimate using only municipalities along tourist routes in estimation sample ATTRACT xtreg lnpop topATTRACT i.year if tourist_road==1, fe cluster(knr) xtreg unempshare topATTRACT i.year if tourist_road==1, fe cluster(knr) xtreg accidshare topATTRACT i.year if tourist_road==1, fe cluster(knr) xtreg realhouseprice topATTRACT i.year if tourist_road==1, fe cluster(knr) * Generalized DiD estimate with municipality-specific time trends ATTRACT reg lnpop ATTRACT i.year i.knr##c.trend if tourist_road==1, cluster(knr) reg unempshare ATTRACT i.year i.knr##c.trend if tourist_road==1, cluster(knr) reg accidshare ATTRACT i.year i.knr##c.trend if tourist_road==1, cluster(knr) reg realhouseprice ATTRACT i.year i.knr##c.trend if tourist_road==1, cluster(knr) * Generalized DiD estimate with municipality-specific time trends topATTRACT reg lnpop topATTRACT i.year i.knr##c.trend if tourist_road==1, cluster(knr) reg unempshare topATTRACT i.year i.knr##c.trend if tourist_road==1, cluster(knr) reg accidshare topATTRACT i.year i.knr##c.trend if tourist_road==1, cluster(knr) reg realhouseprice topATTRACT i.year i.knr##c.trend if tourist_road==1, cluster(knr) * Generalized DiD estimate including interaction with minimal distance to nearest open attraction ATTRACT xtreg lnpop ATTRACT##c.Mindist i.year if Mindist<50, fe cluster(knr) xtreg lnpop ATTRACT##c.Mindist i.year if Mindist<75, fe cluster(knr) xtreg lnpop ATTRACT##c.Mindist i.year if Mindist<100, fe cluster(knr) xtreg unempshare ATTRACT##c.Mindist i.year if Mindist<50, fe cluster(knr) xtreg unempshare ATTRACT##c.Mindist i.year if Mindist<75, fe cluster(knr) xtreg unempshare ATTRACT##c.Mindist i.year if Mindist<100, fe cluster(knr) xtreg accidshare ATTRACT##c.Mindist i.year if Mindist<50, fe cluster(knr) xtreg accidshare ATTRACT##c.Mindist i.year if Mindist<75, fe cluster(knr) xtreg accidshare ATTRACT##c.Mindist i.year if Mindist<100, fe cluster(knr) xtreg realhouseprice ATTRACT##c.Mindist i.year if Mindist<50, fe cluster(knr) xtreg realhouseprice ATTRACT##c.Mindist i.year if Mindist<75, fe cluster(knr) xtreg realhouseprice ATTRACT##c.Mindist i.year if Mindist<100, fe cluster(knr) * Generalized DiD estimate including interaction with minimal distance to nearest open attraction topATTRACT xtreg lnpop topATTRACT##c.Mindist i.year if Mindist<50, fe cluster(knr) xtreg lnpop topATTRACT##c.Mindist i.year if Mindist<75, fe cluster(knr) xtreg lnpop topATTRACT##c.Mindist i.year if Mindist<100, fe cluster(knr) xtreg unempshare topATTRACT##c.Mindist i.year if Mindist<50, fe cluster(knr) xtreg unempshare topATTRACT##c.Mindist i.year if Mindist<75, fe cluster(knr) xtreg unempshare topATTRACT##c.Mindist i.year if Mindist<100, fe cluster(knr) xtreg accidshare topATTRACT##c.Mindist i.year if Mindist<50, fe cluster(knr) xtreg accidshare topATTRACT##c.Mindist i.year if Mindist<75, fe cluster(knr) xtreg accidshare topATTRACT##c.Mindist i.year if Mindist<100, fe cluster(knr) xtreg realhouseprice topATTRACT##c.Mindist i.year if Mindist<50, fe cluster(knr) xtreg realhouseprice topATTRACT##c.Mindist i.year if Mindist<75, fe cluster(knr) xtreg realhouseprice topATTRACT##c.Mindist i.year if Mindist<100, fe cluster(knr)