Get startedGet started for free

Creating contingency tables

Let's practice constructing contingency tables with svytable(). HealthGen is a categorical variable of the participant's self-reported health for participants aged 12 years and older. Let's look at the relationship between HealthGen and Depressed.

This exercise is part of the course

Analyzing Survey Data in R

View Course

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# Construct and display a frequency table
___ <- ___(~___,
           design = NHANES_design)
___
Edit and Run Code