The "Reading coverage" sections of cog_peer_compare() and
cog_geographic_rollup() recommended comparing a census year with a sample
year. The published corpus shows those years collect different governments,
so they now give the vignette's advice: compare census years with each other,
or the same governments across years.
The FY2022 Georgia example called the year complete and the 174-city gap
"overwhelmingly" sheriff contracting, "not non-response". The counters show
32 cities not collected and 142 collected with no Police rows, and nothing
measures how many of the 142 contract. The reference pages and the vignette
now say that.
cog_find_peers() and cog_gov_search() pointed at vignette('coverage-scope'),
which does not exist. Both now state the scope, with tests.
Closes #78
Closes #79
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
8 files changed
+60
-34
No files matched your search
@@ -64,7 +64,7 @@ cog_find_peers <- function(target_govid,
|
||||
if (nrow(meta) == 0L) {
|
||||
cli::cli_abort(c(
|
||||
"govid {target_govid} not found in corpus.",
|
||||
i = "v0.1 covers types 0-3 only (state/county/city/township); see vignette('coverage-scope')."
|
||||
i = "uscogdata covers types 0-3 only (state/county/city/township)."
|
||||
))
|
||||
}
|
||||
|
||||
@@ -260,14 +260,17 @@ cog_find_peers <- function(target_govid,
|
||||
#' collection rate, and `n_units_reporting / n_units_collected` for category
|
||||
#' participation among collected units.
|
||||
#'
|
||||
#' In FY2022 — a complete census year — Georgia reports 393 of 567 cities for
|
||||
#' `category = "Police"`; the 174-city gap is overwhelmingly cities that
|
||||
#' contract policing to the county sheriff, not non-response.
|
||||
#' In FY2022, a census year, 393 of Georgia's 567 cities report
|
||||
#' `category = "Police"`. Of the other 174, 32 were not collected and 142 were
|
||||
#' collected with no Police rows. Contracting policing to the county sheriff is
|
||||
#' one reason a city lands in the second group; the counters do not say how many
|
||||
#' of the 142 do.
|
||||
#'
|
||||
#' The comparison that *is* valid is the same category across a census year
|
||||
#' (ending in 2 or 7) and a sample year, where the real-zero component is
|
||||
#' roughly constant and the difference reflects the survey cycle. `is_census_year`
|
||||
#' marks which is which.
|
||||
#' A census year and a sample year collect different sets of governments, so
|
||||
#' participation across the two mixes a change in which governments were
|
||||
#' collected with any change in spending. Compare census years with each other,
|
||||
#' or the same governments across years. `is_census_year` marks which is which,
|
||||
#' and `vignette("coverage-counters")` has worked examples.
|
||||
#' @export
|
||||
cog_peer_compare <- function(target_govid, peers, category, years,
|
||||
per_capita = TRUE, adjust_to_year = NULL,
|
||||
|
||||
Reference in new issue
Block a user