From 8d8005d6b3b95cb153345bfbaa832504764c7885 Mon Sep 17 00:00:00 2001 From: adrita13 Date: Thu, 2 Apr 2026 02:46:46 -0500 Subject: [PATCH 01/20] Add files via upload --- data_to_merge/FqhcState-2025.csv | 56 +++++++++++++++++++++++++ data_to_merge/HcvTestingState-2025.csv | 57 ++++++++++++++++++++++++++ data_to_merge/HivTestingState-2025.csv | 57 ++++++++++++++++++++++++++ data_to_merge/HospitalState-2025.csv | 57 ++++++++++++++++++++++++++ data_to_merge/MhFacilityState-2025.csv | 57 ++++++++++++++++++++++++++ data_to_merge/PharmacyState-2025.csv | 57 ++++++++++++++++++++++++++ 6 files changed, 341 insertions(+) create mode 100644 data_to_merge/FqhcState-2025.csv create mode 100644 data_to_merge/HcvTestingState-2025.csv create mode 100644 data_to_merge/HivTestingState-2025.csv create mode 100644 data_to_merge/HospitalState-2025.csv create mode 100644 data_to_merge/MhFacilityState-2025.csv create mode 100644 data_to_merge/PharmacyState-2025.csv diff --git a/data_to_merge/FqhcState-2025.csv b/data_to_merge/FqhcState-2025.csv new file mode 100644 index 00000000..87c6913c --- /dev/null +++ b/data_to_merge/FqhcState-2025.csv @@ -0,0 +1,56 @@ +"HEROP_ID","GEOID","TotTracts","FqhcCtTmDr","FqhcCtTmDr2","FqhcTmDrP","FqhcTmDrP2","FqhcAvTmDr","FqhcAvTmDr2" +"040US01","01",1681,1309,838,77.87,49.85,14,28 +"040US02","02",196,153,133,78.06,67.86,10.02,20.04 +"040US04","04",1998,1646,1519,82.38,76.03,9.21,18.42 +"040US05","05",962,742,519,77.13,53.95,13.27,26.53 +"040US06","06",10288,8912,8636,86.63,83.94,4.9,9.81 +"040US08","08",1633,1344,1208,82.3,73.97,9.63,19.25 +"040US09","09",939,0,0,0,0,NA,NA +"040US10","10",300,258,209,86,69.67,9.26,18.52 +"040US11","11",231,206,206,89.18,89.18,1.39,2.77 +"040US12","12",6032,5054,4531,83.79,75.12,7.48,14.96 +"040US13","13",3502,2735,2106,78.1,60.14,10.63,21.26 +"040US15","15",561,410,365,73.08,65.06,8.06,16.12 +"040US16","16",561,388,347,69.16,61.85,12.51,25.01 +"040US17","17",3411,3081,2747,90.33,80.53,8.31,16.61 +"040US18","18",1883,1564,1226,83.06,65.11,11.09,22.17 +"040US19","19",954,667,483,69.92,50.63,20.21,40.42 +"040US20","20",929,711,569,76.53,61.25,13.49,26.99 +"040US21","21",1500,1244,899,82.93,59.93,10.71,21.43 +"040US22","22",1654,1320,1074,79.81,64.93,9.03,18.05 +"040US23","23",86,80,76,93.02,88.37,4.57,9.14 +"040US25","25",458,414,386,90.39,84.28,4.49,8.98 +"040US26","26",3269,2828,2273,86.51,69.53,10.33,20.67 +"040US27","27",1668,1003,741,60.13,44.42,22.94,45.88 +"040US28","28",1080,819,600,75.83,55.56,11.69,23.38 +"040US29","29",1910,1615,1263,84.55,66.13,9.53,19.07 +"040US30","30",367,220,176,59.95,47.96,19.69,39.39 +"040US31","31",572,418,347,73.08,60.66,17.68,35.35 +"040US32","32",862,713,661,82.71,76.68,9.86,19.72 +"040US33","33",407,305,194,74.94,47.67,15.15,30.31 +"040US34","34",2350,2171,2013,92.38,85.66,6.81,13.62 +"040US35","35",716,547,484,76.4,67.6,10.01,20.02 +"040US36","36",5903,5222,4759,88.46,80.62,6.41,12.82 +"040US37","37",3134,2545,1950,81.21,62.22,11.44,22.88 +"040US38","38",256,132,111,51.56,43.36,26.12,52.24 +"040US39","39",3498,3120,2605,89.19,74.47,8.65,17.3 +"040US40","40",1382,1096,798,79.31,57.74,12.92,25.84 +"040US41","41",1153,901,810,78.14,70.25,9.77,19.54 +"040US42","42",3724,3234,2569,86.84,68.98,10.56,21.13 +"040US44","44",255,246,241,96.47,94.51,4.32,8.65 +"040US45","45",1532,1292,981,84.33,64.03,10.39,20.77 +"040US46","46",271,142,116,52.4,42.8,26.2,52.4 +"040US47","47",1906,1519,1120,79.7,58.76,13.29,26.57 +"040US48","48",8355,6405,5385,76.66,64.45,10.76,21.51 +"040US49","49",823,639,524,77.64,63.67,12.38,24.76 +"040US50","50",212,181,104,85.38,49.06,13.2,26.4 +"040US51","51",2460,2062,1609,83.82,65.41,11.39,22.78 +"040US53","53",2074,1666,1500,80.33,72.32,8.52,17.05 +"040US54","54",606,527,402,86.96,66.34,8.69,17.39 +"040US55","55",1656,1298,906,78.38,54.71,15.08,30.16 +"040US56","56",187,80,70,42.78,37.43,24.82,49.65 +"040US60","60",18,0,0,0,0,NA,NA +"040US66","66",57,0,0,0,0,NA,NA +"040US69","69",25,0,0,0,0,NA,NA +"040US72","72",1005,0,0,0,0,NA,NA +"040US78","78",32,0,0,0,0,NA,NA diff --git a/data_to_merge/HcvTestingState-2025.csv b/data_to_merge/HcvTestingState-2025.csv new file mode 100644 index 00000000..4d59ae2e --- /dev/null +++ b/data_to_merge/HcvTestingState-2025.csv @@ -0,0 +1,57 @@ +"HEROP_ID","GEOID","TotTracts","HcvCtTmDr","HcvCtTmDr2","HcvTmDrP","HcvTmDrP2","HcvAvTmDr","HcvAvTmDr2" +"040US01","01",1436,1018,584,70.89,40.67,22.97,45.94 +"040US02","02",177,115,100,64.97,56.5,13.66,27.31 +"040US04","04",1765,1630,1475,92.35,83.57,9.51,19.01 +"040US05","05",823,478,315,58.08,38.27,27.54,55.09 +"040US06","06",9109,8638,7828,94.83,85.94,8.71,17.41 +"040US08","08",1447,1253,1079,86.59,74.57,12.7,25.39 +"040US09","09",879,0,0,0,0,NA,NA +"040US10","10",259,257,203,99.23,78.38,8.94,17.89 +"040US11","11",206,206,206,100,100,3.24,6.47 +"040US12","12",5122,4682,3733,91.41,72.88,11.91,23.83 +"040US13","13",2791,2521,2001,90.33,71.69,13.12,26.24 +"040US15","15",436,379,319,86.93,73.17,13.31,26.61 +"040US16","16",456,312,254,68.42,55.7,20.08,40.16 +"040US17","17",3263,2944,2539,90.22,77.81,10.9,21.8 +"040US18","18",1693,1595,1306,94.21,77.14,10.32,20.65 +"040US19","19",896,655,427,73.1,47.66,20.9,41.8 +"040US20","20",829,573,472,69.12,56.94,22.07,44.14 +"040US21","21",1306,1185,855,90.74,65.47,12.44,24.88 +"040US22","22",1379,1163,908,84.34,65.84,14.98,29.97 +"040US23","23",401,294,177,73.32,44.14,20.88,41.76 +"040US24","24",1465,1449,1318,98.91,89.97,7.3,14.61 +"040US25","25",1613,1599,1454,99.13,90.14,6.59,13.19 +"040US26","26",2972,2660,2188,89.5,73.62,12.19,24.38 +"040US27","27",1502,1158,868,77.1,57.79,18.78,37.55 +"040US28","28",875,520,285,59.43,32.57,28.7,57.41 +"040US29","29",1654,1264,943,76.42,57.01,19.22,38.44 +"040US30","30",319,125,96,39.18,30.09,35.24,70.49 +"040US31","31",553,418,347,75.59,62.75,16.25,32.5 +"040US32","32",779,694,647,89.09,83.06,9.92,19.84 +"040US33","33",349,316,215,90.54,61.6,14.11,28.22 +"040US34","34",2175,2166,1989,99.59,91.45,6.82,13.64 +"040US35","35",612,429,360,70.1,58.82,19.57,39.14 +"040US36","36",5394,5094,4524,94.44,83.87,8.01,16.03 +"040US37","37",2661,2331,1619,87.6,60.84,15.25,30.51 +"040US38","38",228,65,55,28.51,24.12,39.33,78.67 +"040US39","39",3162,3038,2535,96.08,80.17,9.62,19.24 +"040US40","40",1205,967,757,80.25,62.82,17.42,34.84 +"040US41","41",994,767,633,77.16,63.68,17.03,34.05 +"040US42","42",3445,3209,2591,93.15,75.21,11.04,22.08 +"040US44","44",247,246,225,99.6,91.09,6.67,13.34 +"040US45","45",1317,1038,606,78.82,46.01,19.51,39.01 +"040US46","46",242,130,90,53.72,37.19,25.45,50.9 +"040US47","47",1701,1396,971,82.07,57.08,16.71,33.42 +"040US48","48",6884,5959,4986,86.56,72.43,14.04,28.07 +"040US49","49",716,657,616,91.76,86.03,8.66,17.33 +"040US50","50",193,158,90,81.87,46.63,17.5,35 +"040US51","51",2186,1958,1598,89.57,73.1,13.23,26.46 +"040US53","53",1772,1483,1234,83.69,69.64,15.25,30.5 +"040US54","54",546,408,298,74.73,54.58,18.85,37.71 +"040US55","55",1528,1211,921,79.25,60.27,17.63,35.26 +"040US56","56",160,52,43,32.5,26.88,29.3,58.59 +"040US60","60",18,0,0,0,0,NA,NA +"040US66","66",56,0,0,0,0,NA,NA +"040US69","69",23,0,0,0,0,NA,NA +"040US72","72",939,0,0,0,0,NA,NA +"040US78","78",29,0,0,0,0,NA,NA diff --git a/data_to_merge/HivTestingState-2025.csv b/data_to_merge/HivTestingState-2025.csv new file mode 100644 index 00000000..c45c55fc --- /dev/null +++ b/data_to_merge/HivTestingState-2025.csv @@ -0,0 +1,57 @@ +"HEROP_ID","GEOID","TotTracts","HivCtTmDr","HivCtTmDr2","HivTmDrP","HivTmDrP2","HivAvTmDr","HivAvTmDr2" +"040US01","01",1436,987,577,68.73,40.18,24.1,48.2 +"040US02","02",177,116,100,65.54,56.5,13.45,26.9 +"040US04","04",1765,1625,1455,92.07,82.44,9.75,19.5 +"040US05","05",823,565,384,68.65,46.66,22.64,45.29 +"040US06","06",9109,8670,7861,95.18,86.3,8.47,16.93 +"040US08","08",1447,1178,996,81.41,68.83,15.34,30.67 +"040US09","09",879,0,0,0,0,NA,NA +"040US10","10",259,257,203,99.23,78.38,8.71,17.41 +"040US11","11",206,206,206,100,100,2.65,5.3 +"040US12","12",5122,4847,3973,94.63,77.57,10.29,20.58 +"040US13","13",2791,2558,2032,91.65,72.81,12.37,24.73 +"040US15","15",436,386,336,88.53,77.06,11.69,23.38 +"040US16","16",456,312,254,68.42,55.7,20.08,40.16 +"040US17","17",3263,2906,2442,89.06,74.84,11.5,23 +"040US18","18",1693,1590,1302,93.92,76.9,10.26,20.53 +"040US19","19",896,652,423,72.77,47.21,20.96,41.91 +"040US20","20",829,565,469,68.15,56.57,22.16,44.32 +"040US21","21",1306,1187,857,90.89,65.62,12.39,24.78 +"040US22","22",1379,1190,946,86.29,68.6,14.02,28.05 +"040US23","23",401,283,169,70.57,42.14,21.8,43.6 +"040US24","24",1465,1449,1323,98.91,90.31,7.32,14.63 +"040US25","25",1613,1594,1443,98.82,89.46,6.96,13.92 +"040US26","26",2972,2647,2172,89.06,73.08,12.54,25.07 +"040US27","27",1502,1186,879,78.96,58.52,17.91,35.82 +"040US28","28",875,616,366,70.4,41.83,23.77,47.53 +"040US29","29",1654,1251,935,75.63,56.53,19.52,39.04 +"040US30","30",319,125,94,39.18,29.47,35.7,71.39 +"040US31","31",553,421,348,76.13,62.93,16.35,32.7 +"040US32","32",779,694,647,89.09,83.06,10.02,20.03 +"040US33","33",349,316,212,90.54,60.74,14.12,28.24 +"040US34","34",2175,2159,1998,99.26,91.86,6.65,13.29 +"040US35","35",612,429,354,70.1,57.84,19.41,38.82 +"040US36","36",5394,5058,4487,93.77,83.19,8.41,16.82 +"040US37","37",2661,2324,1624,87.34,61.03,15.09,30.18 +"040US38","38",228,65,55,28.51,24.12,39.33,78.67 +"040US39","39",3162,3035,2527,95.98,79.92,9.7,19.39 +"040US40","40",1205,860,653,71.37,54.19,22.31,44.62 +"040US41","41",994,749,614,75.35,61.77,17.7,35.39 +"040US42","42",3445,3202,2569,92.95,74.57,11.2,22.39 +"040US44","44",247,246,225,99.6,91.09,6.58,13.17 +"040US45","45",1317,1084,638,82.31,48.44,18.24,36.47 +"040US46","46",242,129,90,53.31,37.19,26.24,52.49 +"040US47","47",1701,1353,982,79.54,57.73,17.63,35.26 +"040US48","48",6884,5978,4976,86.84,72.28,13.89,27.78 +"040US49","49",716,657,609,91.76,85.06,8.88,17.75 +"040US50","50",193,158,90,81.87,46.63,17.48,34.95 +"040US51","51",2186,1999,1616,91.45,73.92,12.24,24.48 +"040US53","53",1772,1477,1191,83.35,67.21,15.76,31.51 +"040US54","54",546,395,281,72.34,51.47,19.93,39.86 +"040US55","55",1528,1191,911,77.95,59.62,17.89,35.77 +"040US56","56",160,54,45,33.75,28.12,28.36,56.73 +"040US60","60",18,0,0,0,0,NA,NA +"040US66","66",56,0,0,0,0,NA,NA +"040US69","69",23,0,0,0,0,NA,NA +"040US72","72",939,0,0,0,0,NA,NA +"040US78","78",29,0,0,0,0,NA,NA diff --git a/data_to_merge/HospitalState-2025.csv b/data_to_merge/HospitalState-2025.csv new file mode 100644 index 00000000..78b2ea62 --- /dev/null +++ b/data_to_merge/HospitalState-2025.csv @@ -0,0 +1,57 @@ +"HEROP_ID","GEOID","TotTracts","HospCtTmDr","HospCtTmDr2","HospTmDrP","HospTmDrP2","HospAvTmDr","HospAvTmDr2" +"040US01","01",1436,1313,873,91.43,60.79,13.67,27.34 +"040US02","02",177,120,96,67.8,54.24,14.82,29.64 +"040US04","04",1765,1618,1481,91.67,83.91,10.4,20.8 +"040US05","05",823,709,479,86.15,58.2,14.96,29.91 +"040US06","06",9109,8884,8321,97.53,91.35,7.18,14.35 +"040US08","08",1447,1333,1203,92.12,83.14,10.25,20.5 +"040US09","09",879,0,0,0,0,NA,NA +"040US10","10",259,258,205,99.61,79.15,9.7,19.4 +"040US11","11",206,206,206,100,100,3.66,7.33 +"040US12","12",5122,4983,4391,97.29,85.73,9.09,18.18 +"040US13","13",2791,2699,2114,96.7,75.74,11.16,22.32 +"040US15","15",436,383,297,87.84,68.12,12.17,24.35 +"040US16","16",456,387,314,84.87,68.86,14.55,29.1 +"040US17","17",3263,3189,2799,97.73,85.78,7.86,15.73 +"040US18","18",1693,1658,1354,97.93,79.98,9.38,18.75 +"040US19","19",896,878,649,97.99,72.43,10.08,20.17 +"040US20","20",829,799,687,96.38,82.87,8.64,17.28 +"040US21","21",1306,1202,771,92.04,59.04,13.93,27.86 +"040US22","22",1379,1323,1088,95.94,78.9,9.55,19.11 +"040US23","23",401,340,180,84.79,44.89,17.44,34.89 +"040US24","24",1465,1452,1263,99.11,86.21,8.69,17.38 +"040US25","25",1613,1606,1432,99.57,88.78,7.55,15.11 +"040US26","26",2972,2839,2314,95.52,77.86,10.34,20.68 +"040US27","27",1502,1417,1138,94.34,75.77,10.9,21.79 +"040US28","28",875,821,544,93.83,62.17,13.16,26.32 +"040US29","29",1654,1520,1191,91.9,72.01,11.99,23.98 +"040US30","30",319,238,188,74.61,58.93,18.54,37.09 +"040US31","31",553,531,471,96.02,85.17,7.94,15.87 +"040US32","32",779,731,697,93.84,89.47,7.93,15.86 +"040US33","33",349,340,237,97.42,67.91,12.29,24.58 +"040US34","34",2175,2170,1987,99.77,91.36,6.95,13.9 +"040US35","35",612,491,397,80.23,64.87,16.15,32.3 +"040US36","36",5394,5233,4578,97.02,84.87,7.73,15.47 +"040US37","37",2661,2546,1861,95.68,69.94,12.46,24.91 +"040US38","38",228,188,144,82.46,63.16,14.1,28.2 +"040US39","39",3162,3123,2689,98.77,85.04,8.79,17.57 +"040US40","40",1205,1155,933,95.85,77.43,9.72,19.45 +"040US41","41",994,882,753,88.73,75.75,12.86,25.72 +"040US42","42",3445,3332,2744,96.72,79.65,9.47,18.93 +"040US44","44",247,246,228,99.6,92.31,6.56,13.12 +"040US45","45",1317,1200,827,91.12,62.79,14.26,28.51 +"040US46","46",242,204,168,84.3,69.42,13.85,27.71 +"040US47","47",1701,1615,1190,94.94,69.96,12.16,24.32 +"040US48","48",6884,6610,5640,96.02,81.93,9.45,18.91 +"040US49","49",716,672,604,93.85,84.36,9.61,19.23 +"040US50","50",193,158,85,81.87,44.04,18.08,36.15 +"040US51","51",2186,2040,1632,93.32,74.66,11.95,23.89 +"040US53","53",1772,1648,1407,93,79.4,11,22 +"040US54","54",546,438,296,80.22,54.21,17.6,35.19 +"040US55","55",1528,1453,1155,95.09,75.59,10.52,21.05 +"040US56","56",160,118,103,73.75,64.38,16.12,32.24 +"040US60","60",18,0,0,0,0,NA,NA +"040US66","66",56,0,0,0,0,NA,NA +"040US69","69",23,0,0,0,0,NA,NA +"040US72","72",939,0,0,0,0,NA,NA +"040US78","78",29,0,0,0,0,NA,NA diff --git a/data_to_merge/MhFacilityState-2025.csv b/data_to_merge/MhFacilityState-2025.csv new file mode 100644 index 00000000..6f4fa199 --- /dev/null +++ b/data_to_merge/MhFacilityState-2025.csv @@ -0,0 +1,57 @@ +"HEROP_ID","GEOID","TotTracts","MhCtTmDr","MhCtTmDr2","MhTmDrP","MhTmDrP2","MhAvTmDr","MhAvTmDr2" +"040US01","01",1436,1216,821,84.68,57.17,16.14,32.29 +"040US02","02",177,129,118,72.88,66.67,11.47,22.94 +"040US04","04",1765,1655,1555,93.77,88.1,7.53,15.06 +"040US05","05",823,761,539,92.47,65.49,11.93,23.86 +"040US06","06",9109,8847,8254,97.12,90.61,6.51,13.03 +"040US08","08",1447,1331,1213,91.98,83.83,9.31,18.61 +"040US09","09",879,0,0,0,0,NA,NA +"040US10","10",259,258,231,99.61,89.19,7.01,14.02 +"040US11","11",206,206,206,100,100,2.11,4.23 +"040US12","12",5122,5019,4396,97.99,85.83,7.69,15.38 +"040US13","13",2791,2648,2133,94.88,76.42,10.93,21.87 +"040US15","15",436,358,328,82.11,75.23,9.67,19.35 +"040US16","16",456,386,342,84.65,75,11.67,23.34 +"040US17","17",3263,3163,2844,96.94,87.16,6.78,13.55 +"040US18","18",1693,1688,1452,99.7,85.76,7.49,14.99 +"040US19","19",896,807,606,90.07,67.63,11.63,23.26 +"040US20","20",829,750,639,90.47,77.08,10.95,21.9 +"040US21","21",1306,1267,945,97.01,72.36,9.62,19.24 +"040US22","22",1379,1277,1026,92.6,74.4,11.05,22.09 +"040US23","23",401,355,238,88.53,59.35,13.93,27.86 +"040US24","24",1465,1456,1370,99.39,93.52,5.19,10.38 +"040US25","25",1613,1609,1550,99.75,96.09,4.71,9.43 +"040US26","26",2972,2889,2446,97.21,82.3,8.39,16.78 +"040US27","27",1502,1360,1174,90.55,78.16,9.6,19.21 +"040US28","28",875,802,513,91.66,58.63,14.33,28.67 +"040US29","29",1654,1550,1249,93.71,75.51,10.26,20.51 +"040US30","30",319,216,174,67.71,54.55,21.22,42.44 +"040US31","31",553,485,417,87.7,75.41,10.69,21.38 +"040US32","32",779,736,699,94.48,89.73,7.88,15.76 +"040US33","33",349,331,252,94.84,72.21,11.34,22.68 +"040US34","34",2175,2174,2117,99.95,97.33,4.43,8.87 +"040US35","35",612,516,445,84.31,72.71,12.75,25.5 +"040US36","36",5394,5278,4787,97.85,88.75,5.81,11.61 +"040US37","37",2661,2532,2050,95.15,77.04,10.89,21.77 +"040US38","38",228,150,118,65.79,51.75,22.93,45.87 +"040US39","39",3162,3149,2845,99.59,89.97,6.32,12.64 +"040US40","40",1205,1134,914,94.11,75.85,10.5,21 +"040US41","41",994,893,783,89.84,78.77,11.01,22.03 +"040US42","42",3445,3367,2936,97.74,85.22,7.78,15.56 +"040US44","44",247,246,232,99.6,93.93,5.25,10.5 +"040US45","45",1317,1276,918,96.89,69.7,12,24 +"040US46","46",242,156,122,64.46,50.41,22.79,45.57 +"040US47","47",1701,1649,1297,96.94,76.25,10.02,20.05 +"040US48","48",6884,6458,5604,93.81,81.41,10.03,20.07 +"040US49","49",716,693,658,96.79,91.9,5.35,10.7 +"040US50","50",193,167,95,86.53,49.22,16.03,32.06 +"040US51","51",2186,2084,1760,95.33,80.51,9.31,18.62 +"040US53","53",1772,1644,1449,92.78,81.77,9.67,19.33 +"040US54","54",546,484,337,88.64,61.72,13.76,27.52 +"040US55","55",1528,1442,1199,94.37,78.47,8.98,17.96 +"040US56","56",160,127,110,79.38,68.75,14.1,28.2 +"040US60","60",18,0,0,0,0,NA,NA +"040US66","66",56,0,0,0,0,NA,NA +"040US69","69",23,0,0,0,0,NA,NA +"040US72","72",939,0,0,0,0,NA,NA +"040US78","78",29,0,0,0,0,NA,NA diff --git a/data_to_merge/PharmacyState-2025.csv b/data_to_merge/PharmacyState-2025.csv new file mode 100644 index 00000000..b8c01d6c --- /dev/null +++ b/data_to_merge/PharmacyState-2025.csv @@ -0,0 +1,57 @@ +"HEROP_ID","GEOID","TotTracts","RxCtTmDr","RxCtTmDr2","RxTmDrP","RxTmDrP2","RxAvTmDr","RxAvTmDr2" +"040US01","01",1436,1411,1208,98.26,84.12,6.46,12.93 +"040US02","02",177,117,107,66.1,60.45,11.72,23.44 +"040US04","04",1765,1649,1565,93.43,88.67,6.38,12.75 +"040US05","05",823,800,663,97.21,80.56,7.1,14.21 +"040US06","06",9109,8979,8779,98.57,96.38,3.21,6.42 +"040US08","08",1447,1347,1260,93.09,87.08,6.89,13.79 +"040US09","09",879,0,0,0,0,NA,NA +"040US10","10",259,258,258,99.61,99.61,3.02,6.03 +"040US11","11",206,206,206,100,100,0.98,1.97 +"040US12","12",5122,5092,4908,99.41,95.82,3.41,6.82 +"040US13","13",2791,2781,2603,99.64,93.26,4.94,9.87 +"040US15","15",436,418,399,95.87,91.51,5.19,10.38 +"040US16","16",456,407,367,89.25,80.48,9.64,19.27 +"040US17","17",3263,3250,3067,99.6,93.99,3.69,7.37 +"040US18","18",1693,1689,1521,99.76,89.84,5.23,10.45 +"040US19","19",896,882,744,98.44,83.04,6.64,13.28 +"040US20","20",829,820,754,98.91,90.95,4.61,9.22 +"040US21","21",1306,1286,1051,98.47,80.47,7.11,14.22 +"040US22","22",1379,1344,1224,97.46,88.76,5.68,11.37 +"040US23","23",401,370,298,92.27,74.31,10.14,20.28 +"040US24","24",1465,1464,1436,99.93,98.02,3.19,6.39 +"040US25","25",1613,1613,1594,100,98.82,2.55,5.1 +"040US26","26",2972,2930,2742,98.59,92.26,4.77,9.55 +"040US27","27",1502,1442,1264,96.01,84.15,6.67,13.35 +"040US28","28",875,854,676,97.6,77.26,8.22,16.43 +"040US29","29",1654,1626,1432,98.31,86.58,5.97,11.95 +"040US30","30",319,241,205,75.55,64.26,16.46,32.93 +"040US31","31",553,533,495,96.38,89.51,5.53,11.06 +"040US32","32",779,749,724,96.15,92.94,4.86,9.72 +"040US33","33",349,341,298,97.71,85.39,7.2,14.4 +"040US34","34",2175,2175,2168,100,99.68,1.86,3.72 +"040US35","35",612,514,450,83.99,73.53,12.07,24.14 +"040US36","36",5394,5371,5188,99.57,96.18,2.69,5.39 +"040US37","37",2661,2646,2451,99.44,92.11,5.42,10.84 +"040US38","38",228,203,168,89.04,73.68,9.91,19.82 +"040US39","39",3162,3158,3031,99.87,95.86,3.98,7.96 +"040US40","40",1205,1187,1069,98.51,88.71,5.51,11.01 +"040US41","41",994,918,842,92.35,84.71,8.14,16.28 +"040US42","42",3445,3432,3259,99.62,94.6,3.91,7.81 +"040US44","44",247,247,245,100,99.19,2.53,5.06 +"040US45","45",1317,1304,1172,99.01,88.99,5.86,11.72 +"040US46","46",242,201,172,83.06,71.07,13.31,26.63 +"040US47","47",1701,1689,1499,99.29,88.12,5.86,11.71 +"040US48","48",6884,6785,6368,98.56,92.5,4.51,9.02 +"040US49","49",716,685,658,95.67,91.9,5.45,10.89 +"040US50","50",193,179,129,92.75,66.84,11.42,22.85 +"040US51","51",2186,2172,1974,99.36,90.3,5.18,10.36 +"040US53","53",1772,1700,1594,95.94,89.95,5.92,11.83 +"040US54","54",546,521,411,95.42,75.27,8.73,17.45 +"040US55","55",1528,1484,1300,97.12,85.08,6.41,12.83 +"040US56","56",160,130,114,81.25,71.25,13.79,27.59 +"040US60","60",18,0,0,0,0,NA,NA +"040US66","66",56,0,0,0,0,NA,NA +"040US69","69",23,0,0,0,0,NA,NA +"040US72","72",939,0,0,0,0,NA,NA +"040US78","78",29,0,0,0,0,NA,NA From 642494ad028ba6c57b374bb231496b35a9298184 Mon Sep 17 00:00:00 2001 From: adrita13 Date: Thu, 2 Apr 2026 02:48:39 -0500 Subject: [PATCH 02/20] Add files via upload --- scripts/FqhcTractToState.R | 107 ++++++++++++++++++++++++++++++++ scripts/HcvTractToState.R | 108 +++++++++++++++++++++++++++++++++ scripts/HivTractToState.R | 108 +++++++++++++++++++++++++++++++++ scripts/HospTractToState.R | 108 +++++++++++++++++++++++++++++++++ scripts/MhTractToState.R | 107 ++++++++++++++++++++++++++++++++ scripts/PharmacyTractToState.R | 108 +++++++++++++++++++++++++++++++++ 6 files changed, 646 insertions(+) create mode 100644 scripts/FqhcTractToState.R create mode 100644 scripts/HcvTractToState.R create mode 100644 scripts/HivTractToState.R create mode 100644 scripts/HospTractToState.R create mode 100644 scripts/MhTractToState.R create mode 100644 scripts/PharmacyTractToState.R diff --git a/scripts/FqhcTractToState.R b/scripts/FqhcTractToState.R new file mode 100644 index 00000000..474bbb70 --- /dev/null +++ b/scripts/FqhcTractToState.R @@ -0,0 +1,107 @@ +library(tidyverse) +library(sf) +library(tmap) + +Fqhc_tracts25 <- read.csv("C:/Users/adrit/Documents/tract_fqhc_access_2025.csv") + +head(Fqhc_tracts25) +summary(Fqhc_tracts25) +glimpse(Fqhc_tracts25) + +# Flag tracts with Fqhc within 30-minute drive +Fqhc_tracts25$FqhcInRangeDr30 <- ifelse(Fqhc_tracts25$FqhcTmDr < 30, 1, 0) +Fqhc_tracts25$FqhcInRangeDr302 <- ifelse(Fqhc_tracts25$FqhcTmDr2 < 30, 1, 0) + +# Extract State FIPS from tract HEROP_ID +Fqhc_tracts25$StateFIPS <- str_sub(Fqhc_tracts25$HEROP_ID, 6, 7) + +head(Fqhc_tracts25) + +# Aggregate tract-level data to state level +Fqhc_states25 <- Fqhc_tracts25 %>% + group_by(StateFIPS) %>% + summarize( + TotTracts = n(), + + # Number of tracts within 30-minute drive + FqhcCtTmDr = sum(FqhcInRangeDr30, na.rm = TRUE), + FqhcCtTmDr2 = sum(FqhcInRangeDr302, na.rm = TRUE), + + # Percent of tracts within 30-minute drive + FqhcTmDrP = (FqhcCtTmDr / TotTracts) * 100, + FqhcTmDrP2 = (FqhcCtTmDr2 / TotTracts) * 100, + + # Average drive time + FqhcAvTmDr = mean(FqhcTmDr, na.rm = TRUE), + FqhcAvTmDr2 = mean(FqhcTmDr2, na.rm = TRUE) + ) %>% + ungroup() %>% + select( + StateFIPS, TotTracts, + FqhcCtTmDr, FqhcCtTmDr2, + FqhcTmDrP, FqhcTmDrP2, + FqhcAvTmDr, FqhcAvTmDr2 + ) + +head(Fqhc_states25) +summary(Fqhc_states25) +dim(Fqhc_states25) + +# Create state-level HEROP_ID +Fqhc_states25$HEROP_ID <- paste0("040US", Fqhc_states25$StateFIPS) + +glimpse(Fqhc_states25) + +# Read state GeoJSON +state.sf <- st_read("https://herop-geodata.s3.us-east-2.amazonaws.com/census/state-2020-500k.geojson") + +glimpse(state.sf) +names(state.sf) + +# Keep only needed columns +state.sf2 <- state.sf %>% + select(HEROP_ID, NAME, STUSPS, GEOID) + +dim(state.sf2) +head(state.sf2) + +# Merge state geometry with state metrics +state.Fqhc <- merge(state.sf2, Fqhc_states25, by = "HEROP_ID") + +dim(state.Fqhc) +head(state.Fqhc) + +# Maps +tm_shape(state.Fqhc) + tm_polygons("FqhcAvTmDr", style = "jenks") +tm_shape(state.Fqhc) + tm_fill("FqhcAvTmDr", style = "jenks") +tm_shape(state.Fqhc) + tm_fill("FqhcTmDrP2", style = "jenks") +tm_shape(state.Fqhc) + tm_fill("FqhcTmDrP", style = "jenks") +tm_shape(state.Fqhc) + tm_fill("FqhcCtTmDr2", style = "jenks") +tm_shape(state.Fqhc) + tm_fill("FqhcCtTmDr", style = "jenks") +tm_shape(state.Fqhc) + tm_fill("TotTracts", style = "jenks") + +# Drop geometry for CSV export +state.Fqhc.save <- st_drop_geometry(state.Fqhc) + +state.Fqhc.save <- state.Fqhc.save %>% + select( + HEROP_ID, GEOID, + TotTracts, + FqhcCtTmDr, FqhcCtTmDr2, + FqhcTmDrP, FqhcTmDrP2, + FqhcAvTmDr, FqhcAvTmDr2 + ) + +# Round numeric columns to 2 decimals +state.Fqhc.save2 <- state.Fqhc.save %>% + mutate(across(where(is.numeric), ~ round(.x, 2))) + +head(state.Fqhc.save2) +dim(state.Fqhc.save2) + +# Export CSV +write.csv( + state.Fqhc.save2, + "C:/Users/adrit/Downloads/FqhcState-2025.csv", + row.names = FALSE +) diff --git a/scripts/HcvTractToState.R b/scripts/HcvTractToState.R new file mode 100644 index 00000000..07f3467d --- /dev/null +++ b/scripts/HcvTractToState.R @@ -0,0 +1,108 @@ +library(tidyverse) +library(sf) +library(tmap) + +Hcv_tracts25 <- read.csv("C:/Users/adrit/Downloads/Hcv-Tract-2025.csv") + +head(Hcv_tracts25) +summary(Hcv_tracts25) +glimpse(Hcv_tracts25) + +# Flag tracts with Hcv Testing Facility within 30-minute drive +Hcv_tracts25$HcvInRangeDr30 <- ifelse(Hcv_tracts25$HcvTmDr < 30, 1, 0) +Hcv_tracts25$HcvInRangeDr302 <- ifelse(Hcv_tracts25$HcvTmDr2 < 30, 1, 0) + +# Extract State FIPS from tract HEROP_ID +Hcv_tracts25$StateFIPS <- str_sub(Hcv_tracts25$HEROP_ID, 6, 7) + +head(Hcv_tracts25) + +# Aggregate tract-level data to state level +Hcv_states25 <- Hcv_tracts25 %>% + group_by(StateFIPS) %>% + summarize( + TotTracts = n(), + + # Number of tracts within 30-minute drive + HcvCtTmDr = sum(HcvInRangeDr30, na.rm = TRUE), + HcvCtTmDr2 = sum(HcvInRangeDr302, na.rm = TRUE), + + # Percent of tracts within 30-minute drive + HcvTmDrP = (HcvCtTmDr / TotTracts) * 100, + HcvTmDrP2 = (HcvCtTmDr2 / TotTracts) * 100, + + # Average drive time + HcvAvTmDr = mean(HcvTmDr, na.rm = TRUE), + HcvAvTmDr2 = mean(HcvTmDr2, na.rm = TRUE) + ) %>% + ungroup() %>% + select( + StateFIPS, TotTracts, + HcvCtTmDr, HcvCtTmDr2, + HcvTmDrP, HcvTmDrP2, + HcvAvTmDr, HcvAvTmDr2 + ) + +head(Hcv_states25) +summary(Hcv_states25) +dim(Hcv_states25) + +# Create state-level HEROP_ID +Hcv_states25$HEROP_ID <- paste0("040US", Hcv_states25$StateFIPS) + +glimpse(Hcv_states25) + +# Read state GeoJSON +state.sf <- st_read("https://herop-geodata.s3.us-east-2.amazonaws.com/census/state-2020-500k.geojson") + +glimpse(state.sf) +names(state.sf) + +# Keep only needed columns +state.sf2 <- state.sf %>% + select(HEROP_ID, NAME, STUSPS, GEOID) + +dim(state.sf2) +head(state.sf2) + +# Merge state geometry with state metrics +state.Hcv <- merge(state.sf2, Hcv_states25, by = "HEROP_ID") + +dim(state.Hcv) +head(state.Hcv) + +# Maps +tm_shape(state.Hcv) + tm_polygons("HcvAvTmDr", style = "jenks") +tm_shape(state.Hcv) + tm_fill("HcvAvTmDr", style = "jenks") +tm_shape(state.Hcv) + tm_fill("HcvTmDrP2", style = "jenks") +tm_shape(state.Hcv) + tm_fill("HcvTmDrP", style = "jenks") +tm_shape(state.Hcv) + tm_fill("HcvCtTmDr2", style = "jenks") +tm_shape(state.Hcv) + tm_fill("HcvCtTmDr", style = "jenks") +tm_shape(state.Hcv) + tm_fill("TotTracts", style = "jenks") + +# Drop geometry for CSV export +state.Hcv.save <- st_drop_geometry(state.Hcv) + +state.Hcv.save <- state.Hcv.save %>% + select( + HEROP_ID, GEOID, + TotTracts, + HcvCtTmDr, HcvCtTmDr2, + HcvTmDrP, HcvTmDrP2, + HcvAvTmDr, HcvAvTmDr2 + ) + +# Round numeric columns to 2 decimals +state.Hcv.save2 <- state.Hcv.save %>% + mutate(across(where(is.numeric), ~ round(.x, 2))) + +head(state.Hcv.save2) +dim(state.Hcv.save2) + +# Export CSV +write.csv( + state.Hcv.save2, + "C:/Users/adrit/Downloads/HcvState-2025.csv", + row.names = FALSE +) + diff --git a/scripts/HivTractToState.R b/scripts/HivTractToState.R new file mode 100644 index 00000000..8f960a44 --- /dev/null +++ b/scripts/HivTractToState.R @@ -0,0 +1,108 @@ +library(tidyverse) +library(sf) +library(tmap) + +Hiv_tracts25 <- read.csv("C:/Users/adrit/Downloads/Hiv-Tract-2025.csv") + +head(Hiv_tracts25) +summary(Hiv_tracts25) +glimpse(Hiv_tracts25) + +# Flag tracts with HIV Testing Facility within 30-minute drive +Hiv_tracts25$HivInRangeDr30 <- ifelse(Hiv_tracts25$HivTmDr < 30, 1, 0) +Hiv_tracts25$HivInRangeDr302 <- ifelse(Hiv_tracts25$HivTmDr2 < 30, 1, 0) + +# Extract State FIPS from tract HEROP_ID +Hiv_tracts25$StateFIPS <- str_sub(Hiv_tracts25$HEROP_ID, 6, 7) + +head(Hiv_tracts25) + +# Aggregate tract-level data to state level +Hiv_states25 <- Hiv_tracts25 %>% + group_by(StateFIPS) %>% + summarize( + TotTracts = n(), + + # Number of tracts within 30-minute drive + HivCtTmDr = sum(HivInRangeDr30, na.rm = TRUE), + HivCtTmDr2 = sum(HivInRangeDr302, na.rm = TRUE), + + # Percent of tracts within 30-minute drive + HivTmDrP = (HivCtTmDr / TotTracts) * 100, + HivTmDrP2 = (HivCtTmDr2 / TotTracts) * 100, + + # Average drive time + HivAvTmDr = mean(HivTmDr, na.rm = TRUE), + HivAvTmDr2 = mean(HivTmDr2, na.rm = TRUE) + ) %>% + ungroup() %>% + select( + StateFIPS, TotTracts, + HivCtTmDr, HivCtTmDr2, + HivTmDrP, HivTmDrP2, + HivAvTmDr, HivAvTmDr2 + ) + +head(Hiv_states25) +summary(Hiv_states25) +dim(Hiv_states25) + +# Create state-level HEROP_ID +Hiv_states25$HEROP_ID <- paste0("040US", Hiv_states25$StateFIPS) + +glimpse(Hiv_states25) + +# Read state GeoJSON +state.sf <- st_read("https://herop-geodata.s3.us-east-2.amazonaws.com/census/state-2020-500k.geojson") + +glimpse(state.sf) +names(state.sf) + +# Keep only needed columns +state.sf2 <- state.sf %>% + select(HEROP_ID, NAME, STUSPS, GEOID) + +dim(state.sf2) +head(state.sf2) + +# Merge state geometry with state metrics +state.Hiv <- merge(state.sf2, Hiv_states25, by = "HEROP_ID") + +dim(state.Hiv) +head(state.Hiv) + +# Maps +tm_shape(state.Hiv) + tm_polygons("HivAvTmDr", style = "jenks") +tm_shape(state.Hiv) + tm_fill("HivAvTmDr", style = "jenks") +tm_shape(state.Hiv) + tm_fill("HivTmDrP2", style = "jenks") +tm_shape(state.Hiv) + tm_fill("HivTmDrP", style = "jenks") +tm_shape(state.Hiv) + tm_fill("HivCtTmDr2", style = "jenks") +tm_shape(state.Hiv) + tm_fill("HivCtTmDr", style = "jenks") +tm_shape(state.Hiv) + tm_fill("TotTracts", style = "jenks") + +# Drop geometry for CSV export +state.Hiv.save <- st_drop_geometry(state.Hiv) + +state.Hiv.save <- state.Hiv.save %>% + select( + HEROP_ID, GEOID, + TotTracts, + HivCtTmDr, HivCtTmDr2, + HivTmDrP, HivTmDrP2, + HivAvTmDr, HivAvTmDr2 + ) + +# Round numeric columns to 2 decimals +state.Hiv.save2 <- state.Hiv.save %>% + mutate(across(where(is.numeric), ~ round(.x, 2))) + +head(state.Hiv.save2) +dim(state.Hiv.save2) + +# Export CSV +write.csv( + state.Hiv.save2, + "C:/Users/adrit/Downloads/HivState-2025.csv", + row.names = FALSE +) + diff --git a/scripts/HospTractToState.R b/scripts/HospTractToState.R new file mode 100644 index 00000000..300e6f23 --- /dev/null +++ b/scripts/HospTractToState.R @@ -0,0 +1,108 @@ +library(tidyverse) +library(sf) +library(tmap) + +Hosp_tracts25 <- read.csv("C:/Users/adrit/Downloads/HospFacility-Tract25.csv") + +head(Hosp_tracts25) +summary(Hosp_tracts25) +glimpse(Hosp_tracts25) + +# Flag tracts with Hospital within 30-minute drive +Hosp_tracts25$HospInRangeDr30 <- ifelse(Hosp_tracts25$HospTmDr < 30, 1, 0) +Hosp_tracts25$HospInRangeDr302 <- ifelse(Hosp_tracts25$HospTmDr2 < 30, 1, 0) + +# Extract State FIPS from tract HEROP_ID +Hosp_tracts25$StateFIPS <- str_sub(Hosp_tracts25$HEROP_ID, 6, 7) + +head(Hosp_tracts25) + +# Aggregate tract-level data to state level +Hosp_states25 <- Hosp_tracts25 %>% + group_by(StateFIPS) %>% + summarize( + TotTracts = n(), + + # Number of tracts within 30-minute drive + HospCtTmDr = sum(HospInRangeDr30, na.rm = TRUE), + HospCtTmDr2 = sum(HospInRangeDr302, na.rm = TRUE), + + # Percent of tracts within 30-minute drive + HospTmDrP = (HospCtTmDr / TotTracts) * 100, + HospTmDrP2 = (HospCtTmDr2 / TotTracts) * 100, + + # Average drive time + HospAvTmDr = mean(HospTmDr, na.rm = TRUE), + HospAvTmDr2 = mean(HospTmDr2, na.rm = TRUE) + ) %>% + ungroup() %>% + select( + StateFIPS, TotTracts, + HospCtTmDr, HospCtTmDr2, + HospTmDrP, HospTmDrP2, + HospAvTmDr, HospAvTmDr2 + ) + +head(Hosp_states25) +summary(Hosp_states25) +dim(Hosp_states25) + +# Create state-level HEROP_ID +Hosp_states25$HEROP_ID <- paste0("040US", Hosp_states25$StateFIPS) + +glimpse(Hosp_states25) + +# Read state GeoJSON +state.sf <- st_read("https://herop-geodata.s3.us-east-2.amazonaws.com/census/state-2020-500k.geojson") + +glimpse(state.sf) +names(state.sf) + +# Keep only needed columns +state.sf2 <- state.sf %>% + select(HEROP_ID, NAME, STUSPS, GEOID) + +dim(state.sf2) +head(state.sf2) + +# Merge state geometry with state metrics +state.Hosp <- merge(state.sf2, Hosp_states25, by = "HEROP_ID") + +dim(state.Hosp) +head(state.Hosp) + +# Maps +tm_shape(state.Hosp) + tm_polygons("HospAvTmDr", style = "jenks") +tm_shape(state.Hosp) + tm_fill("HospAvTmDr", style = "jenks") +tm_shape(state.Hosp) + tm_fill("HospTmDrP2", style = "jenks") +tm_shape(state.Hosp) + tm_fill("HospTmDrP", style = "jenks") +tm_shape(state.Hosp) + tm_fill("HospCtTmDr2", style = "jenks") +tm_shape(state.Hosp) + tm_fill("HospCtTmDr", style = "jenks") +tm_shape(state.Hosp) + tm_fill("TotTracts", style = "jenks") + +# Drop geometry for CSV export +state.Hosp.save <- st_drop_geometry(state.Hosp) + +state.Hosp.save <- state.Hosp.save %>% + select( + HEROP_ID, GEOID, + TotTracts, + HospCtTmDr, HospCtTmDr2, + HospTmDrP, HospTmDrP2, + HospAvTmDr, HospAvTmDr2 + ) + +# Round numeric columns to 2 decimals +state.Hosp.save2 <- state.Hosp.save %>% + mutate(across(where(is.numeric), ~ round(.x, 2))) + +head(state.Hosp.save2) +dim(state.Hosp.save2) + +# Export CSV +write.csv( + state.Hosp.save2, + "C:/Users/adrit/Downloads/HospFacilityState-2025.csv", + row.names = FALSE +) + diff --git a/scripts/MhTractToState.R b/scripts/MhTractToState.R new file mode 100644 index 00000000..3724b980 --- /dev/null +++ b/scripts/MhTractToState.R @@ -0,0 +1,107 @@ +library(tidyverse) +library(sf) +library(tmap) + +Mh_tracts25 <- read.csv("C:/Users/adrit/Downloads/Mh_tract25.csv") + +head(Mh_tracts25) +summary(Mh_tracts25) +glimpse(Mh_tracts25) + +# Flag tracts with Mental Health Treatment Facility within 30-minute drive +Mh_tracts25$MhInRangeDr30 <- ifelse(Mh_tracts25$MhTmDr < 30, 1, 0) +Mh_tracts25$MhInRangeDr302 <- ifelse(Mh_tracts25$MhTmDr2 < 30, 1, 0) + +# Extract State FIPS from tract HEROP_ID +Mh_tracts25$StateFIPS <- str_sub(Mh_tracts25$HEROP_ID, 6, 7) + +head(Mh_tracts25) + +# Aggregate tract-level data to state level +Mh_states25 <- Mh_tracts25 %>% + group_by(StateFIPS) %>% + summarize( + TotTracts = n(), + + # Number of tracts within 30-minute drive + MhCtTmDr = sum(MhInRangeDr30, na.rm = TRUE), + MhCtTmDr2 = sum(MhInRangeDr302, na.rm = TRUE), + + # Percent of tracts within 30-minute drive + MhTmDrP = (MhCtTmDr / TotTracts) * 100, + MhTmDrP2 = (MhCtTmDr2 / TotTracts) * 100, + + # Average drive time + MhAvTmDr = mean(MhTmDr, na.rm = TRUE), + MhAvTmDr2 = mean(MhTmDr2, na.rm = TRUE) + ) %>% + ungroup() %>% + select( + StateFIPS, TotTracts, + MhCtTmDr, MhCtTmDr2, + MhTmDrP, MhTmDrP2, + MhAvTmDr, MhAvTmDr2 + ) + +head(Mh_states25) +summary(Mh_states25) +dim(Mh_states25) + +# Create state-level HEROP_ID +Mh_states25$HEROP_ID <- paste0("040US", Mh_states25$StateFIPS) + +glimpse(Mh_states25) + +# Read state GeoJSON +state.sf <- st_read("https://herop-geodata.s3.us-east-2.amazonaws.com/census/state-2020-500k.geojson") + +glimpse(state.sf) +names(state.sf) + +# Keep only needed columns +state.sf2 <- state.sf %>% + select(HEROP_ID, NAME, STUSPS, GEOID) + +dim(state.sf2) +head(state.sf2) + +# Merge state geometry with state metrics +state.Mh <- merge(state.sf2, Mh_states25, by = "HEROP_ID") + +dim(state.Mh) +head(state.Mh) + +# Maps +tm_shape(state.Mh) + tm_polygons("MhAvTmDr", style = "jenks") +tm_shape(state.Mh) + tm_fill("MhAvTmDr", style = "jenks") +tm_shape(state.Mh) + tm_fill("MhTmDrP2", style = "jenks") +tm_shape(state.Mh) + tm_fill("MhTmDrP", style = "jenks") +tm_shape(state.Mh) + tm_fill("MhCtTmDr2", style = "jenks") +tm_shape(state.Mh) + tm_fill("MhCtTmDr", style = "jenks") +tm_shape(state.Mh) + tm_fill("TotTracts", style = "jenks") + +# Drop geometry for CSV export +state.Mh.save <- st_drop_geometry(state.Mh) + +state.Mh.save <- state.Mh.save %>% + select( + HEROP_ID, GEOID, + TotTracts, + MhCtTmDr, MhCtTmDr2, + MhTmDrP, MhTmDrP2, + MhAvTmDr, MhAvTmDr2 + ) + +# Round numeric columns to 2 decimals +state.Mh.save2 <- state.Mh.save %>% + mutate(across(where(is.numeric), ~ round(.x, 2))) + +head(state.Mh.save2) +dim(state.Mh.save2) + +# Export CSV +write.csv( + state.Mh.save2, + "C:/Users/adrit/Downloads/MhTestingState-2025.csv", + row.names = FALSE +) diff --git a/scripts/PharmacyTractToState.R b/scripts/PharmacyTractToState.R new file mode 100644 index 00000000..47eac616 --- /dev/null +++ b/scripts/PharmacyTractToState.R @@ -0,0 +1,108 @@ +library(tidyverse) +library(sf) +library(tmap) + +Rx_tracts25 <- read.csv("C:/Users/adrit/Downloads/Pharmacy-Tract-2025 (1).csv") + +head(Rx_tracts25) +summary(Rx_tracts25) +glimpse(Rx_tracts25) + +# Flag tracts with Pharmacy within 30-minute drive +Rx_tracts25$RxInRangeDr30 <- ifelse(Rx_tracts25$RxTmDr < 30, 1, 0) +Rx_tracts25$RxInRangeDr302 <- ifelse(Rx_tracts25$RxTmDr2 < 30, 1, 0) + +# Extract State FIPS from tract HEROP_ID +Rx_tracts25$StateFIPS <- str_sub(Rx_tracts25$HEROP_ID, 6, 7) + +head(Rx_tracts25) + +# Aggregate tract-level data to state level +Rx_states25 <- Rx_tracts25 %>% + group_by(StateFIPS) %>% + summarize( + TotTracts = n(), + + # Number of tracts within 30-minute drive + RxCtTmDr = sum(RxInRangeDr30, na.rm = TRUE), + RxCtTmDr2 = sum(RxInRangeDr302, na.rm = TRUE), + + # Percent of tracts within 30-minute drive + RxTmDrP = (RxCtTmDr / TotTracts) * 100, + RxTmDrP2 = (RxCtTmDr2 / TotTracts) * 100, + + # Average drive time + RxAvTmDr = mean(RxTmDr, na.rm = TRUE), + RxAvTmDr2 = mean(RxTmDr2, na.rm = TRUE) + ) %>% + ungroup() %>% + select( + StateFIPS, TotTracts, + RxCtTmDr, RxCtTmDr2, + RxTmDrP, RxTmDrP2, + RxAvTmDr, RxAvTmDr2 + ) + +head(Rx_states25) +summary(Rx_states25) +dim(Rx_states25) + +# Create state-level HEROP_ID +Rx_states25$HEROP_ID <- paste0("040US", Rx_states25$StateFIPS) + +glimpse(Rx_states25) + +# Read state GeoJSON +state.sf <- st_read("https://herop-geodata.s3.us-east-2.amazonaws.com/census/state-2020-500k.geojson") + +glimpse(state.sf) +names(state.sf) + +# Keep only needed columns +state.sf2 <- state.sf %>% + select(HEROP_ID, NAME, STUSPS, GEOID) + +dim(state.sf2) +head(state.sf2) + +# Merge state geometry with state metrics +state.Rx <- merge(state.sf2, Rx_states25, by = "HEROP_ID") + +dim(state.Rx) +head(state.Rx) + +# Maps +tm_shape(state.Rx) + tm_polygons("RxAvTmDr", style = "jenks") +tm_shape(state.Rx) + tm_fill("RxAvTmDr", style = "jenks") +tm_shape(state.Rx) + tm_fill("RxTmDrP2", style = "jenks") +tm_shape(state.Rx) + tm_fill("RxTmDrP", style = "jenks") +tm_shape(state.Rx) + tm_fill("RxCtTmDr2", style = "jenks") +tm_shape(state.Rx) + tm_fill("RxCtTmDr", style = "jenks") +tm_shape(state.Rx) + tm_fill("TotTracts", style = "jenks") + +# Drop geometry for CSV export +state.Rx.save <- st_drop_geometry(state.Rx) + +state.Rx.save <- state.Rx.save %>% + select( + HEROP_ID, GEOID, + TotTracts, + RxCtTmDr, RxCtTmDr2, + RxTmDrP, RxTmDrP2, + RxAvTmDr, RxAvTmDr2 + ) + +# Round numeric columns to 2 decimals +state.Rx.save2 <- state.Rx.save %>% + mutate(across(where(is.numeric), ~ round(.x, 2))) + +head(state.Rx.save2) +dim(state.Rx.save2) + +# Export CSV +write.csv( + state.Rx.save2, + "C:/Users/adrit/Downloads/PharmacyState-2025.csv", + row.names = FALSE +) + From 889ee3b822147bb00da996b9aedeb06f81f7dca1 Mon Sep 17 00:00:00 2001 From: adrita13 Date: Wed, 8 Apr 2026 13:26:04 -0500 Subject: [PATCH 03/20] Add Fqhc_State25.csv for data merging --- data_to_merge/{FqhcState-2025.csv => Fqhc_State25.csv} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename data_to_merge/{FqhcState-2025.csv => Fqhc_State25.csv} (100%) diff --git a/data_to_merge/FqhcState-2025.csv b/data_to_merge/Fqhc_State25.csv similarity index 100% rename from data_to_merge/FqhcState-2025.csv rename to data_to_merge/Fqhc_State25.csv From 4a21fff017864be3e33174b50b4e1513927ca712 Mon Sep 17 00:00:00 2001 From: adrita13 Date: Wed, 8 Apr 2026 13:26:56 -0500 Subject: [PATCH 04/20] Add HcvTesting_State25.csv for data merging --- .../{HcvTestingState-2025.csv => HcvTesting_State25.csv} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename data_to_merge/{HcvTestingState-2025.csv => HcvTesting_State25.csv} (100%) diff --git a/data_to_merge/HcvTestingState-2025.csv b/data_to_merge/HcvTesting_State25.csv similarity index 100% rename from data_to_merge/HcvTestingState-2025.csv rename to data_to_merge/HcvTesting_State25.csv From 532b82b102bd2fcf6c5533d8410271f71d4709af Mon Sep 17 00:00:00 2001 From: adrita13 Date: Wed, 8 Apr 2026 13:27:28 -0500 Subject: [PATCH 05/20] Rename HivTestingState-2025.csv to HivTesting_State25.csv --- .../{HivTestingState-2025.csv => HivTesting_State25.csv} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename data_to_merge/{HivTestingState-2025.csv => HivTesting_State25.csv} (100%) diff --git a/data_to_merge/HivTestingState-2025.csv b/data_to_merge/HivTesting_State25.csv similarity index 100% rename from data_to_merge/HivTestingState-2025.csv rename to data_to_merge/HivTesting_State25.csv From 26b5dbaeeaadd90d4980a951633944f78877c094 Mon Sep 17 00:00:00 2001 From: adrita13 Date: Wed, 8 Apr 2026 13:28:43 -0500 Subject: [PATCH 06/20] Add MhFacility_State25.csv for data merging --- .../{MhFacilityState-2025.csv => MhFacility_State25.csv} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename data_to_merge/{MhFacilityState-2025.csv => MhFacility_State25.csv} (100%) diff --git a/data_to_merge/MhFacilityState-2025.csv b/data_to_merge/MhFacility_State25.csv similarity index 100% rename from data_to_merge/MhFacilityState-2025.csv rename to data_to_merge/MhFacility_State25.csv From af2d87720c43ca0fd023b8c9d6e7381525426353 Mon Sep 17 00:00:00 2001 From: adrita13 Date: Wed, 8 Apr 2026 13:30:04 -0500 Subject: [PATCH 07/20] Add Pharmacy_State25.csv for data merging --- data_to_merge/{PharmacyState-2025.csv => Pharmacy_State25.csv} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename data_to_merge/{PharmacyState-2025.csv => Pharmacy_State25.csv} (100%) diff --git a/data_to_merge/PharmacyState-2025.csv b/data_to_merge/Pharmacy_State25.csv similarity index 100% rename from data_to_merge/PharmacyState-2025.csv rename to data_to_merge/Pharmacy_State25.csv From 9e5527bb5fa202a7da169408ce8b13d950648f5a Mon Sep 17 00:00:00 2001 From: adrita13 Date: Wed, 8 Apr 2026 13:54:48 -0500 Subject: [PATCH 08/20] Rename HospitalState-2025.csv to Hospital_State25.csv --- data_to_merge/{HospitalState-2025.csv => Hospital_State25.csv} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename data_to_merge/{HospitalState-2025.csv => Hospital_State25.csv} (100%) diff --git a/data_to_merge/HospitalState-2025.csv b/data_to_merge/Hospital_State25.csv similarity index 100% rename from data_to_merge/HospitalState-2025.csv rename to data_to_merge/Hospital_State25.csv From fbff802323d0948545e871dd0caa7816cc213295 Mon Sep 17 00:00:00 2001 From: adrita13 Date: Wed, 8 Apr 2026 14:07:10 -0500 Subject: [PATCH 09/20] Rename FqhcTractToState.R to Fqhc_tract2state.R --- scripts/{FqhcTractToState.R => Fqhc_tract2state.R} | 4 ++++ 1 file changed, 4 insertions(+) rename scripts/{FqhcTractToState.R => Fqhc_tract2state.R} (92%) diff --git a/scripts/FqhcTractToState.R b/scripts/Fqhc_tract2state.R similarity index 92% rename from scripts/FqhcTractToState.R rename to scripts/Fqhc_tract2state.R index 474bbb70..d005d51c 100644 --- a/scripts/FqhcTractToState.R +++ b/scripts/Fqhc_tract2state.R @@ -1,3 +1,7 @@ +# Author: Mahjabin Kabir Adrita +# Date: 2026-08-02 +# Data Source: Substance Abuse and Mental Health Services Administration (SAMHSA) + library(tidyverse) library(sf) library(tmap) From de0508d7035bf97075d4ffdb0f8010064def4802 Mon Sep 17 00:00:00 2001 From: adrita13 Date: Wed, 8 Apr 2026 14:08:00 -0500 Subject: [PATCH 10/20] Rename HcvTractToState.R to Hcv_tract2state.R --- scripts/{HcvTractToState.R => Hcv_tract2state.R} | 4 ++++ 1 file changed, 4 insertions(+) rename scripts/{HcvTractToState.R => Hcv_tract2state.R} (91%) diff --git a/scripts/HcvTractToState.R b/scripts/Hcv_tract2state.R similarity index 91% rename from scripts/HcvTractToState.R rename to scripts/Hcv_tract2state.R index 07f3467d..dde0f669 100644 --- a/scripts/HcvTractToState.R +++ b/scripts/Hcv_tract2state.R @@ -1,3 +1,7 @@ +# Author: Mahjabin Kabir Adrita +# Date: 2026-08-02 +# Data Source: Substance Abuse and Mental Health Services Administration (SAMHSA) + library(tidyverse) library(sf) library(tmap) From 7217055ec2c9fcd21af88f3630a8f75c462b775c Mon Sep 17 00:00:00 2001 From: adrita13 Date: Wed, 8 Apr 2026 14:08:51 -0500 Subject: [PATCH 11/20] Add author and date information to HCV script Updated the script to include author and date information, while maintaining the functionality of processing HCV Testing Facility travel time data for 2025. --- scripts/{HCVTestingTract2County.R => Hcv_tract2county.R} | 4 ++++ 1 file changed, 4 insertions(+) rename scripts/{HCVTestingTract2County.R => Hcv_tract2county.R} (91%) diff --git a/scripts/HCVTestingTract2County.R b/scripts/Hcv_tract2county.R similarity index 91% rename from scripts/HCVTestingTract2County.R rename to scripts/Hcv_tract2county.R index 4801353d..13e61683 100644 --- a/scripts/HCVTestingTract2County.R +++ b/scripts/Hcv_tract2county.R @@ -1,3 +1,7 @@ +# Author: Mahjabin Kabir Adrita +# Date: 2026-08-02 +# Data Source: Substance Abuse and Mental Health Services Administration (SAMHSA) + library(tidyverse) # Open tract-level HCV Testing Facility travel time data (2025) From a48d98f40a55e769a0a231f88d4de0294eb68d0e Mon Sep 17 00:00:00 2001 From: adrita13 Date: Wed, 8 Apr 2026 14:09:33 -0500 Subject: [PATCH 12/20] Rename and update HIV testing script for clarity --- scripts/{HIVTestingTract2County.R => Hiv_tract2county.R} | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) rename scripts/{HIVTestingTract2County.R => Hiv_tract2county.R} (91%) diff --git a/scripts/HIVTestingTract2County.R b/scripts/Hiv_tract2county.R similarity index 91% rename from scripts/HIVTestingTract2County.R rename to scripts/Hiv_tract2county.R index bbd56617..4c2ed84a 100644 --- a/scripts/HIVTestingTract2County.R +++ b/scripts/Hiv_tract2county.R @@ -1,3 +1,7 @@ +# Author: Mahjabin Kabir Adrita +# Date: 2026-08-02 +# Data Source: Substance Abuse and Mental Health Services Administration (SAMHSA) + library(tidyverse) # Open tract-level HIV Testing Facility travel time data (2025) @@ -94,4 +98,4 @@ write.csv( county.Hiv.save2, "C:/Users/adrit/Downloads/HIV Testing Facility-county-2025.csv", row.names = FALSE -) \ No newline at end of file +) From 5fc396812a4384683c98758bdef3a3e90dab86c1 Mon Sep 17 00:00:00 2001 From: adrita13 Date: Wed, 8 Apr 2026 14:10:13 -0500 Subject: [PATCH 13/20] Add author comments and maintain script functionality Added author and date comments, and ensured the script maintains functionality for processing HIV tract data and exporting results. --- scripts/{HivTractToState.R => Hiv_tract2state.R} | 4 ++++ 1 file changed, 4 insertions(+) rename scripts/{HivTractToState.R => Hiv_tract2state.R} (91%) diff --git a/scripts/HivTractToState.R b/scripts/Hiv_tract2state.R similarity index 91% rename from scripts/HivTractToState.R rename to scripts/Hiv_tract2state.R index 8f960a44..0fda7f45 100644 --- a/scripts/HivTractToState.R +++ b/scripts/Hiv_tract2state.R @@ -1,3 +1,7 @@ +# Author: Mahjabin Kabir Adrita +# Date: 2026-08-02 +# Data Source: Substance Abuse and Mental Health Services Administration (SAMHSA) + library(tidyverse) library(sf) library(tmap) From 1fd45d805958702f3ee9eb2e3a87b61b3eb89f79 Mon Sep 17 00:00:00 2001 From: adrita13 Date: Wed, 8 Apr 2026 14:10:58 -0500 Subject: [PATCH 14/20] Rename Hospital_tract2state.R file --- scripts/{HospTractToState.R => Hospital_tract2state.R} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename scripts/{HospTractToState.R => Hospital_tract2state.R} (100%) diff --git a/scripts/HospTractToState.R b/scripts/Hospital_tract2state.R similarity index 100% rename from scripts/HospTractToState.R rename to scripts/Hospital_tract2state.R From 03cc335640e4c68c1871d81c554babbc4b68afc7 Mon Sep 17 00:00:00 2001 From: adrita13 Date: Wed, 8 Apr 2026 14:12:02 -0500 Subject: [PATCH 15/20] Rename MhTractToState.R to Mentalhealth_tract2state.R --- scripts/{MhTractToState.R => Mentalhealth_tract2state.R} | 4 ++++ 1 file changed, 4 insertions(+) rename scripts/{MhTractToState.R => Mentalhealth_tract2state.R} (91%) diff --git a/scripts/MhTractToState.R b/scripts/Mentalhealth_tract2state.R similarity index 91% rename from scripts/MhTractToState.R rename to scripts/Mentalhealth_tract2state.R index 3724b980..fc23fd2c 100644 --- a/scripts/MhTractToState.R +++ b/scripts/Mentalhealth_tract2state.R @@ -1,3 +1,7 @@ +# Author: Mahjabin Kabir Adrita +# Date: 2026-08-02 +# Data Source: Substance Abuse and Mental Health Services Administration (SAMHSA) + library(tidyverse) library(sf) library(tmap) From ab63e78cdaf1fef1886d943ac507b7bab7b79c31 Mon Sep 17 00:00:00 2001 From: adrita13 Date: Wed, 8 Apr 2026 14:12:28 -0500 Subject: [PATCH 16/20] Add author, date, and data source comments Added author and date information, along with data source details. The rest of the code remains unchanged. --- scripts/Hospital_tract2state.R | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/Hospital_tract2state.R b/scripts/Hospital_tract2state.R index 300e6f23..8da6f53e 100644 --- a/scripts/Hospital_tract2state.R +++ b/scripts/Hospital_tract2state.R @@ -1,3 +1,7 @@ +# Author: Mahjabin Kabir Adrita +# Date: 2026-08-02 +# Data Source: Substance Abuse and Mental Health Services Administration (SAMHSA) + library(tidyverse) library(sf) library(tmap) From 8f1cfbe01dda6911dd0a2a5df555483be9c12215 Mon Sep 17 00:00:00 2001 From: adrita13 Date: Wed, 8 Apr 2026 14:13:13 -0500 Subject: [PATCH 17/20] Rename PharmacyTract2County.R to Pharmacy_tract2county.R --- scripts/{PharmacyTract2County.R => Pharmacy_tract2county.R} | 4 ++++ 1 file changed, 4 insertions(+) rename scripts/{PharmacyTract2County.R => Pharmacy_tract2county.R} (91%) diff --git a/scripts/PharmacyTract2County.R b/scripts/Pharmacy_tract2county.R similarity index 91% rename from scripts/PharmacyTract2County.R rename to scripts/Pharmacy_tract2county.R index 6a08c909..7a8d7f12 100644 --- a/scripts/PharmacyTract2County.R +++ b/scripts/Pharmacy_tract2county.R @@ -1,3 +1,7 @@ +# Author: Mahjabin Kabir Adrita +# Date: 2026-08-02 +# Data Source: Substance Abuse and Mental Health Services Administration (SAMHSA) + library(tidyverse) # Open tract-level Pharmacy travel time data (2025) From 5e846c6928c7f77a1c50a620d684f2ee4f7f72b4 Mon Sep 17 00:00:00 2001 From: adrita13 Date: Wed, 8 Apr 2026 14:13:44 -0500 Subject: [PATCH 18/20] Rename PharmacyTractToState.R to Pharmacy_tract2state.R --- scripts/{PharmacyTractToState.R => Pharmacy_tract2state.R} | 4 ++++ 1 file changed, 4 insertions(+) rename scripts/{PharmacyTractToState.R => Pharmacy_tract2state.R} (91%) diff --git a/scripts/PharmacyTractToState.R b/scripts/Pharmacy_tract2state.R similarity index 91% rename from scripts/PharmacyTractToState.R rename to scripts/Pharmacy_tract2state.R index 47eac616..fb535210 100644 --- a/scripts/PharmacyTractToState.R +++ b/scripts/Pharmacy_tract2state.R @@ -1,3 +1,7 @@ +# Author: Mahjabin Kabir Adrita +# Date: 2026-08-02 +# Data Source: Substance Abuse and Mental Health Services Administration (SAMHSA) + library(tidyverse) library(sf) library(tmap) From 2b36c923ff0a50a8c58a7c37d8528d9daff7b39e Mon Sep 17 00:00:00 2001 From: adrita13 Date: Wed, 8 Apr 2026 14:14:40 -0500 Subject: [PATCH 19/20] Rename script and update hospital data processing --- scripts/{hospitalTract2County.R => Hospital_tract2county.R} | 4 ++++ 1 file changed, 4 insertions(+) rename scripts/{hospitalTract2County.R => Hospital_tract2county.R} (92%) diff --git a/scripts/hospitalTract2County.R b/scripts/Hospital_tract2county.R similarity index 92% rename from scripts/hospitalTract2County.R rename to scripts/Hospital_tract2county.R index 5d5da31a..3f681219 100644 --- a/scripts/hospitalTract2County.R +++ b/scripts/Hospital_tract2county.R @@ -1,3 +1,7 @@ +# Author: Mahjabin Kabir Adrita +# Date: 2026-08-02 +# Data Source: Substance Abuse and Mental Health Services Administration (SAMHSA) + library(tidyverse) # Open tract-level Hospital travel time data (2025) From 64f481153833679e9456d9577af191a9266a5ec3 Mon Sep 17 00:00:00 2001 From: adrita13 Date: Wed, 8 Apr 2026 14:15:46 -0500 Subject: [PATCH 20/20] Rename fqhc-tract2county.R to Fqhc-tract2county.R --- scripts/{fqhc-tract2county.R => Fqhc-tract2county.R} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename scripts/{fqhc-tract2county.R => Fqhc-tract2county.R} (100%) diff --git a/scripts/fqhc-tract2county.R b/scripts/Fqhc-tract2county.R similarity index 100% rename from scripts/fqhc-tract2county.R rename to scripts/Fqhc-tract2county.R