Regression model
Now it's time for us to build a simple linear regression model for the Weight of 20-year-olds using Height. To do so, we first need to subset the design object NHANES_design to only include 20-year-olds while still retaining the original design structure.
Este ejercicio forma parte del curso
Analyzing Survey Data in R
Instrucciones del ejercicio
- Use
subset()to create a new design object,NHANES20_design, which only contains the 20-year-olds. - Using
svyglm(), build a simple linear regression model forWeightusingHeightwith the design objectNHANES20_designand store it asmod. - Print out a summary of the model.
Ejercicio interactivo práctico
Prueba este ejercicio y completa el código de muestra.
# Subset survey design object to only include 20 year olds
NHANES20_design <- subset(___, Age == ___)
# Build a linear regression model
mod <- svyglm(___ ~ ___, design = ___)
# Print summary of the model
___(___)