Add cps_check_codes() warning and document 2022+ No Response discontinuity - #70
Open
Franky58-art wants to merge 3 commits into
Open
Add cps_check_codes() warning and document 2022+ No Response discontinuity#70Franky58-art wants to merge 3 commits into
Franky58-art wants to merge 3 commits into
Conversation
Documents two validation comparisons (CPS standard weight vs. McDonald VEP, and cpsvote vs. Census Table 4a) plus the 2022+ No Response discontinuity from issue #69. Published as a pkgdown article rather than a vignette since it downloads external data and is meant as a standing reference, not CRAN-checked documentation. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Thanks for reporting this, Dr. Hanmer — confirmed, and it turns out to predate 2024.
The -9 ("No Response") code is entirely absent from PES1/VRS_VOTE in both the 2022 and 2024 data, not just 2024. Reading the full raw files and tabulating every code present in PES1:
The adult share of -1 roughly doubles right when -9 disappears. This suggests the Census Bureau folded "No Response" adults into the generic "Not in Universe" bucket starting in 2022, without documenting the change.
Age composition of the -1 group:
Why this matters for cpsvote: cps_label() treats -1 as missing (NA) before cps_recode_vote() ever runs. Through 2020, a -9 respondent was counted as "No" for cps_turnout and correctly dropped to NA for hurachen_turnout. Since 2022, that same person (now coded -1) is wiped to NA at the labelling step and never reaches the recode logic. cps_turnout's denominator silently shrinks, inflating the naive estimate.
Numbers for 2024:
Changes made in this PR:
cps_check_codes(), which warns when a documented code is completely absent from the data.cps_recode_vote()now calls this automatically.vignette("voting").Not yet addressed: using respondent age to split the -1 bucket back into "Not in Universe" vs. "No Response" for 2022+. That would be a substantive methodological change held for discussion. Input welcome.