LoslegenKostenlos loslegen

Tying it all together!

Now let's dig into the NHANES design a little deeper so that we are prepared to analyze these data! Notice that I have re-created NHANES_design, which we created in the last video. Remember that it contains the design information for NHANESraw. The two important design variables in NHANESraw are SDMVSTRA, which contains the strata assignment for each unit, and SDMVPSU, which contains the cluster id within a given stratum. Remember that the clusters are nested inside the strata!

Diese Übung ist Teil des Kurses

Analyzing Survey Data in R

Kurs anzeigen

Interaktive Übung

Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.

# Specify the NHANES design
NHANES_design <- svydesign(data = NHANESraw, strata = ~SDMVSTRA, id = ~SDMVPSU, nest = TRUE, weights = ~WTMEC4YR)

# Print summary of design
___(___)
Code bearbeiten und ausführen