Compare county social vulnerability and transportation access in Python

Compare national SVI rankings with households without a vehicle using genuine county samples and copyable Python.

Compare county vulnerability and transportation access

A county needs assessment can use SVI to describe relative social vulnerability, then examine particular conditions behind that ranking. This example compares Wake, Durham and Robeson counties in North Carolina and adds the percentage of households without a vehicle. That helps a researcher distinguish a county’s national rank from a concrete transportation indicator.

The optional input.csv contains those three real county FIPS codes. The same selections appear in the counties list in the Python code below. No counties or observed values have been invented.

Download both files into your working folder. These are samples of the paid product: county_summary.csv contains the three complete county summaries, and county_indicators.csv contains all 16 indicators for each county. Their fields and values match the full download, which covers 3,144 counties and equivalents.

The code joins the summary and the NOVEH indicator on county_fips. Selecting one indicator makes the join one-to-one for each selected county.

Code example

Run this in a notebook cell, IPython or a Python script. It uses only the standard library. Keep FIPS codes as strings so leading zeros survive.

Paths are relative to your working folder; use from pathlib import Path; print(Path.cwd()) to check it, or supply full paths.

Python 3.10+ · Jupyter, IPython or a script
import csv
from pathlib import Path

data_dir = Path('.')
counties = [{'county_fips': '37183'}, {'county_fips': '37063'}, {'county_fips': '37155'}]

with (data_dir / 'county_summary.csv').open(encoding='utf-8', newline='') as f:
    summaries = {row['county_fips']: row for row in csv.DictReader(f)}
with (data_dir / 'county_indicators.csv').open(encoding='utf-8', newline='') as f:
    transport = {row['county_fips']: row for row in csv.DictReader(f) if row['indicator_id'] == 'NOVEH'}

results = []
for county in counties:
    code = county['county_fips']
    summary = summaries.get(code)
    measure = transport.get(code)
    result = {'county_fips': code, 'county': code, 'svi_percentile': '',
              'no_vehicle_pct': '', 'no_vehicle_moe90': '', 'status': 'outside_reference'}
    if summary is not None and measure is not None:
        result.update(county=summary['county_name'] + ', ' + summary['state_abbr'],
                      svi_percentile=summary['overall_percentile'], no_vehicle_pct=measure['percent'],
                      no_vehicle_moe90=measure['percent_moe90'],
                      status='reported' if all(x == 'reported' for x in
                          (summary['overall_percentile_status'], measure['percent_status'], measure['percent_moe90_status']))
                          else 'check_source_status')
    results.append(result)
    if result['status'] == 'reported':
        print(f"{result['county']:25} | U.S. SVI {result['svi_percentile']} | no vehicle {result['no_vehicle_pct']}% ± {result['no_vehicle_moe90']} pp (90% MOE)")
    else:
        print(f"{result['county']:25} | {result['status']}")

Replace counties with your own records containing county_fips. To load a CSV, use csv.DictReader. Change NOVEH to another indicator only after checking its definition and population in the full product’s indicator_definitions.csv.

Analysis of the output

Wake County, NC           | U.S. SVI 0.3621 | no vehicle 4.0% ± 0.2 pp (90% MOE)
Durham County, NC         | U.S. SVI 0.686 | no vehicle 7.0% ± 0.6 pp (90% MOE)
Robeson County, NC        | U.S. SVI 0.9962 | no vehicle 8.0% ± 0.8 pp (90% MOE)

Robeson’s SVI value of 0.9962 is approximately the 99.62nd percentile among U.S. counties in this edition. Higher values indicate greater relative social vulnerability. It does not mean 99.62% of residents are vulnerable or express a probability of a disaster.

The vehicle measure is a population percentage: 8.0% of Robeson’s households have no vehicle available, compared with 4.0% in Wake. Its published 90% margin of error is ±0.8 percentage points; Wake’s is ±0.2. These estimates provide context for a transportation-access discussion, but they do not measure every household’s travel needs or establish what caused the difference.

SVI combines indicators across four themes. A similar overall rank can reflect different underlying conditions, so inspect the indicators relevant to your question. Do not average the theme ranks to replace the published overall rank. The margins of error apply to the ACS estimates, not to the SVI percentile rankings.

The code keeps an unmatched input as outside_reference and prints check_source_status when a needed value is not reported. In the full product, DC’s group-quarters count MOE contains a Census special code; its dependent percentage MOE is withheld for review too. The original values and reasons are preserved in quality_flags.csv. Neither is silently changed to zero.

Using the full dataset

Extract the purchased ZIP and set data_dir to that folder. This code runs unchanged with the full summary and indicator files. The summary has 3,144 county rows, each with overall and four theme ranks; the indicator table has 50,304 rows. Keep an indicator filter when you want one result per county.

Six CSV tables include definitions, explicit source-column scope, complete row accounting and quality flags. Field dictionaries, metadata, validation results, a working example and source identities accompany the data. The county scope covers the 50 states and DC, retains Connecticut planning regions and excludes Puerto Rico from the national comparison.

Use the reference for descriptive social context. Compare periods and boundaries before joining county health indicators, housing affordability or income and poverty. Definitions differ: SVI’s uninsured indicator covers all ages, while SAHIE focuses on people under 65. The county healthcare selection guide explains the complementary sources.

Sources and versions

This is the CDC/ATSDR SVI 2022 nationwide county edition, based on ACS 2018–2022 five-year estimates. The initial release was May 21, 2024. ACD captured and prepared these inputs on October 23, 2026 UTC. These are not 2026 observations or a historical trend series.

CDC announced a December 11, 2024 correction to the crowding percentage MOE denominator. Our validation confirms that the current county values use the corrected occupied-housing denominator. The source and preparation record explains that check and the DC uncertainty handling. Read the publisher’s documentation and correction notice and interpretation guidance.

Example checked October 23, 2026 against both these samples and the complete purchased files. Source and processing records, sample checksums · Expected result CSV. Independent preparation; no agency endorsement.