Skip to content

Traffic#143

Open
anshap32 wants to merge 11 commits into
mainfrom
traffic
Open

Traffic#143
anshap32 wants to merge 11 commits into
mainfrom
traffic

Conversation

@anshap32

Copy link
Copy Markdown
Collaborator

checked against wisqars (largely in alignment), can delete those files if we don't want in main repo

DanWeinberger and others added 9 commits March 13, 2026 17:10
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
checked against wisqars traffic data (see plots, can remove if we don't want in ingest)
# Conflicts:
#	.claude/settings.json
#	.gitignore
#	data/bundle_injury_overdose/dist/county_opioid_by_source.parquet
#	data/bundle_injury_overdose/dist/deaths_cause_age.parquet
#	data/bundle_injury_overdose/dist/deaths_cause_age_demographics.parquet
#	data/bundle_injury_overdose/dist/firearms_by_demographics.parquet
#	data/bundle_injury_overdose/dist/firearms_by_geography_and_source_state_year.parquet
#	data/bundle_injury_overdose/dist/firearms_geography_source.parquet
#	data/bundle_injury_overdose/dist/google_dma.parquet
#	data/bundle_injury_overdose/dist/heat_by_geography_and_source_state_year.parquet
#	data/bundle_injury_overdose/dist/heat_risk.parquet
#	data/bundle_injury_overdose/dist/overdose_by_demographics.parquet
#	data/bundle_injury_overdose/dist/overdose_by_geography_and_source.parquet
#	data/bundle_injury_overdose/dist/overdose_by_geography_and_source_county.parquet
#	data/bundle_injury_overdose/dist/overdose_by_geography_and_source_state_year.parquet
#	data/bundle_injury_overdose/dist/overdose_deaths_state.parquet
#	data/bundle_measles/dist/measles_state.parquet
#	data/nnds/standard/data.csv.gz
#	data/noaa_heat_risk/process.json
#	data/noaa_heat_risk/standard/data_county.csv.gz
#	data/noaa_heat_risk/standard/data_state.csv.gz
#	data/noaa_heat_risk/standard/datapackage.json
#	renv.lock
@anshap32 anshap32 requested a review from DanWeinberger June 23, 2026 14:00
@anshap32

Copy link
Copy Markdown
Collaborator Author

Forgot to add, only additional data that seems like we would maybe want is weather conditions for each accident and race of the person killed if the crash was fatal, but these data are only available post 2020. Let me know if you want me to incorporate.


measles_state_nnds <- vroom::vroom('../nnds/standard/data.csv.gz', show_col_types = FALSE) %>%
mutate(value = measles_imported + measles_indigenous ) %>%
mutate(value = measles_imported + measles_indigenous,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this file should not be included in the pull request

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked into this. It is fine, this is because it's part of the branch history but will not change anything in the PR. It is also the same as the version in main.

Comment thread .github/workflows/update_noaa_heat_risk.yaml Outdated
Comment thread data/bundle_injury_overdose/dist/overdose_deaths_county.parquet
Comment thread data/bundle_injury_overdose/dist/state_opioid_by_source.parquet
Comment thread data/nhtsa_crash/standard/datapackage.json
Comment thread data/nhtsa_crash/ingest.R Outdated
Comment thread data/nhtsa_crash/ingest.R Outdated
if ("LAND_USE" %in% names(.)) as.integer(LAND_USE) else NA_integer_
),
# Alcohol involvement: DRUNK_DR = number of drunk drivers
alcohol_related = !is.na(DRUNK_DR) & as.integer(DRUNK_DR) >= 1,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should check on meaning of NA for DRUNK_DR. with this logic if DRUNK_DR is NA, then alcohol_related=0, which might be OK, depending on why it is NA

@anshap32 anshap32 Jun 23, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

per documentation, DRUNK_DR is actually not reliable prior to 2008 and isn't calculated after 2015... I am excluding for now but they provide logic to calculate if we want to include it.

Comment thread data/nhtsa_crash/ingest.R Outdated
alcohol_related = !is.na(DRUNK_DR) & as.integer(DRUNK_DR) >= 1,
# Speeding: SPEEDREL only available from 2010 onward
speeding_related = if ("SPEEDREL" %in% names(.)) {
YEAR >= 2010 & !is.na(SPEEDREL) & as.integer(SPEEDREL) %in% 1:4

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this one seems to handle NA differently?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also excluding speeding_related for now as what I see in data dictionary doesn't match up with what I see in data

anshap32 and others added 2 commits June 23, 2026 11:40
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@anshap32 anshap32 requested a review from DanWeinberger June 23, 2026 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants