Compare regional vacancy and homeownership in Python

Compare genuine Census HVS regional rates with their published margins of error.

Compare regional housing conditions with their uncertainty

A housing analyst wants to compare rental availability and homeownership across the four Census regions. A vacancy rate alone leaves out tenure: the share of occupied homes owned by their occupants provides another view of the same region. Published margins of error help show how precisely each rate is estimated.

Download observations.csv below. It is a genuine subset of the purchased table: rental vacancy and homeownership in the four regions for Q4 2025, with all 27 fields unchanged. The region, measure and period selections appear in the Python code below. There are no invented observations.

Q4 2025 covers November and December only. October data were not collected. Treat the figures as the publisher’s shortened-quarter estimates, not a usual three-month quarter.

The full $29 edition contains 11,264 quarterly records, 1,820 annual housing-inventory records and seven supporting CSV tables. It covers the United States and four Census regions through 2025, with actual series starting dates. Inspect the complete download.

Code example

This code runs in a notebook cell, IPython or a script using Python’s standard library. It checks the requested records and their units, then adds and subtracts the published 90% margin of error. Percent estimates and percentage-point margins remain distinct.

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
"""Compare regional Q4 2025 rates and their published 90% margins of error."""
import csv
from decimal import Decimal

period = "2025-Q4"
regions = {"NE": "Northeast", "MW": "Midwest", "SO": "South", "WE": "West"}
measures = {"rental_vacancy_rate": "Rental vacancy", "homeownership_rate": "Homeownership"}
selected = {}
with open("observations.csv", newline="", encoding="utf-8") as file:
    for row in csv.DictReader(file):
        key = (row["area_code"], row["measure"])
        if row["period"] != period or key[0] not in regions or key[1] not in measures:
            continue
        if key in selected:
            raise ValueError(f"Duplicate observation: {key}")
        if (row["frequency"], row["unit"], row["adjustment"]) != ("quarterly", "percent", "NSA"):
            raise ValueError(f"Incompatible observation: {key}")
        if row["availability"] != "reported" or row["moe_status"] != "reported":
            raise ValueError(f"Missing estimate or exact margin of error: {key}")
        selected[key] = row

results = []
print("Q4 2025: November and December only; October was not collected.")
print(f"{'Region':<11} {'Measure':<16} {'Estimate':>9} {'90% margin':>11} {'90% interval':>15}")
for region, name in regions.items():
    for measure, title in measures.items():
        if (region, measure) not in selected:
            raise ValueError(f"Missing observation: {region}, {measure}")
        row = selected[region, measure]
        value, margin = Decimal(row["value"]), Decimal(row["moe90"])
        low, high = value - margin, value + margin
        results.append(dict(area_code=region, measure=measure, period=period,
                            estimate=str(value), moe90=str(margin), lower90=str(low), upper90=str(high)))
        print(f"{name:<11} {title:<16} {value:>8.1f}% {margin:>9.1f}pp {low:>6.1f}–{high:.1f}%")
print("Intervals describe individual estimates; they do not test differences between regions.")

Analysis of the output

Q4 2025: November and December only; October was not collected.
Region      Measure           Estimate  90% margin    90% interval
Northeast   Rental vacancy        5.2%       0.6pp    4.6–5.8%
Northeast   Homeownership        63.1%       0.8pp   62.3–63.9%
Midwest     Rental vacancy        7.2%       0.8pp    6.4–8.0%
Midwest     Homeownership        71.3%       0.7pp   70.6–72.0%
South       Rental vacancy        9.1%       0.5pp    8.6–9.6%
South       Homeownership        66.5%       0.6pp   65.9–67.1%
West        Rental vacancy        5.5%       0.5pp    5.0–6.0%
West        Homeownership        60.8%       0.7pp   60.1–61.5%
Intervals describe individual estimates; they do not test differences between regions.

The South’s rental vacancy estimate is 9.1%, compared with 5.2% in the Northeast. The Midwest has the highest homeownership point estimate in this selection, at 71.3%; the West’s is 60.8%. These are separate measures with different denominators. A region’s rental vacancy is not the percentage of all homes that are empty, and homeownership is not the percentage of residents who personally own a home.

The South’s rental vacancy margin is 0.5 percentage points, giving an approximate 90% interval of 8.6–9.6%. The Northeast’s interval is 4.6–5.8%. These intervals describe individual survey estimates. Their overlap or separation is not a formal significance test for a difference between regions. The data also do not explain why a region has its particular rates.

Using the full dataset

Extract the purchased ZIP and replace the sample with the full observations.csv; the code runs unchanged. Select another period or measure using series.csv. Rental and homeowner vacancy begin in 1956; homeownership begins in 1964. National margins of error begin in 1995 and regional margins in 2010. Earlier records can have a valid estimate without a supplied margin; the example deliberately stops in that case.

Housing inventory is measured in thousands of units. The separate annual.csv contains published annual averages, not year-end stocks or summed quarterly flows. Annual 2000 uses Q2 and Q3 only; annual 2025 uses eleven months. No annual vacancy or homeownership rates are manufactured from the quarterly rates.

The download preserves source notes, coordinates, availability, revised control headings and earlier rate alternatives. Changes in survey controls and collection can affect comparisons over time, including pandemic collection changes and the 2025 sample redesign. Some inventory aggregates differ slightly from reconstructed components; the comparison file documents these differences without replacing the source values.

The construction and housing markets collection adds starts, completions and new-home sales. Those measures concern construction and homes built for sale, while CPS/HVS describes the broader housing stock. County ACS housing estimates have different periods and survey methods; these files do not make the surveys interchangeable or allocate regional figures to counties.

Sources and versions

Source: Census Current Population Survey/Housing Vacancy Survey historical tables, captured November 10, 2026 UTC. This edition ends at observation year 2025. The retained sources include later observations that are excluded from the delivered tables. Inventory uses the separately revised historical tables, with control-vintage labels retained; this is not a collection of original quarterly publication vintages.

Read the CPS/HVS definitions and survey methodology before interpreting vacancy denominators or long-term changes. Census supplies the original tables free. ACD sells preparation, checking, documentation and delivery.

Processing improvements and verified publisher error corrections to this purchased edition are included. Future source editions may be separate purchases. Read the source and preparation record.

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