Tutorials › Introduction to Statistics › Workshop: Visualizing a Campus Survey

Graphs for Categorical Data · Tutorial 120 of 996

Workshop: Visualizing a Campus Survey

Turn a small set of campus-survey responses into a frequency table and an appropriate, carefully checked categorical display.

Beginner 10 min read

What You'll Learn

  • Identify the response unit, survey question, and categories represented in a categorical data set.
  • Tally raw responses into a frequency table and verify the total.
  • Calculate relative frequencies and percentages using the correct denominator.
  • Choose a display that answers the stated question about categorical responses.
  • Construct a count-based bar display and audit its labels, scale, and consistency.
  • Distinguish conclusions about survey respondents from claims about the whole campus.

From Survey Responses to a Display

A categorical display is only useful if it answers a well-defined question and accurately represents the responses collected. Before drawing bars or comparing slices, establish what one response represents, which categories are possible, and how many valid responses are included. These checks connect a graph to the data rather than treating it as decoration.

In this workshop, a hypothetical campus survey asks each respondent: “Where do you most often study on campus?” Each of 26 students gives exactly one answer. The possible responses are Library, Dorm room, Café, Student center, and Outdoor space. The data are therefore one categorical variable recorded for 26 respondents. Because each student supplies one answer, the categories should not overlap for this question, and the total number of responses should be 26.

Definition: The frequency of a category is the number of observations in the data set that belong to that category. The relative frequency is that frequency divided by the total number of observations. If category \(i\) has frequency \(f_i\) among \(n\) observations, its relative frequency is \(f_i/n\), and its percentage is \(100(f_i/n)\%\).

Build and Check a Frequency Table

A frequency table organizes the category counts before a graph is made. Start by listing each category once, then tally each response into exactly one appropriate row. The following hypothetical responses are shown in their recorded order:

Café, Library, Dorm room, Outdoor space, Library, Student center, Café, Dorm room, Library, Student center, Outdoor space, Dorm room, Library, Café, Library, Student center, Dorm room, Outdoor space, Library, Café, Dorm room, Library, Student center, Café, Library, Dorm room.

Worked Example: Tallying the Campus Responses

Create a frequency table for the 26 responses. For each response, add one tally to its category. To make the results easy to scan, arrange the categories from greatest to least frequency, and then compute each relative frequency using \(n=26\).

Study locationFrequencyRelative frequencyPercentage
Library88/26 = 0.307730.8%
Dorm room66/26 = 0.230823.1%
Café55/26 = 0.192319.2%
Student center44/26 = 0.153815.4%
Outdoor space33/26 = 0.115411.5%
Total261.0000100.0%

For example, the Library appears 8 times, so its relative frequency is \(8/26=0.3077\), or \(100(8/26)=30.77\%\), which rounds to 30.8%. The Dorm room count is 6, the Café count is 5, the Student center count is 4, and the Outdoor space count is 3. Adding the counts gives \(8+6+5+4+3=26\), matching the number of respondents.

The total row is an important audit, not just a convenient summary. If it did not equal 26, a response may have been missed, counted twice, or assigned to a category inconsistently. The relative frequencies also provide a second check: before rounding, they must sum to 1 because

$$ \sum_{i=1}^{5}\frac{f_i}{n} = \frac{\sum_{i=1}^{5}f_i}{n} = \frac{26}{26} = 1. $$

Here the displayed percentages sum to \(30.8+23.1+19.2+15.4+11.5=100.0\%\). Rounded values may sum to just above or below 100% in other tables; small discrepancies can result from rounding. A substantial discrepancy is a reason to recheck the counts, the denominator, or the arithmetic.

Choose a Display for the Question

The survey question asks which location respondents choose most often. A bar chart is a natural choice: the category names remain visible, and bar lengths make the counts easy to compare. Since the question is about the number of students selecting each location, use frequencies as bar heights or lengths. If the question instead asks what share of these 26 responses belongs to each location, the relative frequencies or percentages communicate that share directly. Either way, state the denominator when reporting proportions.

A pie chart can also represent parts of one whole, but comparing the sizes of several bars is generally more direct for identifying the most and least frequent categories. A frequency table remains useful when readers need exact numbers. Choosing among bars, pies, and tables depends on the comparison the reader needs to make; the same data do not require the same display for every question.

For this example, the bar chart below is represented as a table of horizontal bars. Each block represents one student response. The count column supplies the exact frequency, while the bar lengths provide a quick visual comparison. In a drawn chart, the category labels would sit beside the bars, and the count axis would start at zero with a consistent scale.

Worked Example: Constructing a Count-Based Bar Display

Construct a display to answer: “Which study location was reported most often, and how do the counts compare?” Use the frequency table from the 26-response survey. Set one block equal to one response, so a category with frequency \(f_i\) receives exactly \(f_i\) blocks.

Study locationCountBar; one block = one response
Library8████████
Dorm room6██████
Café5█████
Student center4████
Outdoor space3███

The Library bar has 8 blocks because its count is 8; the other bars follow the same rule. The display shows that the Library is the most frequently reported location among these respondents, with 8 responses, and Outdoor space is the least frequently reported, with 3. The count difference is \(8-3=5\) responses. The bar lengths are proportional to the counts because every block represents the same number of responses and the scale begins at zero.

A precise report stays within what these data establish: “Among the 26 respondents, 8 reported the Library as the place they most often study.” The result alone does not show that 8 out of every 26 students on the entire campus would give that answer. Extending a survey result beyond its respondents requires information about how those respondents were selected and whether they represent the campus population.

Audit the Display Before Interpreting It

A display can contain the right counts and still mislead if its labels, scale, or construction do not match the data. An audit begins with the question and works through the connection between response, table, and visual mark. For a one-answer categorical survey, check that every response is counted once, the categories make sense for the question, and the table total matches the number of valid responses. Then check that the display uses the same counts and clearly identifies its scale.

For a bar chart of counts, a zero baseline makes bar lengths proportional to the numbers they represent. The category labels must identify the bars, and the axis must say whether it shows counts or percentages. If the display shows percentages, confirm that the denominator is the number of responses relevant to the question. A graph that says “percent” without making the denominator clear can invite a comparison that the data do not support.

Worked Example: Finding a Distorted Bar Scale

Suppose someone redraws the campus results as a bar chart with the correct category labels and count values, but starts the horizontal count axis at 2 rather than 0. The visible bar lengths would then be proportional to count minus 2. Compare what the chart suggests for Library and Outdoor space with the actual counts.

The actual counts are 8 for Library and 3 for Outdoor space, so their count ratio is \(8/3\approx2.67\). With an axis beginning at 2, the visible lengths correspond to \(8-2=6\) and \(3-2=1\); their displayed-length ratio is \(6/1=6\). Thus the Library bar appears six times as long as the Outdoor space bar, even though the count is only about 2.67 times as large. The labels and numbers may be correct, but the truncated baseline exaggerates the visual difference.

To correct the display, begin the count axis at zero and use equal intervals. Then the bar lengths represent 8 and 3 units from the same baseline. Alternatively, show a frequency table if exact comparisons matter more than a visual summary. In either case, do not describe the distorted bars as evidence of a sixfold difference in responses.

A Practical Construction and Audit Routine

The reasoning can be made systematic. State the question first, then make sure the display matches the response type and the comparison requested. Use the following routine whenever turning categorical survey responses into a table and graph.

1
Define the response unit and question.
Record what one observation represents and what was asked. For the campus survey, one observation is one student’s answer to the study-location question.
2
List categories and tally responses.
Make categories clear and mutually exclusive for the question, then count each valid response once. Check that the frequency total matches the number of responses included.
3
Choose the display and scale.
Use bars to compare category counts or proportions; a table is useful for exact values. Label categories and units, identify the denominator for percentages, and use a zero baseline for count bars.
4
Compare the display with the table.
Verify that each bar or slice represents the table value, that category order and labels are consistent, and that the display supports only conclusions about the observations measured.

Why These Checks Matter

The table, display, and interpretation are three parts of one argument. The table establishes how the raw responses were summarized; the graph makes a comparison visible; the written conclusion says what that comparison means. If any part changes the denominator, category definitions, or scale, the argument no longer follows cleanly from the survey data.

A frequent mistake is to calculate each percentage using a different denominator, such as dividing one category count by 26 but another by the number of responses in a subgroup. The correction is to define the group being summarized and use its total consistently. For the overall campus-survey table, every relative frequency uses 26 because there are 26 respondents and each provided one answer. Another common mistake is to call the most frequent response the preference of “campus students” in general. The safer conclusion names the observed group: it was the most common answer among these 26 respondents.

A final audit asks whether a reader can identify the question, categories, counts or percentages, and comparison at a glance. If not, improve the labels or include the frequency table alongside the graph. A clear display does not eliminate the need to check the data; it makes the verified data easier to understand.

Key takeaway: For categorical survey data, count each response once, check that the frequencies add to the number of valid responses, and choose a display that answers the stated question. Make the scale and denominator explicit, then describe findings in terms of the respondents actually observed.

Check Your Understanding

Use the campus-survey example and the construction routine to answer these questions.

  1. Why should the five category frequencies add to 26 in this survey?
  2. What is the relative frequency and percentage for the Student center? Show the denominator used.
  3. Which display would more directly show the exact count for each study location: a frequency table or a pie chart? Explain.
  4. If a count bar chart starts its axis at 2, how would the displayed lengths for counts of 8 and 3 compare? Why can that be misleading?
  5. Write one accurate sentence describing the Library result without making an unsupported claim about all campus students.