Skip to main content

Comparisons

Due: Oct 19 by 11:59pm

Weight: This assignment is worth 1% of your final grade.

Purpose: The purpose of this assignment is to extend the data visualization skill you built in week 6 so that it knows how to make charts that compare values to one another and / or to a benchmark, then use it to make a comparison chart and check whether your agent got the details right.

Assessment: This assignment is graded using a check system:

  • ✔+ (110%): Responses shows phenomenal thought and engagement with the course content. I will not assign these often.
  • ✔ (100%): Responses are thoughtful, well-written, and show engagement with the course content. This is the expected level of performance.
  • ✔− (50%): Responses are hastily composed, too short, and/or only cursorily engages with the course content. This grade signals that you need to improve next time. I will hopefully not assign these often.

Notice that this is essentially a pass/fail system. I’m not grading your writing ability and I’m not counting the number of words you write - I’m looking for thoughtful engagement. One or two sentences is not enough. Write at least a paragraph and show me that you did the readings assigned.

1. Get Organized

Open your course repo (eda-f26/eda-netID) in Positron using File › Open Folder - open the folder itself, not a file inside it. If you haven’t cloned your course repo yet, follow the steps in HW1 first.

Everything for this assignment lives in the hw7 folder. Open the hw7.qmd file inside it - that’s the only file you need to edit. Take notes and write example code under the “Begin notes here” heading as you go through the readings and exercises below, then write your reflection under the “Reflection” heading at the end.

2. Read & Practice

“At the heart of quantitative reasoning is a single question: Compared to what?”

– Edward Tufte

The readings listed below are broken into two groups:

  1. Design principles
  2. Coding techniques to implement those principles

Design principles

Comparisons come in a few flavors: comparing groups to each other, comparing a value to a benchmark, and comparing whole distributions. These readings cover when each kind of chart works (and one common chart design that almost never does):

Coding techniques

The readings below each walk through how to build a specific comparison chart in ggplot. You don’t need to write this code yourself, but you should read it closely enough to recognize the pieces: a dumbbell chart is just points connected by segments, a slope chart is lines between two time points, and a bullet chart is bars layered on top of a benchmark. When an agent builds one of these for you, knowing the pieces is how you spot what it got wrong.

You may also want to take a look at the top 50 ggplots, which contains examples with ggplot code to create 50 common visualizations.

3. Extend your skill, then make a chart

Last week you built your own data visualization skill (e.g., .claude/skills/my-dataviz/SKILL.md). That skill was focused on amounts and proportions. This week you will teach it how to handle comparisons.

Extend your skill

  1. Open Claude Code in your course repo and ask it to help you add a section on comparisons to your existing skill, using the readings above as source material (you can give it the URLs). Ask it to extend the skill you already have, not write a new one.
  2. Read what it wrote. Does the new section capture the guidance from the readings? Some things worth checking for:
    • When comparing only 2 things, does it suggest dodged bars, bullet charts, or a dumbbell? What about 3 or more?
    • Does it say when to add a reference line (like an average or a target) for context?
    • Does it say to use facets instead of piling many categories into a legend?
    • Does it rule out dual y-axes?
  3. Make it yours. Edit the new section (directly, or by asking Claude to) so it reflects your own choices.

Use your skill to make a chart

Find a dataset with at least one categorical variable and something worth comparing across it (two time points, two groups, or a value and a benchmark). You can use one from the Packages section of the “Finding Data” page, or data from your project. Then ask Claude to make a comparison chart using your skill (invoke it with /your-skill-name).

Check the result against your skill and the readings. Is the comparison the reader should make the easiest one to see? If there is a reference line, is it at the right value, and is it labeled? In a dumbbell or slope chart, are the points connected to the right partners, and are the categories sorted in a meaningful order? If something is wrong, fix it, and consider whether your skill should be updated so that it gets it right next time.

In your hw7.qmd file, include:

  • A few sentences on what you added to your skill, and what you changed after Claude drafted it.
  • The chart you made with your skill, with one or two sentences under it describing what it shows.
  • A few sentences on how it went: Did the chart follow your skill on the first try? What did you have to check, correct, or change in the skill?

4. Reflect

This week, consider writing about a chart you’ve seen that makes a comparison across groups or categories.

Reflect on what you’ve learned while going through these readings and exercises. Is there anything that jumped out at you? Anything you found particularly interesting or confusing?

Write at least a paragraph in your hw7.qmd file, and include at least one question. The teaching team will review the questions we get and will try to answer them either in Slack or in class.

Some thoughts you may want to try in your reflection:

  • “I used to think ______, now I think ______ 🤔”
  • Discuss some of the key insights or things you found interesting in the readings or recent class periods.
  • Connect the course content to your own work or project you’re working on.

5. Submit

To submit your assignment, follow these instructions:

  1. Render your .qmd file by either clicking the “Preview” button in Positron or running quarto render in the terminal.
  2. Open the rendered html file and make sure it looks good! Is all the formatting as you expected?
  3. Commit and push your work using GitHub Desktop: look at the diff, write a short commit message, click Commit, then Push.
NoteRemember

Your work isn’t submitted until you’ve pushed it. Committing only saves the change on your own computer – go look at your repo on GitHub.com and confirm your work is actually there before you call this done.