Forming Connections in Displaying Categorical Data: 3A – 3

Larks or Owls?

A student napping on a desk in a classroom

In a 2012 sleep study[1], a sample of 253 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 dataset to see that there are multiple ways to display categorical data.

In the sleep study, students were asked if they identified as Larks, Owls, or Neither. A Lark is a morning person, an Owl is a night person, and Neither is a person who is neither a morning or night person. Their responses were recorded in a variable named Chronotype.

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 dataset 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?”]

Interpreting Categorical Variables

Before you look at the dataset, think for a moment about the assumptions you already hold about college students, then answer the first question below.

question 1

What is your chronotype? Do you think college students are more likely to be larks, owls, or neither? Explain.

The following 10 variables are included in the sleep study dataset. 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

Constructing Pie Charts

Let’s use technology to create a pie chart that visualizes the distribution of Chronotype for all 253 students in the study.

video placement

[Guiding: “This will be your first time using this tool in an activity. Let’s see how it should look together. [display the tool, going through the steps below to create a pie chart.] ]

Go to the Describing and Exploring Categorical Data tool at https://dcmathpathways.shinyapps.io/EDA_categorical/

Step 1) Select the One Categorical Variable tab.

Step 2) Locate the dropdown under Enter Data and select From Textbook.

Step 3) Click on the dropdown menu for Dataset and choose Sleep Study – Lark vs. Owl.

Step 4) Scroll down to Additional Plots and select the Pie Chart option.  The pie chart will appear below the bar graph.

question 4

Use your pie chart to answer the question: “Are college students likely to be morning people?” Explain.

Consider a hypothetical class of 42 students, each of whom answered the question, “are you a lark, an owl, or neither?” Let’s suppose that 12 responded that they were larks, 20 that they were owls, and 10 said they were neither a lark nor an owl.

video placement

[Guiding: “[First demonstrate using fake information for a few observations (say, n = 5 or 6, for simplicity)to create a frequency table, then display the tool, going through the steps below to enter the data from the frequency table. Also show that students may, alternatively, enter the data as “observations” by making the appropriate selection under “Enter Data” and then entering observations as “lark lark owl etc…] ]

Use the Describing and Exploring Categorical Data tool to create a pie graph for these data. Follow these steps:

Step 1) Select the One Categorical Variable tab.

Step 2) Locate the dropdown under Enter Data and select Frequency Table.

Step 3) Enter “3” for Number of Categories.

Step 4) In the box under Name of Variable, type Chronotype.

Step 5) Enter the labels for the 3 chronotypes and their respective numbers observed in the hypothetical class.

Step 6) Scroll down to locate Additional Plots and select Pie Chart.

question 5

question 6

Do students in the hypothetical class tend to be owls or larks? How does the distribution of Chronotype for students in the survey compare to students in the hypothetical class?

Constructing Bar Graphs

Let’s use a bar graph to examine another of the variables from the sleep study Alcohol use.

video placement

[Guiding:  [display the tool, going through the steps below to create a bar graph.] ]

In the Describing and Exploring Categorical Data tool, follow these steps:

Step 1) Select the One Categorical Variable tab.

Step 2) Under Enter Data choose From Textbook.

Step 3) Under Dataset, select Sleep Study – Alcohol Use.

Step 4) Under Options, check the Customize Order box to change the order of the bars to provide more meaning.

Step 5) Click in the box under Choose Order of Categories and the order should be abstain, light, moderate, heavy.

Step 6) Under Additional Plots select None.

question 7

question 8

How do students classify their alcohol consumption?

Data Distribution

Now you try the tool on our own to create a graph. Use the dataset “Sleep Study – Class Year” to create a bar graph to show the class years of the college students in the study. Make sure they are in the appropriate order. Look back to the steps above for guidance as needed.

question 9

Write a sentence explaining the bar graph you created from “Sleep Study — Class Year.”

question 10

Use your previous answers to answer the question: “Is there evidence of underage drinking at the college in this study?” Include a few sentences to explain your reasoning and make sure to clarify which graphs you used to make this decision.

video placement

[Wrap-up: “What did you discover? Did you find evidence for underage drinking? We saw that there were many sophomores involved in the study and we saw that many students responded that they drank “moderately.” Do you feel the combination of these two variables points to underage drinking being present at the survey school? There are other good questions to ask about this data, as well. Do you think there would be a relationship between alcohol and academic performance? What about alcohol and sleep?  Before we move on to the next section, let’s recap the objectives for this activity. [voice over the list at the top of the page, or move through the page using jump links] You’ve identified the categorical variables in the dataset and used technology to create frequency tables, bar graphs, and pie charts, then used those displays to answer research questions about the data. We’ll return to this study in future sections of the course to investigate other questions: would owls drink more than larks? Are different class levels more likely to be larks or owls? These are all good questions. Can you think of others?”]


  1.  SleepStudy: Sleep Study. (2019, May 2). rdrr.oi. Retrieved from https://rdrr.io/cran/Lock5withR/man/SleepStudy.html