* code (merge command) assumes that directory is replicationfiles\data_generation\datasources\Religion\

use "http://www.thearda.com/download/download.aspx?file=World%20Religion%20Dataset%20-%20National%20Religion%20Dataset.DTA", clear
keep year country chprtpct chcatpct chortpct changpct chgenpct jdgenpct isgenpct bugenpct higenpct cogenpct sygenpct angenpct norelpct otgenpct sumpct
destring year, ignore(",") replace
merge m:1 country using ARDA_countrycodes.dta
drop if _merge==2 // this drops the two Yemens 1970-1990, and Yemen before 1970
drop _merge
drop if ISO=="VNM" & year<=1970
order ISO country year

* the data in the replication data set have been date-stamped to facilitate the search for discrepancies in the future. The code for this is
* local date=subinstr(c(current_date)," ","",.)
* save ARDA_worldreligion_natl_download`date'_forexport.dta
