cycle stringlengths 4 9 | nsfg_cycle stringclasses 8
values | fieldwork stringlengths 4 19 | age_universe stringclasses 4
values | female_respondents int32 5.55k 12.3k | male_respondents int32 4.37k 10.4k ⌀ | pregnancies int32 8.25k 23k ⌀ | files int32 1 6 | weight stringlengths 4 76 | stratum stringclasses 6
values | cluster stringclasses 7
values | variance_method stringclasses 7
values | pooling_guidance stringclasses 5
values | doc_url stringlengths 45 52 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1973 | Cycle 1 | 1973 | Ever-married women 15-44 (and never-married mothers) | 9,797 | null | null | 1 | PSWT | FAM_PSEUDO | FAM_PAIRNUM | Taylor linearization with pseudo-strata and paired PSUs (Cycle 1 codebook, p. 7) | Separate survey; not designed for pooling with other cycles (different universe: ever-married women in 1973-1976, women 15-44 in 1982-2002). | https://www.cdc.gov/nchs/nsfg/nsfg_cycle1.htm |
1976 | Cycle 2 | 1976 | Ever-married women 15-44 (and never-married mothers) | 8,611 | null | 23,042 | 3 | WTFINAL | STRAT (cyc2psu) | PSU (cyc2psu) | Taylor linearization; PSU/stratum in the separate cyc2psu file (join on RESPID) | Separate survey; not designed for pooling with other cycles (different universe: ever-married women in 1973-1976, women 15-44 in 1982-2002). | https://www.cdc.gov/nchs/nsfg/nsfg_cycle2.htm |
1982 | Cycle 3 | 1982 | Women 15-44 | 7,969 | null | 13,768 | 2 | FINALWT | PSEUDOST | PSUCODE | Taylor linearization with PSUCODE / PSEUDOST | Separate survey; not designed for pooling with other cycles (different universe: ever-married women in 1973-1976, women 15-44 in 1982-2002). | https://www.cdc.gov/nchs/nsfg/nsfg_cycle3.htm |
1988 | Cycle 4 | 1988 | Women 15-44 | 8,450 | null | 15,759 | 2 | W5 (two implied decimals) | null | null | Balanced repeated replication with 100 replicate weights REPWGT1-REPWGT100 (two implied decimals) | Separate survey; not designed for pooling with other cycles (different universe: ever-married women in 1973-1976, women 15-44 in 1982-2002). | https://www.cdc.gov/nchs/nsfg/nsfg_cycle4.htm |
1995 | Cycle 5 | 1995 | Women 15-44 | 10,847 | null | 21,332 | 3 | POST_WT | COL_STR | PANEL | Taylor linearization, with-replacement design: NEST COL_STR PANEL, WEIGHT POST_WT (Cycle 5 User's Guide, App. 2) | Separate survey; not designed for pooling with other cycles (different universe: ever-married women in 1973-1976, women 15-44 in 1982-2002). | https://www.cdc.gov/nchs/nsfg/nsfg_cycle5.htm |
2002 | Cycle 6 | Jan 2002 - Mar 2003 | Women and men 15-44 | 7,643 | 4,928 | 13,593 | 6 | FINALWGT | SEST | SECU_R (female), SECU_P (pregnancy), SECU (male) | Taylor linearization: strata SEST, clusters SECU*, weight as listed | Separate survey; compare estimates across cycles, do not pool for population totals. | https://www.cdc.gov/nchs/nsfg/nsfg_cycle6.htm |
2006-2010 | Continuous | Jun 2006 - Jun 2010 | Women and men 15-44 | 12,279 | 10,403 | 20,492 | 3 | WGTQ1Q16 (4-year); WGTQ1Q8, WGTQ5Q16, WGTQ9Q16, FINALWGT30 (partial periods) | SEST | SECU | Taylor linearization: strata SEST, clusters SECU*, weight as listed | Use WGTQ1Q16 for the full 2006-2010 file. For combinations with 2006-2010 or older see Appendix 2 of the 2013-2015 User's Guide. | https://www.cdc.gov/nchs/nsfg/nsfg_2006_2010_puf.htm |
2011-2013 | Continuous | Sep 2011 - Sep 2013 | Women and men 15-44 | 5,601 | 4,815 | 9,543 | 3 | WGT2011_2013 | SEST | SECU | Taylor linearization: strata SEST, clusters SECU*, weight as listed | Use the 2-year weight for comparisons; for pooled 2011-2019 periods use the combined-period weights in 2011_2019_FemaleWgtData / 2011_2019_MaleWgtData (WGT2011_2015, WGT2013_2017, WGT2015_2019, WGT2011_2017, WGT2013_2019, WGT2011_2019), join on CASEID. Respondents 45-49 (2015-2019) have no 4-, 6- or 8-year weight. | https://www.cdc.gov/nchs/nsfg/nsfg_2011_2013_puf.htm |
2013-2015 | Continuous | Sep 2013 - Sep 2015 | Women and men 15-44 | 5,699 | 4,506 | 9,358 | 3 | WGT2013_2015 | SEST | SECU | Taylor linearization: strata SEST, clusters SECU*, weight as listed | Use the 2-year weight for comparisons; for pooled 2011-2019 periods use the combined-period weights in 2011_2019_FemaleWgtData / 2011_2019_MaleWgtData (WGT2011_2015, WGT2013_2017, WGT2015_2019, WGT2011_2017, WGT2013_2019, WGT2011_2019), join on CASEID. Respondents 45-49 (2015-2019) have no 4-, 6- or 8-year weight. | https://www.cdc.gov/nchs/nsfg/nsfg_2013_2015_puf.htm |
2015-2017 | Continuous | Sep 2015 - Sep 2017 | Women and men 15-49 | 5,554 | 4,540 | 9,553 | 3 | WGT2015_2017 | SEST | SECU | Taylor linearization: strata SEST, clusters SECU*, weight as listed | Use the 2-year weight for comparisons; for pooled 2011-2019 periods use the combined-period weights in 2011_2019_FemaleWgtData / 2011_2019_MaleWgtData (WGT2011_2015, WGT2013_2017, WGT2015_2019, WGT2011_2017, WGT2013_2019, WGT2011_2019), join on CASEID. Respondents 45-49 (2015-2019) have no 4-, 6- or 8-year weight. | https://www.cdc.gov/nchs/nsfg/nsfg_2015_2017_puf.htm |
2017-2019 | Continuous | Sep 2017 - Sep 2019 | Women and men 15-49 | 6,141 | 5,206 | 10,215 | 3 | WGT2017_2019 | SEST | SECU | Taylor linearization: strata SEST, clusters SECU*, weight as listed | Use the 2-year weight for comparisons; for pooled 2011-2019 periods use the combined-period weights in 2011_2019_FemaleWgtData / 2011_2019_MaleWgtData (WGT2011_2015, WGT2013_2017, WGT2015_2019, WGT2011_2017, WGT2013_2019, WGT2011_2019), join on CASEID. Respondents 45-49 (2015-2019) have no 4-, 6- or 8-year weight. | https://www.cdc.gov/nchs/nsfg/nsfg_2017_2019_puf.htm |
2022-2023 | 2022-2023 | Jan 2022 - Dec 2023 | Women and men 15-49 | 5,586 | 4,371 | 8,247 | 3 | WGT2022_2023 | VEST | VECL | Taylor linearization: strata VEST, clusters VECL, weight WGT2022_2023 | NCHS does not advise combining 2022-2023 with earlier releases (break in fieldwork Oct 2019 - Dec 2021 and multimode design); no combined weights exist (2022-2023 FAQ, Q12). | https://www.cdc.gov/nchs/nsfg/nsfg-2022-2023-puf.htm |
NSFG 1973–2023 in Parquet (with variable dictionaries and survey design)
This dataset contains every public-use data file of the U.S. National Survey of Family Growth (NSFG), conducted by the CDC's National Center for Health Statistics (NCHS), from Cycle 1 (1973) through the 2022–2023 release. Each file has been converted from the NCHS fixed-width ASCII or SAS7BDAT original to Parquet, one Parquet file per original file, under the original file name. It also includes:
- a variable dictionary for each cycle, built from the official NCHS SAS setup programs (column positions, labels, value formats) and, where NCHS publishes machine-readable codebooks (1995, 2002, 2022–2023), the codebook question text, universe and value tables with published frequencies;
- the 2011–2019 combined-period weight files (4-, 6- and 8-year weights);
- the 1976 sample-design file, the 1995 fieldwork (sampling-frame) file and the 2002 household and revised insurance supplements;
- a cycle table with the weight, stratum and cluster variables of every cycle and the NCHS guidance on pooling cycles.
Built for the Bioanalysis R package. It works with any tool that reads Parquet: DuckDB, Arrow, Polars, pandas or R.
| Cycles | 12 (1973, 1976, 1982, 1988, 1995, 2002, 2006–2010, 2011–2013, 2013–2015, 2015–2017, 2017–2019, 2022–2023) |
| Files | 37 Parquet data files + 26 dictionary files (13 cycle folders × 2) + 2 metadata tables |
| Interviews | 94,177 female respondents, 38,769 male respondents (2002 onward), 154,902 pregnancy records |
| Variables | 49,988 file × variable dictionary rows; 371,138 value-label rows |
| Values | Original public-use codes; nothing recoded, imputed or dropped |
Layout
data/<cycle>/<component>/<FILE>.parquet
data/<cycle>/Dictionary/VARIABLES.parquet one row per file x variable
data/<cycle>/Dictionary/VALUES.parquet one row per file x variable x code
metadata/FILES.parquet every file: rows, columns, grain, join keys, source URL, MD5
metadata/CYCLES.parquet every cycle: fieldwork, universe, counts, design variables, pooling guidance
pipeline/ the R scripts that rebuilt everything from the NCHS sources
<cycle> is the NSFG release (1973 … 2022-2023, plus 2011-2019 for the combined-period
weights) and <component> the NCHS file type; Data by category below lists every file. The 1976
and 1982 originals are single hierarchical files holding respondent and pregnancy records; they are
split by record type into <FILE>_FemResp and <FILE>_Preg using the record-type columns given
in the NCHS setup programs and codebooks (1976: column 6, 1–4 respondent / 5 pregnancy; 1982:
columns 1499–1500, 00 respondent / 01–17 pregnancy).
Data by category
NCHS publishes each NSFG cycle as a small set of files: a female respondent file, a male respondent file (from 2002), a female pregnancy (interval) file with one record per pregnancy, and, for some cycles, weight, design and supplementary files. The folder under each cycle (<component>) keeps that grouping: FemResp, Male, FemPreg, Weights, Design, Household, Supplementary, Fieldwork. All files are tabular (49,988 columns in all); every column is numeric except 38 text columns (CASEID, DEVICE_TYPE, INTVWYEAR, PHASE, QUARTER, SCREENTIME, TEMP_NLAMOUNT).
| Category | Contents | Folders | Files | Cycles |
|---|---|---|---|---|
| Female respondent files | One record per woman interviewed: household screener items, marriage and cohabitation, pregnancies and births summarised, contraception, infertility, sexual activity, health, recodes, and the weight and design variables. | FemResp |
12 | 1973, 1976, 1982, 1988, 1995, 2002, 2006–2010, 2011–2013, 2013–2015, 2015–2017, 2017–2019, 2022–2023 |
| Male respondent files | One record per man interviewed (from 2002): fatherhood, partners, contraception, sexual activity, health, recodes, weight and design variables. | Male |
7 | 2002, 2006–2010, 2011–2013, 2013–2015, 2015–2017, 2017–2019, 2022–2023 |
| Female pregnancy (interval) files | One record per pregnancy reported by a female respondent: outcome, dates, gestation, birth weight, prenatal care, breastfeeding, wantedness; carries the respondent's weight and design variables. | FemPreg |
11 | 1976, 1982, 1988, 1995, 2002, 2006–2010, 2011–2013, 2013–2015, 2015–2017, 2017–2019, 2022–2023 |
| Weights and sample design files | Combined-period weights for pooling the 2011-2019 releases (4-, 6- and 8-year), and the Cycle 2 (1976) PSU/stratum file. | Design, Weights |
3 | 1976, 2011–2019 |
| Supplementary files | Cycle 6 (2002) household and revised insurance variables for women and men, and the Cycle 5 (1995) fieldwork file covering the whole sampling frame. | Fieldwork, Household, Supplementary |
4 | 1995, 2002 |
Cycles at a glance (from metadata/CYCLES.parquet):
| Cycle | NCHS name | Fieldwork | Universe | Women | Men | Pregnancy records | Files |
|---|---|---|---|---|---|---|---|
| 1973 | Cycle 1 | 1973 | Ever-married women 15-44 (and never-married mothers) | 9,797 | – | – | 1 |
| 1976 | Cycle 2 | 1976 | Ever-married women 15-44 (and never-married mothers) | 8,611 | – | 23,042 | 3 |
| 1982 | Cycle 3 | 1982 | Women 15-44 | 7,969 | – | 13,768 | 2 |
| 1988 | Cycle 4 | 1988 | Women 15-44 | 8,450 | – | 15,759 | 2 |
| 1995 | Cycle 5 | 1995 | Women 15-44 | 10,847 | – | 21,332 | 3 |
| 2002 | Cycle 6 | Jan 2002 - Mar 2003 | Women and men 15-44 | 7,643 | 4,928 | 13,593 | 6 |
| 2006–2010 | Continuous | Jun 2006 - Jun 2010 | Women and men 15-44 | 12,279 | 10,403 | 20,492 | 3 |
| 2011–2013 | Continuous | Sep 2011 - Sep 2013 | Women and men 15-44 | 5,601 | 4,815 | 9,543 | 3 |
| 2013–2015 | Continuous | Sep 2013 - Sep 2015 | Women and men 15-44 | 5,699 | 4,506 | 9,358 | 3 |
| 2015–2017 | Continuous | Sep 2015 - Sep 2017 | Women and men 15-49 | 5,554 | 4,540 | 9,553 | 3 |
| 2017–2019 | Continuous | Sep 2017 - Sep 2019 | Women and men 15-49 | 6,141 | 5,206 | 10,215 | 3 |
| 2022–2023 | 2022-2023 | Jan 2022 - Dec 2023 | Women and men 15-49 | 5,586 | 4,371 | 8,247 | 3 |
Plus 2011-2019 (combined-period weights): 2011_2019_FemaleWgtData (22,995 rows), 2011_2019_MaleWgtData (19,067 rows). The 1973 pregnancy file is not distributed by NCHS (ICPSR only).
File-naming convention. Each Parquet file keeps the NCHS data-file name without its extension:
| Cycles | NCHS pattern | Examples |
|---|---|---|
| 1973, 1976, 1982 | <YYYY>NSFGData (one hierarchical file per cycle; split here by record type into _FemResp and _Preg); 1976 design file cyc2psu |
1976NSFGData_FemResp, 1982NSFGData_FemResp, 1973NSFGData |
| 1988, 1995 | <YYYY>FemRespData, <YYYY>PregData; C5FieldworkData (Cycle 5) |
1988FemRespData, 1995FemRespData, 1988PregData |
| 2002 | 2002FemResp, 2002FemPreg, 2002Male, plus supplements under their NCHS names |
2002FemResp, 2002FemPreg, 2002HHvars |
| 2006–2010 | 2006_2010_<FemResp|FemPreg|Male> |
2006_2010_FemResp, 2006_2010_FemPreg, 2006_2010_Male |
| 2011–2013, 2013–2015, 2015–2017, 2017–2019 | <YYYY>_<YYYY>_<FemResp|FemPreg|Male>Data |
2011_2013_FemRespData, 2013_2015_FemRespData, 2015_2017_FemRespData |
| 2011–2019 | 2011_2019_<Female|Male>WgtData |
2011_2019_FemaleWgtData, 2011_2019_MaleWgtData |
| 2022–2023 | NSFG-2022-2023-<FemResp|FemPreg|MaleResp>PUFData |
NSFG-2022-2023-FemRespPUFData, NSFG-2022-2023-FemPregPUFData, NSFG-2022-2023-MaleRespPUFData |
Expand a category to see every file: cycle, NCHS file name, title, rows, columns, grain and join key. Path: data/<cycle>/<component>/<FILE>.parquet.
Female respondent files (FemResp): 12 files, cycles 1973, 1976, 1982, 1988, 1995, 2002, 2006–2010, 2011–2013, 2013–2015, 2015–2017, 2017–2019, 2022–2023
| Cycle | File | Title (NCHS) | Rows | Columns | Grain | Join key |
|---|---|---|---|---|---|---|
| 1973 | 1973NSFGData |
Cycle 1 (1973) Female Respondent File (currently and formerly married women 15-44) | 9,797 | 450 | one row per respondent | INT_ID |
| 1976 | 1976NSFGData_FemResp |
Cycle 2 (1976) Female Respondent File (respondent records, record type 1-4) | 8,611 | 468 | one row per respondent | RESPID |
| 1982 | 1982NSFGData_FemResp |
Cycle 3 (1982) Female Respondent File (respondent records, record type 00) | 7,969 | 741 | one row per respondent | CASEID |
| 1988 | 1988FemRespData |
Cycle 4 (1988) Female Respondent File | 8,450 | 1,437 | one row per respondent | CASEID |
| 1995 | 1995FemRespData |
Cycle 5 (1995) Female Respondent File | 10,847 | 5,754 | one row per respondent | CASEID |
| 2002 | 2002FemResp |
Cycle 6 (2002) Female Respondent File | 7,643 | 3,087 | one row per respondent | CASEID |
| 2006–2010 | 2006_2010_FemResp |
2006-2010 NSFG Female Respondent File | 12,279 | 3,741 | one row per respondent | CASEID |
| 2011–2013 | 2011_2013_FemRespData |
2011-2013 NSFG Female Respondent File | 5,601 | 3,094 | one row per respondent | CASEID |
| 2013–2015 | 2013_2015_FemRespData |
2013-2015 NSFG Female Respondent File | 5,699 | 3,207 | one row per respondent | CASEID |
| 2015–2017 | 2015_2017_FemRespData |
2015-2017 NSFG Female Respondent File | 5,554 | 3,024 | one row per respondent | CASEID |
| 2017–2019 | 2017_2019_FemRespData |
2017-2019 NSFG Female Respondent File | 6,141 | 2,609 | one row per respondent | CASEID |
| 2022–2023 | NSFG-2022-2023-FemRespPUFData |
2022-2023 NSFG Female Respondent File | 5,586 | 1,912 | one row per respondent | CaseID |
Male respondent files (Male): 7 files, cycles 2002, 2006–2010, 2011–2013, 2013–2015, 2015–2017, 2017–2019, 2022–2023
| Cycle | File | Title (NCHS) | Rows | Columns | Grain | Join key |
|---|---|---|---|---|---|---|
| 2002 | 2002Male |
Cycle 6 (2002) Male Respondent File | 4,928 | 1,993 | one row per respondent | CASEID |
| 2006–2010 | 2006_2010_Male |
2006-2010 NSFG Male Respondent File | 10,403 | 2,801 | one row per respondent | CASEID |
| 2011–2013 | 2011_2013_MaleData |
2011-2013 NSFG Male Respondent File | 4,815 | 3,059 | one row per respondent | CASEID |
| 2013–2015 | 2013_2015_MaleData |
2013-2015 NSFG Male Respondent File | 4,506 | 2,940 | one row per respondent | CASEID |
| 2015–2017 | 2015_2017_MaleData |
2015-2017 NSFG Male Respondent File | 4,540 | 2,945 | one row per respondent | CASEID |
| 2017–2019 | 2017_2019_MaleData |
2017-2019 NSFG Male Respondent File | 5,206 | 3,009 | one row per respondent | CASEID |
| 2022–2023 | NSFG-2022-2023-MaleRespPUFData |
2022-2023 NSFG Male Respondent File | 4,371 | 1,157 | one row per respondent | CaseID |
Female pregnancy (interval) files (FemPreg): 11 files, cycles 1976, 1982, 1988, 1995, 2002, 2006–2010, 2011–2013, 2013–2015, 2015–2017, 2017–2019, 2022–2023
| Cycle | File | Title (NCHS) | Rows | Columns | Grain | Join key |
|---|---|---|---|---|---|---|
| 1976 | 1976NSFGData_Preg |
Cycle 2 (1976) Pregnancy (Interval) File (interval records, record type 5) | 23,042 | 80 | one row per pregnancy (several rows per respondent) | ID + BPREC1 |
| 1982 | 1982NSFGData_Preg |
Cycle 3 (1982) Pregnancy (Interval) File (interval records, record type 01-17) | 13,768 | 174 | one row per pregnancy (several rows per respondent) | CASEID + BPREC |
| 1988 | 1988PregData |
Cycle 4 (1988) Pregnancy (Interval) File | 15,759 | 284 | one row per pregnancy (several rows per respondent) | SEQNUM + PREG_NUM |
| 1995 | 1995PregData |
Cycle 5 (1995) Pregnancy (Interval) File | 21,332 | 245 | one row per pregnancy (several rows per respondent) | CASEID + PREGORDR |
| 2002 | 2002FemPreg |
Cycle 6 (2002) Female Pregnancy (Interval) File | 13,593 | 243 | one row per pregnancy (several rows per respondent) | CASEID + PREGORDR |
| 2006–2010 | 2006_2010_FemPreg |
2006-2010 NSFG Female Pregnancy (Interval) File | 20,492 | 287 | one row per pregnancy (several rows per respondent) | CASEID + PREGORDR |
| 2011–2013 | 2011_2013_FemPregData |
2011-2013 NSFG Female Pregnancy (Interval) File | 9,543 | 278 | one row per pregnancy (several rows per respondent) | CASEID + PREGORDR |
| 2013–2015 | 2013_2015_FemPregData |
2013-2015 NSFG Female Pregnancy (Interval) File | 9,358 | 278 | one row per pregnancy (several rows per respondent) | CASEID + PREGORDR |
| 2015–2017 | 2015_2017_FemPregData |
2015-2017 NSFG Female Pregnancy (Interval) File | 9,553 | 248 | one row per pregnancy (several rows per respondent) | CASEID + PREGORDR |
| 2017–2019 | 2017_2019_FemPregData |
2017-2019 NSFG Female Pregnancy (Interval) File | 10,215 | 171 | one row per pregnancy (several rows per respondent) | CASEID + PREGORDR |
| 2022–2023 | NSFG-2022-2023-FemPregPUFData |
2022-2023 NSFG Female Pregnancy (Interval) File | 8,247 | 111 | one row per pregnancy (several rows per respondent) | CaseID + PREGORDR |
Weights and sample design files (Design, Weights): 3 files, cycles 1976, 2011–2019
| Cycle | File | Title (NCHS) | Rows | Columns | Grain | Join key |
|---|---|---|---|---|---|---|
| 1976 | cyc2psu |
Cycle 2 (1976) Sample Design File (PSU and stratum for variance estimation) | 8,611 | 3 | one row per respondent | RESPID |
| 2011–2019 | 2011_2019_FemaleWgtData |
2011-2019 Combined Files: Female Respondent Weights (4-, 6- and 8-year) | 22,995 | 7 | one row per respondent | CASEID |
| 2011–2019 | 2011_2019_MaleWgtData |
2011-2019 Combined Files: Male Respondent Weights (4-, 6- and 8-year) | 19,067 | 7 | one row per respondent | CASEID |
Supplementary files (Fieldwork, Household, Supplementary): 4 files, cycles 1995, 2002
| Cycle | File | Title (NCHS) | Rows | Columns | Grain | Join key |
|---|---|---|---|---|---|---|
| 1995 | C5FieldworkData |
Cycle 5 (1995) Fieldwork File (complete sampling frame: respondents and nonrespondents) | 14,000 | 128 | one row per respondent | CASEID |
| 2002 | 2002HHvars |
Cycle 6 (2002) Household Variables (female and male respondents) | 12,571 | 10 | one row per respondent | CASEID |
| 2002 | hhpartypnew |
Cycle 6 (2002) Household Parent Type, 2nd version (HHPARTYP2) | 12,571 | 3 | one row per respondent | CASEID |
| 2002 | c6_curr_ins |
Cycle 6 (2002) Revised Current Health Insurance Recode (CURR_INS) | 12,571 | 3 | one row per respondent | CASEID |
Hugging Face subsets and splits
On Hugging Face a subset (also called a config) is one named table: it is the drop-down list above the Dataset Viewer and the second argument of load_dataset("jamesjiadazhan/NSFG", "<subset>"). A split is a part of a subset, chosen with split=. In this dataset a split is all (the whole subset), one survey cycle (cycle_2017_2019 is the 2017–2019 release; the dictionaries also carry the cycle in their cycle column, so splits can be stacked), or, for the 2011–2019 weights, female / male.
| Subset | What it holds | Splits |
|---|---|---|
files |
Catalogue of the 37 data files: cycle, folder, title, rows, columns, grain, join keys, path, source URL, MD5. | all |
cycles |
One row per cycle (12): fieldwork, universe, counts, weight / stratum / cluster variables, variance method, pooling guidance. | all |
dictionary_variables |
Variable dictionary: one row per file × variable. | 13, one per cycle (cycle_1973 … cycle_2022_2023); column cycle |
dictionary_values |
Value dictionary: one row per file × variable × code. | 13, one per cycle (cycle_1973 … cycle_2022_2023); column cycle |
weights_2011_2019 |
2011_2019_FemaleWgtData and 2011_2019_MaleWgtData (22,995 / 19,067 rows, 7 columns): 2011-2019 Combined Files: Female Respondent Weights (4-, 6- and 8-year); 2011-2019 Combined Files: Male Respondent Weights (4-, 6- and 8-year). |
female, male |
pregnancy_2022_2023 |
NSFG-2022-2023-FemPregPUFData (8,247 rows, 111 columns): 2022-2023 NSFG Female Pregnancy (Interval) File. |
all |
pregnancy_2017_2019 |
2017_2019_FemPregData (10,215 rows, 171 columns): 2017-2019 NSFG Female Pregnancy (Interval) File. |
all |
33 of the 37 data files are not subsets; the Dataset Viewer does not show them, but the Files and versions tab and every reader below do. There are two reasons:
- Too wide for the viewer. 16 respondent files have 1,157–5,754 columns, and the Hugging Face viewer and
datasetssubsets stop at 1,000 columns:1988FemRespData(1,437),1995FemRespData(5,754),2002FemResp(3,087),2002Male(1,993),2006_2010_FemResp(3,741),2006_2010_Male(2,801),2011_2013_FemRespData(3,094),2011_2013_MaleData(3,059),2013_2015_FemRespData(3,207),2013_2015_MaleData(2,940),2015_2017_FemRespData(3,024),2015_2017_MaleData(2,945),2017_2019_FemRespData(2,609),2017_2019_MaleData(3,009),NSFG-2022-2023-FemRespPUFData(1,912),NSFG-2022-2023-MaleRespPUFData(1,157). For this reason the earlier subsetsfemale_2017_2019,male_2017_2019,female_2022_2023andmale_2022_2023were removed (the viewer could not display them); the files themselves are unchanged and are read by path as shown below. - Columns differ between cycles. A subset needs the same columns in all its files, but each NSFG cycle has its own questionnaire and variable list, so files of different cycles cannot share a subset. Only the two most recent pregnancy files are offered as one-file subsets; the other 17 files (3–741 columns) are read by path:
1973NSFGData,cyc2psu,1976NSFGData_Preg,1976NSFGData_FemResp,1982NSFGData_Preg,1982NSFGData_FemResp,1988PregData,1995PregData,C5FieldworkData,2002FemPreg,2002HHvars,hhpartypnew,c6_curr_ins,2006_2010_FemPreg,2011_2013_FemPregData,2013_2015_FemPregData,2015_2017_FemPregData.
Read any file by its path (listed in the files subset and in Data by category), for example with DuckDB or Arrow, selecting only the columns you need:
import duckdb
duckdb.sql("SELECT CASEID, AGER, WGT2017_2019, SECU, SEST FROM 'hf://datasets/jamesjiadazhan/NSFG/data/2017-2019/FemResp/2017_2019_FemRespData.parquet'").df()
Data dictionary
Each cycle folder has its own dictionary (the 2011–2019 weights have theirs under data/2011-2019/Dictionary/). Labels and value codes come from the official NCHS SAS setup programs (1973–2019) or SAS7BDAT labels (2022–2023); question text, universe and published frequencies come from the NCHS codebooks where they are machine-readable.
| File | Subset | One row per | Main columns |
|---|---|---|---|
data/<cycle>/Dictionary/VARIABLES.parquet |
dictionary_variables |
file × variable | file, file_label, variable, position, start/end (columns in the fixed-width original), type, label, sas_label, sas_format, question_text, universe (who was asked), variable_type, notes, n_nonmissing, in_codebook, label_source, codebook_files, doc_url |
data/<cycle>/Dictionary/VALUES.parquet |
dictionary_values |
file × variable × code | file, variable, format, code (as written by NCHS, including ranges such as 1-3 and ./Blank for missing), description, count (published frequency, codebooks only), source |
Coverage by cycle:
| Cycle | Files | Variables | With question text / universe | Variables with value labels | Value rows | Labels from | Values from |
|---|---|---|---|---|---|---|---|
| 1973 | 1 | 450 | 0 | 383 | 2,743 | SAS setup program | SAS setup PROC FORMAT |
| 1976 | 3 | 551 | 0 | 495 | 9,400 | SAS setup program, NCHS documentation, SAS7BDAT label | SAS setup PROC FORMAT |
| 1982 | 2 | 915 | 0 | 902 | 9,479 | SAS setup program | SAS setup PROC FORMAT |
| 1988 | 2 | 1,721 | 0 | 1,489 | 18,762 | SAS setup program | SAS setup PROC FORMAT |
| 1995 | 3 | 6,127 | 6,119 | 6,071 | 70,722 | SAS setup program, codebook | codebook, SAS setup PROC FORMAT |
| 2002 | 6 | 5,339 | 5,323 | 5,316 | 46,141 | SAS setup program, NCHS documentation, SAS7BDAT label | codebook, SAS setup PROC FORMAT |
| 2006–2010 | 3 | 6,829 | 0 | 6,755 | 59,041 | SAS setup program | SAS setup PROC FORMAT |
| 2011–2013 | 3 | 6,431 | 0 | 5,847 | 23,322 | SAS setup program | SAS setup PROC FORMAT |
| 2013–2015 | 3 | 6,425 | 0 | 6,251 | 38,889 | SAS setup program | SAS setup PROC FORMAT |
| 2015–2017 | 3 | 6,217 | 0 | 6,163 | 40,788 | SAS setup program | SAS setup PROC FORMAT |
| 2017–2019 | 3 | 5,789 | 0 | 5,633 | 37,295 | SAS setup program | SAS setup PROC FORMAT |
| 2022–2023 | 3 | 3,180 | 1,264 | 2,025 | 14,556 | SAS7BDAT label, codebook | codebook, codebook of another file of this cycle (same SAS format) |
| 2011–2019 | 2 | 14 | 0 | 0 | 0 | SAS setup program | – |
The setup programs' "missing value recode" statements are not applied to the data: codes such as 98 (refused) and 99 (don't know) stay as published, so check VALUES before computing means. The 2022–2023 female respondent codebook was not available as text, so that file has labels but its value labels are borrowed from the male and pregnancy codebooks where the SAS format is the same (source says so) and it has no counts.
Example: file = '2017_2019_FemRespData', variable = 'CONSTAT1' (Current contraceptive status (1st priority code) (RECODE)) has 35 codes, e.g. 1 = Female sterilization, 2 = Male sterilization, 3 = Norplant or Implanon implant.
import duckdb
base = 'hf://datasets/jamesjiadazhan/NSFG/data/2017-2019/Dictionary'
duckdb.sql(f"SELECT code, description, source FROM '{base}/VALUES.parquet' "
"WHERE file = '2017_2019_FemRespData' AND variable = 'CONSTAT1'").show()
Official NCHS documentation: each cycle's page (codebooks, user's guide, questionnaires) is in doc_url of the dictionary, of files and of cycles, for example 2022–2023 and 2017–2019; codebook_files names the codebook PDFs that were parsed.
Joining
- Within a cycle, files join on the respondent ID. Its name changes across cycles; see
metadata/FILES.parquet(id_variable,grain,join_keys,joins_to,ids_matched):- 1973
INT_ID; 1976RESPID(respondent,cyc2psu) =ID(pregnancy); 1982CASEID; 1988CASEID(respondent) =SEQNUM(pregnancy); 1995–2019CASEID; 2022–2023CaseID. - Pregnancy files have one row per pregnancy: key = ID + pregnancy order (
PREGORDRfrom 1995;BPREC11976,BPREC1982,PREG_NUM1988). - In 2002
CASEIDis text in the respondent and pregnancy files ($in the NCHS setup) but numeric in2002HHvars,hhpartypnewandc6_curr_ins; cast before joining. The 2002 household and insurance files hold women and men together (12,571 rows,R_SEX). - The 1995 fieldwork file covers the whole sampling frame (14,000 women); 10,847 of its
CASEIDs are respondents.
- 1973
- Female and male files never share IDs within a cycle; they are separate samples and are not linked (a man and a woman in the file are not couples).
- Across cycles, IDs are not person identifiers: the same number can occur in different
cycles (1973–1988 numbers reappear in later cycles) and nobody is followed over time. The
exception is 2011–2019: IDs are unique over the four releases, so
2011_2019_FemaleWgtData/2011_2019_MaleWgtDatajoin to the stacked 2011–2019 respondent files onCASEID. - Variables differ by cycle (questionnaires changed); never assume that a name means the same across cycles without checking each cycle's dictionary.
Quick start
DuckDB (Python, R or CLI). No download is needed:
import duckdb
con = duckdb.connect()
base = "hf://datasets/jamesjiadazhan/NSFG/data"
con.sql(f"""
SELECT f.CASEID, f.AGER, f.CONSTAT1, f.SEST, f.SECU, f.WGT2017_2019,
count(p.PREGORDR) AS n_preg_records
FROM read_parquet('{base}/2017-2019/FemResp/2017_2019_FemRespData.parquet') f
LEFT JOIN read_parquet('{base}/2017-2019/FemPreg/2017_2019_FemPregData.parquet') p USING (CASEID)
GROUP BY ALL
""").df()
Dictionary lookup:
con.sql(f"""
SELECT file, variable, label, question_text, universe
FROM read_parquet('{base}/2002/Dictionary/VARIABLES.parquet')
WHERE lower(label) LIKE '%contracept%'
""").show()
con.sql(f"""
SELECT code, description, count, source FROM read_parquet('{base}/2017-2019/Dictionary/VALUES.parquet')
WHERE file = '2017_2019_FemRespData' AND variable = 'CONSTAT1'
""").show()
R (arrow + survey):
library(arrow); library(survey)
base <- "https://huggingface.co/datasets/jamesjiadazhan/NSFG/resolve/main/data"
f <- read_parquet(file.path(base, "2017-2019/FemResp/2017_2019_FemRespData.parquet"),
col_select = c("CASEID", "AGER", "CONSTAT1", "SEST", "SECU", "WGT2017_2019"))
des <- svydesign(ids = ~SECU, strata = ~SEST, weights = ~WGT2017_2019, nest = TRUE, data = f)
svymean(~I(CONSTAT1 %in% 6), des)
Hugging Face datasets (only the subsets listed in Hugging Face subsets and splits; the wide
respondent files are read by path as above):
from datasets import load_dataset
dic = load_dataset("jamesjiadazhan/NSFG", "dictionary_variables", split="cycle_2022_2023")
Survey design: required for every NSFG estimate
The NSFG is a multistage area probability sample with oversampling (for example of Black and
Hispanic persons and teenagers). Every estimate, including percentages, means, regressions and
survival analyses, must use the weight and the design variables of the cycle
(metadata/CYCLES.parquet):
| Cycle | Weight | Stratum | Cluster (PSU) | Notes |
|---|---|---|---|---|
| 1973 | PSWT |
FAM_PSEUDO |
FAM_PAIRNUM |
pseudo-strata with paired PSUs |
| 1976 | WTFINAL |
STRAT |
PSU |
stratum and PSU are in cyc2psu (join on RESPID) |
| 1982 | FINALWT |
PSEUDOST |
PSUCODE |
NONRWT is for methodological work only |
| 1988 | W5 |
– | – | balanced repeated replication with REPWGT1–REPWGT100; W5 and the replicate weights carry two implied decimals (divide by 100) |
| 1995 | POST_WT |
COL_STR |
PANEL |
with-replacement design (Cycle 5 User's Guide, App. 2) |
| 2002 | FINALWGT |
SEST |
SECU_R (female), SECU_P (pregnancy), SECU (male) |
|
| 2006–2010 | WGTQ1Q16 |
SEST |
SECU |
WGTQ1Q8, WGTQ5Q16, WGTQ9Q16, FINALWGT30 for sub-periods |
| 2011–2013 … 2017–2019 | WGT2011_2013, WGT2013_2015, WGT2015_2017, WGT2017_2019 |
SEST |
SECU |
|
| 2022–2023 | WGT2022_2023 |
VEST |
VECL |
multimode (in-person and web) |
In R: survey::svydesign(ids = ~SECU, strata = ~SEST, weights = ~WGT2017_2019, nest = TRUE, data = ...)
(Taylor linearization, as in the NCHS SAS PROC SURVEYFREQ / Stata svy examples). Pregnancy
files carry the respondent's weight and design variables; analyses of pregnancies use them as
they are.
Pooling cycles (NCHS guidance).
- 2011–2019: use each 2-year weight to compare periods. To pool releases, use the combined-period
weights in
2011_2019_FemaleWgtData/2011_2019_MaleWgtData(WGT2011_2015,WGT2013_2017,WGT2015_2019,WGT2011_2017,WGT2013_2019,WGT2011_2019), joined onCASEID. Using the 2-year weights for pooled population totals "will result in inflated, inaccurate population size estimates". Respondents aged 45–49 (2015–2019) have no 4-, 6- or 8-year weight. Source: Combining data across NSFG file releases from 2011–2019. - Combinations with 2006–2010 or older: Appendix 2 of the 2013–2015 User's Guide.
- 2022–2023: "NCHS does not advise that users combine data for 2022-2023 with prior NSFG data releases for purposes of making populations estimates for a wider span of years", and urges caution when comparing 2022–2023 with earlier estimates (break in fieldwork from October 2019 to December 2021, multimode design, lower response rates). No combined weights exist. Source: 2022–2023 NSFG FAQ, Q12.
- 1973–2002 are separate surveys with different universes (1973 and 1976: ever-married women 15–44 and never-married mothers; 1982–1995: women 15–44; 2002–2013: women and men 15–44; 2015 onward: 15–49). Compare them; do not pool them for population totals.
Sources and processing
| Part | Source | Processing |
|---|---|---|
| 1973–2019 data | ftp.cdc.gov/…/Datasets/NSFG fixed-width .dat/.asc |
Fields cut at the column positions of the NCHS SAS setup program (sas/); blanks → missing; numeric fields parsed as numbers (as SAS column input does), $ fields kept as text; no recoding |
| 2022–2023 data | ftp.cdc.gov/…/NCHS/NSFG SAS7BDAT | haven::read_sas; labels and formats moved to the dictionary |
| 1976 PSU, 2002 supplements | cyc2psu, hhpartypnew, c6_curr_ins SAS7BDAT |
as above (the ASCII duplicates HHPARTYPNEWASC.DAT, 2002curr_ins.dat are not converted again) |
| 1995 fieldwork | C5FieldworkData.asc |
no setup program exists; layout taken from the fieldwork codebook (C5FieldworkCodebk.pdf) |
| 2002 household variables | 2002HHvars.dat |
column layout from Dataset_Documentation/NSFG/HouseholdVariables.sas |
| Dictionaries | setup programs + codebook PDFs (pdftotext) |
see above |
Setup-program quirks are kept as published: in 1982 F21_1CM/F22_1CM and DIS1MAR/AGEREMAR,
and in 1988 F44O/F44P, share columns in the NCHS layout. Labels that state implied decimals
(1988 REPWGT*; 1982 age at first marriage "to two decimal places") are not rescaled.
Validation (logs/validation.csv in the pipeline, 120 checks):
- Rows of all 37 files equal the NCHS user's guides / codebooks, and record length and number of
variables equal the 2006–2019 user's-guide tables, except two pregnancy files where the
distributed file is smaller than the guide: 2006–2010 (20,492 vs 20,497) and 2011–2013 (9,543
vs 9,547). In both, the rows equal the sum of the respondent recode
PREGNUM, so the files are internally consistent. - Pregnancy rows equal Σ
PREGNUMon the female file for 1982, 1995–2015 and 2022–2023 (1988: 15,759 vs 15,760; 2017–2019: 10,215 vs 10,217). - 116,408 published codebook frequencies (1995, 2002, 2022–2023) were compared with the data: all 2002, 1995 fieldwork and 2022–2023 pregnancy counts match; overall 99.97 % match (the 34 differences are 1995 and 2022–2023 male codebook entries whose value lists the text parser merged with a neighbouring variable).
- Every pregnancy, design, household and weight-file ID is found in its respondent file.
- Published estimate reproduced exactly: NSFG 2017–2019 Variance Estimation Example 1 (women 15–49 currently using the pill, by age): sum of weights 72,671,926, 18 strata, 72 clusters, and all six percentages (19.5112 … 6.5215) and Taylor-series SEs (1.8670 … 1.0029) to four decimals.
Coverage and gaps. Every file on the NCHS public FTP folders is included. Not included:
the 1973 pregnancy file and SPSS/Stata versions of 1973–1995 (NCHS refers users to the ICPSR
Integrated Fertility Survey Series); restricted-use files (ACASI details, contextual and
geographic data; NCHS Research Data Center only). The 2022–2023 female respondent codebook (PDF,
over 10 MB) could not be retrieved automatically, so that file has labels but no question text
or published counts; placing 2022-2023-NSFG-FemRespPUFCodebook.pdf in raw/docs/ and rerunning
04_dictionary.R --force adds them.
Licence and citation
- NSFG data are produced by NCHS, a U.S. Government agency; they are in the public domain. Cite: National Center for Health Statistics. National Survey of Family Growth (cycle), public-use data files and documentation. Hyattsville, MD: Centers for Disease Control and Prevention. https://www.cdc.gov/nchs/nsfg/
- This compilation (pipeline, dictionaries, layout) is released under CC0-1.0.
Data users must follow the NCHS data use restrictions: use the data for statistical reporting and analysis only, make no attempt to learn the identity of any person, and do not link these data with individually identifiable data from other datasets.
- Downloads last month
- 172