A state's total in CDC AtlasPlus is usually larger than the sum of its
counties. no_county_cases() compares each state total with the county
counts supplied. Run it after impute_suppressed() for the remainder that
no county accounts for; on county data straight from get_atlas() it
reports only the gap left by published counts.
For CDC's HIV estimates (get_atlas("estimate")), county data cover only
the Ending the HIV Epidemic (EHE) counties, so the remainder can include
people in counties outside EHE coverage and isn't necessarily cases with no county; a
message says so.
The remainder is a difference, not a count of identified cases. One likely
explanation is cases whose county of residence is unknown or not released,
but CDC's documentation doesn't say so; it also includes any counties left
out of x. In 2022 the gap was far larger than suppressed counties could
hold at 1-4 cases each, so it can't be used to fill them in.
extrapolate_from_county() leaves the remainder out by default;
no_county = "spread" shares it across the state's counties instead. See
the "About CDC AtlasPlus data" article.
Arguments
- x
County data from
get_atlas(geography = "county"), usually afterimpute_suppressed().
Value
A tibble with one row per state, indicator, year and stratum:
- state_fips, state
State FIPS code and name.
- indicator, year, race_ethnicity, sex, age
As in
x.- state_cases
The state total published by CDC.
- published_cases
Sum of the published county counts in
x.NAif the remainder is withheld (seeno_county_withheld).- unpublished_cases
state_cases - published_cases: cases in suppressed counties together with the remainder no county accounts for.NAif withheld.- imputed_cases
Sum of the counts
impute_suppressed()filled in;NAifxhasn't been imputed.- no_county_cases
unpublished_cases - imputed_cases. Can be negative if the imputed counts are too high, and isNAifxhasn't been imputed.- no_county_withheld
Why
published_cases,unpublished_casesandno_county_casesare not reported:"one county row without a published count","no CDC county rows to count unpublished counties", orNAotherwise. (Where CDC suppressed the state total, those columns areNAfor that reason instead.) See the section below.
Every column computed from state_cases is NA if CDC suppressed the
state total.
Details
Downloads the state data matching x (same diseases, years and
stratification) from CDC AtlasPlus, and CDC's county table for x when it
isn't in the cache. The remainder also includes any county
without a count in x: "Data not available" rows, counties removed by
filtering x, and suppressed rows impute_suppressed() couldn't estimate
(marked cases_source = "not estimated"), which count as 0 imputed cases.
The report has a row only for state groups (state, indicator, year and
stratum) with at least one row in x: if
impute_suppressed(not_available = "drop") or filtering removed every row
of a group, its state total is not reported.
State strata with one county row without a published count
Where a state stratum has exactly one county row without a published count
(suppressed, "Data not available", or with no count for another reason),
the state total minus the published counts is that county's count plus
any cases with no county. CDC's documentation doesn't say that state
totals include cases with no county, so the figure could be that county's
count exactly, and no_county_cases() doesn't report it.
A county counts only if neither x nor CDC's county table for x gives
its count. The remainder isn't reported if one county counts, either over
both tables or over the counties CDC's table lists. So a county filtered
out of x, or dropped by impute_suppressed(not_available = "drop"),
still counts; a county with a count in one table but not the other
doesn't; and a county in only one of the tables can't make one county
without a count look like none or two.
CDC's table comes from the cache when x was downloaded in this session;
otherwise it is downloaded. If CDC's table has no rows for a stratum, how
many counties lack a count can't be known, so that stratum's remainder
isn't reported either.
For such a stratum published_cases, unpublished_cases and
no_county_cases are NA and no_county_withheld says why, and a
message says how many strata this applies to. state_cases (CDC's
published total) and imputed_cases (the modeled estimate) are still
given.
States with many cases in no county row
no_county_cases() warns, once per call, when a state has more than 25% of
its published state total in no county row of x: the remainder divided
by the state total, with both added up over the state's strata that are in
x and have a published state total, separately for each indicator and
year. The percentage is of the state totals CDC published for the strata
in x. It is not a share of every case in the state when x lacks a
stratum (data filtered to one sex, say) or CDC published no total for one.
The warning (class "cdcatlas_state_unplaced_cases") names the states
with their percentages, the five largest for each indicator and year.
County counts for such a state, added up or shared across smaller areas,
leave those cases out and are too low by about that share for those
strata. This happens when a state's county counts are largely suppressed,
or when x lacks some of the state's counties; the package does not check
the cause. Nothing in the report changes.
A state is assessed only where CDC published its total and x has been
through impute_suppressed(). Strata with no published state total, and
strata with no row in x, are left out of its share, and so are states
with no cases. CDC's HIV
estimates are not assessed, because their county data cover only EHE
counties. A stratum where the imputed counts exceed the state total
offsets one where they fall short. The 25% is fixed.
See also
impute_suppressed(), extrapolate_from_county(); the article
"About CDC AtlasPlus data"
on why state totals and county counts differ.
Examples
if (FALSE) { # \dontrun{
county <- get_atlas("hiv", "county", 2022)
county <- impute_suppressed(county)
no_county_cases(county)
} # }
