//getting daily state level CDC vaccination data and making it weekly
clear

import delimited "C:\Users\lberg\Box\logtrev\app\lynn\COVID-19_Vaccinations_in_the_United_States_Jurisdiction.csv", encoding(UTF-8) 

keep date location series_complete_yes

drop if location == "BP2"
drop if location == "VA2"
drop if location == "DD2"
drop if location == "GU"
drop if location == "PW"
drop if location == "AS"
drop if location == "FM"
drop if location == "VI"
drop if location == "MP"
drop if location == "MH"
drop if location == "PR"
drop if location == "LTC"
drop if location == "IH2"
drop if location == "US"
drop if location == "RP"

gen date2 = date(date, "MDY")
format date2 %td
gen day = dow(date2)

keep if day == 3
drop day

order date date2 location

destring(series_complete_yes), gen(vax) ignore(",")
drop series_complete_yes

//if want data long, end here.  to make it wide:

drop date
reshape wide vax, i(location) j(date2)

//policy data starts May 12. To determine date value for May 12:

scalar yy = td(12may2021)
disp yy
//May 12, 2021 = 22412

//export delimited using "C:\Users\lberg\Box\logtrev\app\lynn\weekly_CDC.csv", replace

// once exported get rid of unneccessary dates and transpose