
   ----------use"/Users/raphaelschoenle/Documents/research/2006/international
   finance/Economist  data/date.dta",  clear  merge  year month day using
   "/Users/raphaelschoenle/Documents/research/         2006/international
   finance/Economist  data/economist_temp.dta" drop _merge gen counter=_n
   replace year = 2000 if year==0 replace year = 2001 if year==1 replace year =
   year + 1900 if year<2000 sort year month day replace us= us[_n-1] if us==.
   replace uk= uk[_n-1] if uk==. replace cada= cada[_n-1] if cada==. replace
   france=  france[_n-1]  if  france==. replace germany= germany[_n-1] if
   germany==. replace italy= italy[_n-1] if italy==. replace netherlands=
   netherlands[_n-1] if netherlands==. replace chi= chi[_n-1] if chi==. replace
   russiaus=  russiaus[_n-1] if russiaus==. replace india= india[_n-1] if
   india==.  replace  brazil=  brazil[_n-1] if brazil==. replace bahrain=
   bahrain[_n-1]  if bahrain==. replace mexico= mexico[_n-1] if mexico==.
   replace uae= uae[_n-1] if uae==. replace switzerland= switzerland[_n-1] if
   switzerland==. replace guya= guya[_n-1] if guya==. replace peru= peru[_n-1]
   if peru==. replace israel= israel[_n-1] if israel==. replace southafrica=
   southafrica[_n-1]  if  southafrica==.  replace pamaus= pamaus[_n-1] if
   pamaus==. replace argenti= argenti[_n-1] if argenti==. replace saudiarabia=
   saudiarabia[_n-1] if saudiarabia==. replace japan= japan[_n-1] if japan==.
   replace hongkong= hongkong[_n-1] if hongkong==. replace egypt= egypt[_n-1]
   if egypt==. replace austalia= austalia[_n-1] if austalia==. replace chile=
   chile[_n-1] if chile==. replace colombia= colombia[_n-1] if colombia==.
   replace  ecuadorus=  ecuadorus[_n-1]  if ecuadorus==. replace jamaica=
   jamaica[_n-1]  if  jamaica==.  replace  venezuela=  venezuela[_n-1] if
   venezuela==.  gen  time=_n  tsset  time  gen  dp_us=log(us/L1.us)  gen
   dp_uk=log(uk/L1.uk)       gen       dp_cada=log(cada/L1.cada)      gen
   dp_france=log(france/L1.france) gen dp_germany=log(germany/L1.germany) gen
   dp_italy=log(italy/L1.italy) gen
   dp_netherlands=log(netherlands/L1.netherlands) gen dp_chi=log(chi/L1.chi)
   gen dp_russiaus=log(russiaus/L1.russiaus) gen dp_india=log(india/L1.india)
   gen dp_brazil=log(brazil/L1.brazil) gen dp_bahrain=log(bahrain/L1.bahrain)
   gen  dp_mexico=log(mexico/L1.mexico)  gen  dp_uae=log(uae/L1.uae)  gen
   dp_switzerland=log(switzerland/L1.switzerland)gendp_guya=log(guya/L1.guya)
   gen  dp_peru=log(peru/L1.peru) gen dp_israel=log(israel/L1.israel) gen
   dp_southafrica=log(southafrica/L1.southafrica)                     gen
   dp_pamaus=log(pamaus/L1.pamaus) gen dp_argenti=log(argenti/L1.argenti) gen
   dp_saudiarabia=log(saudiarabia/L1.saudiarabia)                     gen
   dp_japan=log(japan/L1.japan) gen dp_hongkong=log(hongkong/L1.hongkong) gen
   dp_egypt=log(egypt/L1.egypt) gen dp_austalia=log(austalia/L1.austalia) gen
   dp_chile=log(chile/L1.chile) gen dp_colombia=log(colombia/L1.colombia) gen
   dp_ecuadorus=log(ecuadorus/L1.ecuadorus) gen
   dp_jamaica=log(jamaica/L1.jamaica) gen
   dp_venezuela=log(venezuela/L1.venezuela) replace dp_us= dp_us[_n-1] if
   dp_us==0  replace  dp_uk=  dp_uk[_n-1]  if  dp_uk==0  replace dp_cada=
   dp_cada[_n-1]  if  dp_cada==0  replace  dp_france=  dp_france[_n-1] if
   dp_france==0 replace dp_germany= dp_germany[_n-1] if dp_germany==0 replace
   dp_italy=   dp_italy[_n-1]   if  dp_italy==0  replace  dp_netherlands=
   dp_netherlands[_n-1] if dp_netherlands==0 replace dp_chi= dp_chi[_n-1] if
   dp_chi==0 replace dp_russiaus= dp_russiaus[_n-1] if dp_russiaus==0 replace
   dp_india= dp_india[_n-1] if dp_india==0 replace dp_brazil= dp_brazil[_n-1]
   if  dp_brazil==0 replace dp_bahrain= dp_bahrain[_n-1] if dp_bahrain==0
   replace  dp_mexico=  dp_mexico[_n-1]  if  dp_mexico==0 replace dp_uae=
   dp_uae[_n-1] if dp_uae==0 replace dp_switzerland= dp_switzerland[_n-1] if
   dp_switzerland==0 replace dp_guya= dp_guya[_n-1] if dp_guya==0 replace
   dp_peru= dp_peru[_n-1] if dp_peru==0 replace dp_israel= dp_israel[_n-1] if
   dp_israel==0    replace    dp_southafrica=   dp_southafrica[_n-1]   if
   dp_southafrica==0 replace dp_pamaus= dp_pamaus[_n-1] if dp_pamaus==0 replace
   dp_argenti=  dp_argenti[_n-1] if dp_argenti==0 replace dp_saudiarabia=
   dp_saudiarabia[_n-1] if dp_saudiarabia==0 replace dp_japan= dp_japan[_n-1]
   if dp_japan==0 replace dp_hongkong= dp_hongkong[_n-1] if dp_hongkong==0
   replace  dp_egypt=  dp_egypt[_n-1] if dp_egypt==0 replace dp_austalia=
   dp_austalia[_n-1] if dp_austalia==0 replace dp_chile= dp_chile[_n-1] if
   dp_chile==0 replace dp_colombia= dp_colombia[_n-1] if dp_colombia==0 replace
   dp_ecuadorus= dp_ecuadorus[_n-1] if dp_ecuadorus==0 replace dp_jamaica=
   dp_jamaica[_n-1] if dp_jamaica==0 replace dp_venezuela= dp_venezuela[_n-1]
   if dp_venezuela==0 sort year month day save
   "/Users/raphaelschoenle/Documents/research/2006/international
   finance/Economist  data/economist  data  final.dta", replace log using
   "/Users/raphaelschoenle/Documents/research/2006/         international
   finance/Economist     data/economistspells",     replace     t     use
   "/Users/raphaelschoenle/Documents/research/2006/international
   finance/Economist data/economist data final.dta", clear sort us drop if
   us==. by us: egen us_spell=count(us) collapse (mean) us_spell dp_us, by(us)
   save     "/Users/raphaelschoenle/Documents/research/2006/international
   finance/Economist data/economist us spell.dta", replace sum, detail use
   "/Users/raphaelschoenle/Documents/research/2006/international
   finance/Economist data/economist data final.dta", clear sort uk drop if
   uk==. by uk: egen uk_spell=count(uk) collapse (mean) uk_spell dp_uk, by(uk)
   save     "/Users/raphaelschoenle/Documents/research/2006/international
   finance/Economist data/economist uk spell.dta", replace sum, detail use
   "/Users/raphaelschoenle/Documents/research/2006/international
   finance/Economist data/economist data final.dta", clear sort cada drop if
   cada==. by cada: egen cada_spell=count(cada) collapse (mean) cada_spell
   dp_cada, by(cada) save
   "/Users/raphaelschoenle/Documents/research/2006/international
   finance/Economist data/economist cada spell.dta", replace sum, detail use
   "/Users/raphaelschoenle/Documents/research/2006/international
   finance/Economist data/economist data final.dta", clear sort france drop if
   france==.  by  france: egen france_spell=count(france) collapse (mean)
   france_spell dp_france, by(france) save
   "/Users/raphaelschoenle/Documents/research/2006/international
   finance/Economist data/economist france spell.dta", replace sum, detail use
   "/Users/raphaelschoenle/Documents/research/2006/international
   finance/Economist data/economist data final.dta", clear sort germany drop if
   germany==. by germany: egen germany_spell=count(germany) collapse (mean)
   germany_spell dp_germany, by(germany) save
   "/Users/raphaelschoenle/Documents/research/2006/international
   finance/Economist data/economist germany spell.dta", replace sum, detail use
   "/Users/raphaelschoenle/Documents/research/2006/international
   finance/Economist data/economist data final.dta", clear sort italy drop if
   italy==. by italy: egen italy_spell=count(italy) collapse (mean) italy_spell
   dp_italy, by(italy) save
   "/Users/raphaelschoenle/Documents/research/2006/international
   finance/Economist data/economist italy spell.dta", replace sum, detail use
   "/Users/raphaelschoenle/Documents/research/2006/international
   finance/Economist data/economist data final.dta", clear sort netherlands
   drop if netherlands==. by netherlands: egen
   netherlands_spell=count(netherlands) collapse (mean) netherlands_spell
   dp_netherlands, by(netherlands) save
   "/Users/raphaelschoenle/Documents/research/2006/international
   finance/Economist data/economist netherlands spell.dta", replace sum, detail
   use      "/Users/raphaelschoenle/Documents/research/2006/international
   finance/Economist data/economist data final.dta", clear sort chi drop if
   chi==. by chi: egen chi_spell=count(chi) collapse (mean) chi_spell dp_chi,
   by(chi)save"/Users/raphaelschoenle/Documents/research/2006/international
   finance/Economist data/economist chi spell.dta", replace sum, detail use
   "/Users/raphaelschoenle/Documents/research/2006/international
   finance/Economist data/economist data final.dta", clear sort russiaus drop
   if russiaus==. by russiaus: egen russiaus_spell=count(russiaus) collapse
   (mean)      russiaus_spell      dp_russiaus,     by(russiaus)     save
   "/Users/raphaelschoenle/Documents/research/2006/international
   finance/Economist data/economist russiaus spell.dta", replace sum, detail
   use      "/Users/raphaelschoenle/Documents/research/2006/international
   finance/Economist data/economist data final.dta", clear sort india drop if
   india==. by india: egen india_spell=count(india) collapse (mean) india_spell
   dp_india, by(india) save
   "/Users/raphaelschoenle/Documents/research/2006/international
   finance/Economist data/economist india spell.dta", replace sum, detail use
   "/Users/raphaelschoenle/Documents/research/2006/international
   finance/Economist data/economist data final.dta", clear sort brazil drop if
   brazil==.  by  brazil: egen brazil_spell=count(brazil) collapse (mean)
   brazil_spell dp_brazil, by(brazil) save
   "/Users/raphaelschoenle/Documents/research/2006/international
   finance/Economist data/economist brazil spell.dta", replace sum, detail use
   "/Users/raphaelschoenle/Documents/research/2006/international
   finance/Economist data/economist data final.dta", clear sort bahrain drop if
   bahrain==. by bahrain: egen bahrain_spell=count(bahrain) collapse (mean)
   bahrain_spell dp_bahrain, by(bahrain) save
   "/Users/raphaelschoenle/Documents/research/2006/international
   finance/Economist data/economist bahrain spell.dta", replace sum, detail use
   "/Users/raphaelschoenle/Documents/research/2006/international
   finance/Economist data/economist data final.dta", clear sort mexico drop if
   mexico==.  by  mexico: egen mexico_spell=count(mexico) collapse (mean)
   mexico_spell dp_mexico, by(mexico) save
   "/Users/raphaelschoenle/Documents/research/2006/international
   finance/Economist data/economist mexico spell.dta", replace sum, detail use
   "/Users/raphaelschoenle/Documents/research/2006/international
   finance/Economist data/economist data final.dta", clear sort uae drop if
   uae==. by uae: egen uae_spell=count(uae) collapse (mean) uae_spell dp_uae,
   by(uae)save"/Users/raphaelschoenle/Documents/research/2006/international
   finance/Economist data/economist uae spell.dta", replace sum, detail use
   "/Users/raphaelschoenle/Documents/research/2006/international
   finance/Economist data/economist data final.dta", clear sort switzerland
   drop if switzerland==. by switzerland: egen
   switzerland_spell=count(switzerland) collapse (mean) switzerland_spell
   dp_switzerland, by(switzerland) save
   "/Users/raphaelschoenle/Documents/research/2006/international
   finance/Economist data/economist switzerland spell.dta", replace sum, detail
   use      "/Users/raphaelschoenle/Documents/research/2006/international
   finance/Economist data/economist data final.dta", clear sort guya drop if
   guya==. by guya: egen guya_spell=count(guya) collapse (mean) guya_spell
   dp_guya, by(guya) save
   "/Users/raphaelschoenle/Documents/research/2006/international
   finance/Economist data/economist guya spell.dta", replace sum, detail use
   "/Users/raphaelschoenle/Documents/research/2006/international
   finance/Economist data/economist data final.dta", clear sort peru drop if
   peru==. by peru: egen peru_spell=count(peru) collapse (mean) peru_spell
   dp_peru, by(peru) save
   "/Users/raphaelschoenle/Documents/research/2006/international
   finance/Economist data/economist peru spell.dta", replace sum, detail use
   "/Users/raphaelschoenle/Documents/research/2006/international
   finance/Economist data/economist data final.dta", clear sort israel drop if
   israel==.  by  israel: egen israel_spell=count(israel) collapse (mean)
   israel_spell dp_israel, by(israel) save
   "/Users/raphaelschoenle/Documents/research/2006/international
   finance/Economist data/economist israel spell.dta", replace sum, detail use
   "/Users/raphaelschoenle/Documents/research/2006/international
   finance/Economist data/economist data final.dta", clear sort southafrica
   drop if southafrica==. by southafrica: egen
   southafrica_spell=count(southafrica) collapse (mean) southafrica_spell
   dp_southafrica, by(southafrica) save
   "/Users/raphaelschoenle/Documents/research/2006/international
   finance/Economist data/economist southafrica spell.dta", replace sum, detail
   use      "/Users/raphaelschoenle/Documents/research/2006/international
   finance/Economist data/economist data final.dta", clear sort pamaus drop if
   pamaus==.  by  pamaus: egen pamaus_spell=count(pamaus) collapse (mean)
   pamaus_spell dp_pamaus, by(pamaus) save
   "/Users/raphaelschoenle/Documents/research/2006/international
   finance/Economist data/economist pamaus spell.dta", replace sum, detail use
   "/Users/raphaelschoenle/Documents/research/2006/international
   finance/Economist data/economist data final.dta", clear sort argenti drop if
   argenti==. by argenti: egen argenti_spell=count(argenti) collapse (mean)
   argenti_spell dp_argenti, by(argenti) save
   "/Users/raphaelschoenle/Documents/research/2006/international
   finance/Economist data/economist argenti spell.dta", replace sum, detail use
   "/Users/raphaelschoenle/Documents/research/2006/international
   finance/Economist data/economist data final.dta", clear sort saudiarabia
   drop if saudiarabia==. by saudiarabia: egen
   saudiarabia_spell=count(saudiarabia) collapse (mean) saudiarabia_spell
   dp_saudiarabia, by(saudiarabia) save
   "/Users/raphaelschoenle/Documents/research/2006/international
   finance/Economist data/economist saudiarabia spell.dta", replace sum, detail
   use      "/Users/raphaelschoenle/Documents/research/2006/international
   finance/Economist data/economist data final.dta", clear sort japan drop if
   japan==. by japan: egen japan_spell=count(japan) collapse (mean) japan_spell
   dp_japan, by(japan) save
   "/Users/raphaelschoenle/Documents/research/2006/international
   finance/Economist data/economist japan spell.dta", replace sum, detail use
   "/Users/raphaelschoenle/Documents/research/2006/international
   finance/Economist data/economist data final.dta", clear sort hongkong drop
   if hongkong==. by hongkong: egen hongkong_spell=count(hongkong) collapse
   (mean)      hongkong_spell      dp_hongkong,     by(hongkong)     save
   "/Users/raphaelschoenle/Documents/research/2006/international
   finance/Economist data/economist hongkong spell.dta", replace sum, detail
   use      "/Users/raphaelschoenle/Documents/research/2006/international
   finance/Economist data/economist data final.dta", clear sort egypt drop if
   egypt==. by egypt: egen egypt_spell=count(egypt) collapse (mean) egypt_spell
   dp_egypt, by(egypt) save
   "/Users/raphaelschoenle/Documents/research/2006/international
   finance/Economist data/economist egypt spell.dta", replace sum, detail use
   "/Users/raphaelschoenle/Documents/research/2006/international
   finance/Economist data/economist data final.dta", clear sort austalia drop
   if austalia==. by austalia: egen austalia_spell=count(austalia) collapse
   (mean)      austalia_spell      dp_austalia,     by(austalia)     save
   "/Users/raphaelschoenle/Documents/research/2006/international
   finance/Economist data/economist austalia spell.dta", replace sum, detail
   use      "/Users/raphaelschoenle/Documents/research/2006/international
   finance/Economist data/economist data final.dta", clear sort chile drop if
   chile==. by chile: egen chile_spell=count(chile) collapse (mean) chile_spell
   dp_chile, by(chile) save
   "/Users/raphaelschoenle/Documents/research/2006/international
   finance/Economist data/economist chile spell.dta", replace sum, detail use
   "/Users/raphaelschoenle/Documents/research/2006/international
   finance/Economist data/economist data final.dta", clear sort colombia drop
   if colombia==. by colombia: egen colombia_spell=count(colombia) collapse
   (mean)      colombia_spell      dp_colombia,     by(colombia)     save
   "/Users/raphaelschoenle/Documents/research/2006/international
   finance/Economist data/economist colombia spell.dta", replace sum, detail
   use      "/Users/raphaelschoenle/Documents/research/2006/international
   finance/Economist data/economist data final.dta", clear sort ecuadorus drop
   if ecuadorus==. by ecuadorus: egen ecuadorus_spell=count(ecuadorus) collapse
   (mean)     ecuadorus_spell     dp_ecuadorus,     by(ecuadorus)    save
   "/Users/raphaelschoenle/Documents/research/2006/international
   finance/Economist data/economist ecuadorus spell.dta", replace sum, detail
   use      "/Users/raphaelschoenle/Documents/research/2006/international
   finance/Economist data/economist data final.dta", clear sort jamaica drop if
   jamaica==. by jamaica: egen jamaica_spell=count(jamaica) collapse (mean)
   jamaica_spell dp_jamaica, by(jamaica) save
   "/Users/raphaelschoenle/Documents/research/2006/international
   finance/Economist data/economist jamaica spell.dta", replace sum, detail use
   "/Users/raphaelschoenle/Documents/research/2006/international
   finance/Economist data/economist data final.dta", clear sort venezuela drop
   if venezuela==. by venezuela: egen venezuela_spell=count(venezuela) collapse
   (mean)     venezuela_spell     dp_venezuela,     by(venezuela)    save
   "/Users/raphaelschoenle/Documents/research/2006/international
   finance/Economist data/economist venezuela spell.dta", replace sum, detail
   log close
