Fixed-width column dictionary for PUBLIC-use MCOD files
Source:R/data-mcod_public_fwf_dicts.R
mcod_public_fwf_dicts.RdByte positions for parsing the NCHS/CDC Multiple Cause of Death public-use fixed-width files (`mortYYYYus.zip`), one set of rows per data year (1979-2024). The public file shares the within-record layout of the restricted file but suppresses certain columns; suppressed columns are carried here with `NA` positions and `suppressed = TRUE` so `import_mcod_fwf(..., tier = "public")` returns them as all-`NA`, keeping the public output column-compatible with the restricted output.
Format
A data frame with 6 columns
- name
string, variable name (matches [mcod_fwf_dicts])
- type
string, single-letter readr column type ("c"/"n")
- start
integer, 1-indexed starting byte position (`NA` if suppressed)
- end
integer, ending byte position (`NA` if suppressed)
- year
integer, data year
- suppressed
logical; `TRUE` for columns not present on the public file (sub-state geography and record type from 2005; certifier, tobacco and pregnancy from 2003; race-recode-40 before it reaches the public file in 2013) – returned as all-`NA` for column parity
Details
Verified against the raw CDC public-use bytes (identical layout to the NBER mirror). Effective record length by year: 440 (1979-2002; 1980 is variable-length and read newline-delimited), 488 (2003-2012), 490 (2013-2019), 817 (2020-2024).
The 2013 certifier gap
`certifier` (byte 110) and `tobacco_use` (byte 142) are `suppressed = FALSE` for data year 2013 yet still read as all-`NA`. That is deliberate. Both fields are blank in the restricted 2013 file as well, so this is a one-year gap in the NCHS source rather than a public-use confidentiality suppression, and flagging it as suppressed would assert a masking that did not happen. Either way the imported column is `NA`.