Learning Goals
Deepen your understanding and form connections within these skills:
- Interpret which categorical variable is appropriate for answering a statistical question.
- Construct a pie chart from a frequency table of categorical data.
- Construct a bar graph from a frequency table of categorical data.
- Use the displayed data distribution of categorical data to answer research questions.
Larks or Owls?

In a 2012 sleep study[1], a sample of [latex]253[/latex] college students completed skills tests to measure cognitive function, completed surveys that ask many questions about attitudes and habits, and kept sleep diaries to record time and quality of sleep over a two-week period. The relationship between sleep and academic performance was evaluated. During this activity, you’ll use the Sleep Study data set to see that there are multiple ways to display categorical data.
video placement
[Intro: “In this activity, we’ll use technology to create graphical displays of a categorical variable. You should be familiar with picking out the categorical data from a data set and making a frequency table. Don’t worry, we’ll walk through the use of the analysis tool step by step. The key piece to take away from this activity will be understanding that there are multiple ways to display categorical data. You’ll be able to create freqency tables, bar graphs, and pie charts using technology and then use data distributions displayed in those tables and graphs to answer questions about a variable. Before we get started, think about your own chronotype; are you an Owl, a Lark, or neither? How about the others who go to your school? Do you think college students tend to be one or the other?”]
Categorical Variables
Before you look at the data set, think for a moment about the assumptions you already hold about college students, then answer the first question below.
question 1
The following [latex]10[/latex] variables are included in the sleep study data set. The variable names are presented in italics followed by a brief description. Recall that this is called a data dictionary.
- Chronotype: Lark, owl, or neither; a lark is a morning person, an owl is a night person, and neither is neither a morning nor a night person
- ClassYear: 1, 2, 3, 4; 1 = freshman, 2 = sophomore, 3 = junior, 4 = senior
- NumEarlyClass: Number of classes per week taken before 9 am
- EarlyClass: 0, 1; 0 = is not taking any early classes and 1 = is taking at least one early class
- GPA: Grade point average (0–4 scale)
- ClassesMissed: Number of classes missed in a semester
- PoorSleepQuality: Measure of sleep quality (higher values indicate poorer sleep)
- Stress: Coded stress score, normal or high
- AlcoholUse: Self-reported alcohol use—abstain, light, moderate, heavy
- Drinks: Number of alcoholic drinks per week
question 2
question 3
- SleepStudy: Sleep Study. (2019, May 2). rdrr.oi. Retrieved from https://rdrr.io/cran/Lock5withR/man/SleepStudy.html ↵