Description Usage Arguments Value Examples
View source: R/survey_functions.R
Takes a data.frame with NHANES data and at least one weight variable, and creates the proper design object for it. It simply puts the proper PSU strata, nest, and user-supplied weight into the svydesign function. Note this does NOT set options(survey.lonely.psu = "adjust").
1 | nhanes_design(df, wt = "WTINT2YR")
|
df |
a data.frame or data.table created from NHANES data |
wt |
The weight variable in the data as a character vector. Common options include WTINT2YR, WTMEC2YR, and WTSA2YR. See NHANES documentation for assigning weights across multiple years, and for choosing weights when there is more than 1 sampling frame (e.g., interview, mobile exam, fasting laboratory values, and other data subsets) |
Returns a survey design object (which contains all of the data) for use in analyses
1 2 3 4 | ## Not run:
nhanes_design(df = df, wt = "WTINT2YR")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.