Hi everyone,
I am working with firm-bank-county-level monthly data and analyzing the effect of natural disasters on bank loans. Specifically, I want to include neighborhood effects to account for the impact of disasters in nearby areas. For this, I need to generate two variables based on FEMA-declared disasters:
A sample database is as follows:
Best regards,
Woahid
I am working with firm-bank-county-level monthly data and analyzing the effect of natural disasters on bank loans. Specifically, I want to include neighborhood effects to account for the impact of disasters in nearby areas. For this, I need to generate two variables based on FEMA-declared disasters:
- fema_border: This variable should equal 1 if a disaster occurs in any county that shares a common border with the focal county, otherwise 0.
- fema_distance: This variable should equal 1 if a disaster occurs within 1000 km of the focal county, otherwise 0.
- County identifiers (county_id).
- Latitude and longitude for each county.
- A binary variable (fema_disaster) indicating if a FEMA-declared disaster occurred in a county for a given month.
- How can I identify counties that share a border?
- What’s the best way to calculate distances between counties and flag those within 1000 km of a disaster?
A sample database is as follows:
Code:
* Example generated by -dataex-. For more info, type help dataex clear input int tm float(firm_bank_county latitude longitude) byte statefips long countyfips byte fema 450 1 42.64758 -83.28208 26 26125 1 450 2 42.64758 -83.28208 26 26125 1 513 2 42.64758 -83.28208 26 26125 0 450 3 42.64758 -83.28208 26 26125 1 513 3 42.64758 -83.28208 26 26125 0 450 4 42.64758 -83.28208 26 26125 1 450 5 42.64758 -83.28208 26 26125 1 450 6 42.64758 -83.28208 26 26125 1 513 7 42.64758 -83.28208 26 26125 0 513 8 42.64758 -83.28208 26 26125 0 450 9 42.64758 -83.28208 26 26125 1 450 10 42.64758 -83.28208 26 26125 1 450 11 42.64758 -83.28208 26 26125 1 513 12 42.64758 -83.28208 26 26125 0 513 13 42.64758 -83.28208 26 26125 0 513 14 42.64758 -83.28208 26 26125 0 527 15 37.970825 -87.48482 18 18163 0 471 16 37.970825 -87.48482 18 18163 0 456 17 37.970825 -87.48482 18 18163 0 682 17 37.970825 -87.48482 18 18163 0 540 24 37.970825 -87.48482 18 18163 1 597 24 37.970825 -87.48482 18 18163 0 456 25 37.970825 -87.48482 18 18163 0 471 25 37.970825 -87.48482 18 18163 0 471 26 37.970825 -87.48482 18 18163 0 588 26 37.970825 -87.48482 18 18163 1 471 27 37.970825 -87.48482 18 18163 0 743 31 37.970825 -87.48482 18 18163 0 743 32 42.4262 -83.37474 26 26163 0 606 33 37.970825 -87.48482 18 18163 0 471 34 37.970825 -87.48482 18 18163 0 456 35 37.970825 -87.48482 18 18163 0 606 36 37.970825 -87.48482 18 18163 0 456 37 37.970825 -87.48482 18 18163 0 471 48 37.970825 -87.48482 18 18163 0 521 49 37.970825 -87.48482 18 18163 0 540 49 37.970825 -87.48482 18 18163 1 574 49 37.970825 -87.48482 18 18163 0 527 50 37.970825 -87.48482 18 18163 0 527 51 37.970825 -87.48482 18 18163 0 end format %tm tm
Best regards,
Woahid
Comment