build_dataset
Build an analysis-ready dataset by merging selected NHANES tables with the DEMO file, pooling cycles, and automatically adding the rescaled analysis weight. Ensure valid domain estimation with design variables retained.
Instructions
Build an analysis-ready dataset: DEMO universe (all participants, needed for valid domain estimation) left-joined to the requested tables on SEQN, for one or more cycles.
tables: base names without cycle suffix, e.g. ["BMX", "TCHOL", "BPQ"] (DEMO is always included). variables: columns to keep from those tables (default: all). Weight/design variables are always kept. The analysis weight is chosen and rescaled automatically -> column WT_ANALYSIS.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cycles | Yes | ||
| tables | Yes | ||
| variables | No | ||
| include_mortality | No |