-
Notifications
You must be signed in to change notification settings - Fork 0
/
wb_data_import.do
27 lines (20 loc) · 977 Bytes
/
wb_data_import.do
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/*
wb_data_import.do
Imports some excel sheets as stata datasets
*/
import excel "QTRACK_FOIA_Request_060313.xls", ///
sheet("Settlement Judgment Information") cellrange(A2) first case(lower) clear
collapse (sum) total_federal_recovery relator_share (max) settlement_judgment_date, by(caption)
save total_settlements_from_qtrack.dta, replace
import excel "QTRACK_FOIA_Request_060313.xls", ///
sheet("Case Information") first case(lower) clear
egen tagged = tag(caption primary_agency)
keep if tagged
duplicates tag caption, gen(dup)
drop if dup & election_decision == "Declined" // one case w/ both DoD & Energy, but energy did not pursue it
keep caption primary_agency
save gov_agencies_from_qtrack.dta, replace
import excel "settlement.xlsx", first case(lower) clear
collapse (sum) total_federal_recovery relator_share, by(caption)
*merge 1:1 caption using total_settlements, update // 14 diagreements
save total_settlements.dta, replace