Expose fiscal-year timing: what months each survey year covers, per government #77

Open
opened 2026-10-26 16:24:28 -04:00 by jared · 3 comments
Owner

What

Every result labels a row with a survey year (srvy_year), but a survey year covers different months for different governments. The Census rule (FAQ, Q6) is that survey year Y includes each government's fiscal year that ended between July 1 of Y−1 and June 30 of Y. So "2017" means:

Fiscal year ends "2017" covers
June 30 Jul 2016 – Jun 2017
Sept 30 Oct 2015 – Sep 2016
Dec 31 Jan – Dec 2016

The label runs up to about 18 months ahead of the calendar for some governments. That matters whenever someone lines a series up against a dated event (a recession, a hurricane, a law taking effect) or compares two governments with different fiscal years.

The corpus already carries fiscal_year_end (MMDD as an integer, e.g. 630, 1231) in the long schema. The verbs don't return it and the docs don't explain it.

Work

  1. Check coverage first. How often is fiscal_year_end missing, zero or implausible, by survey year and government type? The 1967–2012 Individual Unit files have an FYEndDate column, but it may be blank in early years. The answer decides what the rest of this issue can promise.
  2. Return it from the verbs. Per row, not per government, because a government can change its fiscal year. Something like fiscal_year_end plus derived period_start / period_end dates. Names are open.
  3. A helper that maps a calendar date to a survey year for a given government, e.g. cog_survey_year(govid, date), and the reverse (survey year → covered months). The event timeline in nss_time depends on this to place events correctly.
  4. Expose it through cog-api in /governments/{govid} (the fiscal-year end history) and in /profile, /spending and /revenue rows. That's a separate issue on cog-api, filed once the R side settles.
  5. Docs: a section explaining the survey-year rule, with the table above and a worked example. Plus a note in any vignette that compares governments across years.

Open questions

  • Older Census publications (e.g. 1999–2000) list exceptions filed differently: Alabama and Michigan state governments, D.C., Texas and Nebraska school districts, Chicago schools. Do those exceptions still apply, and do any reach types 0–3?
  • State governments are covered by a separate survey with its own fiscal-year conventions. Confirm the same rule holds for type 0.

Why now

This blocks correct event placement in the nss_time event timeline (context overlays on Place Explorer charts). It's also useful on its own for anyone comparing governments across years.

## What Every result labels a row with a survey year (`srvy_year`), but a survey year covers different months for different governments. The Census rule ([FAQ, Q6](https://www.census.gov/programs-surveys/gov-finances/about/faq.html)) is that survey year *Y* includes each government's fiscal year that **ended** between July 1 of *Y−1* and June 30 of *Y*. So "2017" means: | Fiscal year ends | "2017" covers | |---|---| | June 30 | Jul 2016 – Jun 2017 | | Sept 30 | Oct 2015 – Sep 2016 | | Dec 31 | Jan – Dec 2016 | The label runs up to about 18 months ahead of the calendar for some governments. That matters whenever someone lines a series up against a dated event (a recession, a hurricane, a law taking effect) or compares two governments with different fiscal years. The corpus already carries `fiscal_year_end` (MMDD as an integer, e.g. `630`, `1231`) in the long schema. The verbs don't return it and the docs don't explain it. ## Work 1. **Check coverage first.** How often is `fiscal_year_end` missing, zero or implausible, by survey year and government type? The 1967–2012 Individual Unit files have an `FYEndDate` column, but it may be blank in early years. The answer decides what the rest of this issue can promise. 2. **Return it from the verbs.** Per row, not per government, because a government can change its fiscal year. Something like `fiscal_year_end` plus derived `period_start` / `period_end` dates. Names are open. 3. **A helper that maps a calendar date to a survey year for a given government**, e.g. `cog_survey_year(govid, date)`, and the reverse (survey year → covered months). The event timeline in `nss_time` depends on this to place events correctly. 4. **Expose it through cog-api** in `/governments/{govid}` (the fiscal-year end history) and in `/profile`, `/spending` and `/revenue` rows. That's a separate issue on cog-api, filed once the R side settles. 5. **Docs:** a section explaining the survey-year rule, with the table above and a worked example. Plus a note in any vignette that compares governments across years. ## Open questions - Older Census publications (e.g. [1999–2000](https://www.census.gov/content/dam/Census/library/publications/2003/econ/00allpub.pdf)) list exceptions filed differently: Alabama and Michigan state governments, D.C., Texas and Nebraska school districts, Chicago schools. Do those exceptions still apply, and do any reach types 0–3? - State governments are covered by a separate survey with its own fiscal-year conventions. Confirm the same rule holds for type 0. ## Why now This blocks correct event placement in the `nss_time` event timeline (context overlays on Place Explorer charts). It's also useful on its own for anyone comparing governments across years.
jared added the
ws
api
type
feature
labels 2026-10-26 16:24:28 -04:00
Author
Owner

