Package index
-
narcannarcan-package - narcan: tools for US multiple cause of death (MCOD) data
-
import_mcod_fwf() - Import MCOD fixed-width data (restricted or public tier)
-
download_mcod_csv() - Download the multiple cause of death data as a CSV file
-
download_mcod_dta() - Download the multiple cause of death data as a DTA file
-
download_natality_ascii() - Download NCHS Natality (Live Births) Data from the CDC FTP (ASCII)
-
download_pop_data() - Download population data (processed asset or primary source)
-
mkdir_p() - Wrapper to make a directory (and subdirectories) if necessary
-
unite_records() - Unite the 20 record columns from MCOD dataframe into a single column
-
clean_icd9_data() - A wrapper function to perform basic cleaning of ICD-9 dataframes
-
zap_dta_data() - Clear Stata metadata from MCOD dta files
-
subset_residents() - Subset to US residents
-
prefix_to_record() - Add the prefix to appropriate ICD-9 record columns
-
prefix_e_to_ucod() - Add the external cause flag (E) to appropriate ICD-9 UCOD codes
-
pad_3char_codes() - Pad ICD-9 codes that do not have a sub-code (i.e., 3-character codes)
-
trim_5char_record() - Trim ICD-9 record columns that include the nature of injury flag
-
trim_trailing_whitespace() - Trim trailing whitespace on 3-char ICD-9 codes
-
rename_ni_flag() - Rename nature of injury columns for consistency
-
flag_all_deaths() - Run the canonical MCOD flagging pipeline
-
flag_drug_deaths() - Flag drug deaths according to ISW7 rules
-
flag_heroin_present() - Creates a new column called heroin_present if opioid death involved heroin
-
flag_maternal_deaths() - Creates a new column called maternal_death with 1 if maternal death
-
flag_maternal_deaths_late() - Creates a new column called maternal_death with 1 if maternal death (late)
-
flag_methadone_present() - Creates a column `methadone_present` if opioid death involved methadone
-
flag_nonheroin() - Flag all opioid deaths that were not from heroin
-
flag_nonopioid_drug_deaths() - Flag non-opioid drug deaths according to ISW7 rules
-
flag_od_intent() - Flag overdose deaths by their UCOD intent code
-
flag_opioid_contributed() - Flag non-opioid deaths that involved opioids
-
flag_opioid_deaths() - Flag opioid deaths according to ISW7 rules
-
flag_opioid_types() - Take a processed MCOD dataframe and create indicators for opioid types
-
flag_opium_present() - Creates a column called `opium_present` if opioid death involved opium
-
flag_other_natural_present() - Creates a column `other_natural_present` if opioid death involved opium
-
flag_other_op_present() - Creates a column `other_op_present` for deaths with other unspecified opioid
-
flag_other_synth_present() - Creates a column called `other_synth_present`
-
flag_suicide_deaths() - Flag suicide deaths (no accidental poisoning)
-
flag_suicide_fall() - Flag suicide by fall
-
flag_suicide_firearm() - Flag suicide by firearm
-
flag_suicide_other() - Flag suicide by other (not poison, fall, firearm, suffocation)
-
flag_suicide_poison() - Flag suicide by poison
-
flag_suicide_suffocation() - Flag suicide by suffocation
-
flag_suicide_types() - Flag suicide five types: firearm, poisoning, fall, suffocation, or other
-
label_od_intent() - Label intent from underlying cause column for overdose drugs
-
label_suicide_type() - Create a new column with labels for suicide type
Recode demographics & geography
Year-aware race, sex, Hispanic origin, age, occupation, and FIPS recodes.
-
remap_race() - Remaps the race column to a standardized code across data years
-
categorize_race() - Create a categorical race column from a standardized race column
-
categorize_sex() - Categorize the NCHS sex field across coding eras
-
categorize_female() - Flag female deaths across coding eras
-
categorize_hspanicr() - Create a categorical Hispanic origin/race column from the hspanicr column
-
add_hspanicr_column() - Add an NA hspanicr column if one doesn't exist
-
categorize_hispanic_origin() - Collapse hspanicr to the binary Hispanic-origin axis (for population joins)
-
add_hispanic_origin() - Add a binary Hispanic-origin column from hspanicr
-
remap_age() - Remap the raw NCHS detail-age field to age in completed years
-
categorize_age_5() - Create a categorical age column from a converted ager27 column
-
categorize_age_5u1() - Create a categorical age column from a converted ager27 column
-
convert_ager27() - Converts the age27 variable in MCOD data to 5-year age groups
-
convert_ager27u1() - Converts the age27 variable in MCOD data to under-1, 1-4, then 5-year groups
-
add_county_fips() - Make a new county_fips column that is consistent across years
-
state_abbrev_to_fips() - Replace state abbreviations with their corresponding FIPS code
-
add_coded_occupation() - Add harmonized coded occupation and industry columns
-
get_pop_state() - Retrieve state-level population denominators
-
get_pop_county() - Retrieve county-level population denominators
-
pop_sources() - Print the bundled population-data provenance manifest
-
add_pop_counts() - Join population denominators to a death frame
-
add_std_pop() - Given a dataframe with age, returns a standard population
-
calc_asrate_var() - Calculate age-specific rates and variance
-
calc_stdrate_var() - Calculate age-standardized rates and variance
-
summarize_binary_columns() - Summarizes all flagged (e.g., 0/1) MCOD columns
-
appalachia_fips - Dataframe of Appalachian counties with name and FIPS codes
-
cdc_dict - A dictionary of year:URL key:value pairs for the CDC FTP MCOD files
-
ihme_fips - Mapping original FIPS codes to temporally stable FIPS codes from IHME
-
live_births - Dataframe of live births in the US from 2003-2016 by race/ethnicity and age.
-
mcod_fwf_dicts - Fixed-width column dictionary for RESTRICTED-use MCOD files
-
mcod_public_fwf_dicts - Fixed-width column dictionary for PUBLIC-use MCOD files
-
pop_bridged - Bridged-race population estimates, national, 1969-2024
-
pop_est - Dataframe of annual population counts by age and race, 1979-2020
-
pop_singlerace - Single-race population estimates, national, 2020-2024
-
pop_singlerace_full - Single-race population estimates, national, 2000-2024 (backfill)
-
pop_singlerace_state - Single-race population estimates, state, 2020-2024
-
st_fips_map - Mapping of US state name to abbreviation to FIPS and NCHS code
-
std_pops - Dataframe of common standard populations from SEER website.