Repository navigation
Add household and housing tenure weights for NHGIS crosswalks - #23
Open
wcurrangroome wants to merge 1 commit into
Open
wcurrangroome wants to merge 1 commit into
wcurrangroome wants to merge 1 commit into
Conversation
get_crosswalk() now accepts weight = "household", "housing_owned" and "housing_rented" for NHGIS block group and tract crosswalks. These select the NHGIS wt_hh, wt_ownhu and wt_renthu weights. - Every step of a crosswalk plan is checked before any download. A GeoCorr step asked for one of the new weights raises an error that names the step and lists the weights GeoCorr offers. - An NHGIS file that lacks a requested household or tenure weight raises an error; another weight is never substituted. - CT Data and county-events steps, which have no choice of weight, accept any valid weight and print a message when population-based factors are used instead. - crosswalk_metadata$weighting_variable records the weight actually used. - Documentation lists the weights each source offers. - Tests for the CT Data 2020-2022 path now skip when IPUMS_API_KEY is not set, since that path downloads an NHGIS file. Closes #20 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This was referenced Oct 28, 2026
This branch has not been deployed
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.
Closes #20.
What this changes
get_crosswalk()andcrosswalk_data()acceptweight = "household","housing_owned"and"housing_rented". For NHGIS block group and tract crosswalks, these select the NHGISwt_hh,wt_ownhuandwt_renthuweights.crosswalk_metadata$weighting_variablerecords the weight actually used, using NHGIS's own label. For example,weight = "housing"on a tract file now records"housing_all"; the value the user passed is still incall_parameters$weight.IPUMS_API_KEYis not set, because that path downloads an NHGIS file.Decisions
"adult"or"family"weights for now.get_available_crosswalks()gets no new column; the available weights are only documented.Testing
test-crosswalk-weights.R: 16 tests, 0 failed, 4 skipped. The skipped ones needIPUMS_API_KEYor slow tests turned on.test-get_crosswalk.R: 0 failed.test-crosswalk_data.R: 0 failed.wt_hh,wt_ownhuandwt_renthu. No API key was available. Those tests run whenIPUMS_API_KEYis set.Stacked pull requests: #22's PR is based on this branch, and #21's PR is based on #22's.
🤖 Generated with Claude Code