1. Learn
  2. /
  3. Courses
  4. /
  5. Analyzing Survey Data in R

Exercise

Survey statistics

How many hours of sleep does the average person in the US get each night? Does sleep vary by gender? Let's explore these questions using the variables Gender and SleepHrsNight. SleepHrsNight contains the self-reported number of hours a participant usually sleeps on a weeknight and is only reported for participants who were at least 16 years old.

Instructions 1/2

undefined XP
    1
    2

-Compute the survey-weighted mean of SleepHrsNight. Note: The argument keep.names is the same as row.names from the video!