R side landed in 04d7cf9 (GitHub pull request 4). Step 4, the cog-api work, is still open, which is why this issue stays open.

The PR could only measure fiscal_year_end for FY2011, FY2012, FY2019 and FY2020. This is the same measure for all 56 years, run against the default public corpus on 2026-11-04. "No usable value" counts missing and zero together, because both produce NA periods.

Survey year Government-years Missing Zero No usable value
1993 5,801 5,751 0 99.1%
1987 38,913 4,269 2 11.0%
1978 7,285 0 434 6.0%
1989 15,363 888 1 5.8%
1990 14,065 759 0 5.4%
1988 18,271 897 0 4.9%
Every other year under 3%
  • No government-year has conflicting values in any year.
  • 2,049 government-years have a zero, all between 1967 and 1991.
  • Implausible month-day values were not measured outside the PR's four years.
  • Whether the FY1993 gap comes from the Census source or from the pipeline is unknown.

cog_fiscal_periods() and cog_survey_year() return NA for these rows rather than borrowing another year's value. The survey-year rule itself is still checked only against survey year 2020.

The new code also ran correctly on the public corpus: all three verbs with fiscal_period = TRUE, and both helpers. The cost was 4.5s against 2.9s for one government over eight years, one run each.

R side landed in `04d7cf9` (GitHub pull request 4). Step 4, the cog-api work, is still open, which is why this issue stays open. The PR could only measure `fiscal_year_end` for FY2011, FY2012, FY2019 and FY2020. This is the same measure for all 56 years, run against the default public corpus on 2026-11-04. "No usable value" counts missing and zero together, because both produce `NA` periods. | Survey year | Government-years | Missing | Zero | No usable value | |---|---:|---:|---:|---:| | 1993 | 5,801 | 5,751 | 0 | 99.1% | | 1987 | 38,913 | 4,269 | 2 | 11.0% | | 1978 | 7,285 | 0 | 434 | 6.0% | | 1989 | 15,363 | 888 | 1 | 5.8% | | 1990 | 14,065 | 759 | 0 | 5.4% | | 1988 | 18,271 | 897 | 0 | 4.9% | | Every other year | | | | under 3% | - No government-year has conflicting values in any year. - 2,049 government-years have a zero, all between 1967 and 1991. - Implausible month-day values were not measured outside the PR's four years. - Whether the FY1993 gap comes from the Census source or from the pipeline is unknown. `cog_fiscal_periods()` and `cog_survey_year()` return `NA` for these rows rather than borrowing another year's value. The survey-year rule itself is still checked only against survey year 2020. The new code also ran correctly on the public corpus: all three verbs with `fiscal_period = TRUE`, and both helpers. The cost was 4.5s against 2.9s for one government over eight years, one run each.
Author
Owner

Follow-up to the table above: the FY1993 gap starts in the Census source, not the pipeline. FYEndDate in IndFin93a.Txt is BBBB for 12,892 of 12,943 rows. Being chased on the pipeline repo as census_of_governments_finance_pipeline#129.

Follow-up to the table above: the FY1993 gap starts in the Census source, not the pipeline. `FYEndDate` in `IndFin93a.Txt` is `BBBB` for 12,892 of 12,943 rows. Being chased on the pipeline repo as census_of_governments_finance_pipeline#129.
Author
Owner

The state-government rule now has a second test: the 2009 stimulus, in GitHub pull request 5 (https://github.com/civilytics/uscogdata/pull/5), landed. The full tables and the list of confounders are in that PR. Short version:

  • Alabama, Michigan and Texas state governments fit the documented rule again: federal aid jumps in survey year 2009 and slows in 2011, as the June-30 states do.
  • 15 large September-30 local governments fit the plain rule again, jumping in 2011 (median +17.7%).
  • D.C. is inconclusive again, so its treatment still rests on Census documentation alone.

One item that PR listed as unverified is partly checked: fiscal_year_end for all 50 state governments, D.C., Broward and Palm Beach is stable across FY2006 to FY2011 on the public corpus. The other 13 local governments were not checked for those years.

The state-government rule now has a second test: the 2009 stimulus, in GitHub pull request 5 (https://github.com/civilytics/uscogdata/pull/5), landed. The full tables and the list of confounders are in that PR. Short version: - Alabama, Michigan and Texas state governments fit the documented rule again: federal aid jumps in survey year 2009 and slows in 2011, as the June-30 states do. - 15 large September-30 local governments fit the plain rule again, jumping in 2011 (median +17.7%). - D.C. is inconclusive again, so its treatment still rests on Census documentation alone. One item that PR listed as unverified is partly checked: `fiscal_year_end` for all 50 state governments, D.C., Broward and Palm Beach is stable across FY2006 to FY2011 on the public corpus. The other 13 local governments were not checked for those years.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Civilytics/uscogdata#77