Module 2: Visual Detection of Normality

Pattern Recognition Challenge

☁️ Working Guidelines

0% Complete

🎯 Learning Objectives

By the end of this module, you will be able to:

  1. Produce a histogram, boxplot, and Q-Q plot for a variable in R using hist(), boxplot(), and qqnorm()/qqline() (Chapter 11).
  2. State, for each of six datasets, whether it is consistent with normality, citing the specific visual evidence you used.
  3. Name the Q-Q plot signature of each of three departures from normality: right skew, bimodality, and outliers.
  4. Explain why comparing the mean to the median can miss a non-normal distribution, using a dataset from this module as the example.
  5. Write a field guide you can apply to a variable you have never seen before.

🕵️ The Challenge

You're a data detective!

Six mystery variables have arrived on your desk, each measured on 40 cases. Some came from normal populations. Some did not. Nobody has told you which is which, and the file will not tell you either.

Your mission: examine each one in R and work out which distributions are normal — then figure out the patterns that let you do it, so you can do it again on data nobody has prepared for you.

Part 1: Load the Evidence

Open Posit Cloud and run this. It loads all six variables at once, straight from the course repository — no file uploading.

Run this:

mystery <- read.csv("https://jkoxford-a11y.github.io/awesomesaucestats/data/module2_mystery.csv") str(mystery)

What R prints:

'data.frame': 40 obs. of 6 variables: $ mystery1: num 100.9 99.2 77.7 79.1 102.6 ... $ mystery2: num 40.6 44.3 97 129.7 53.4 ... $ mystery3: num 81.1 88.1 70.7 69.3 94.3 ... $ mystery4: num 96.5 96.1 71.8 88.1 79.1 ... $ mystery5: num 102.6 88.2 81.6 92.9 89.8 ... $ mystery6: num 92.2 100.5 119.8 103.8 109.8 ...

If you get an error here, check the URL for typos before anything else — it is one long string and a single wrong character will break it. You should see 40 obs. of 6 variables.

Part 2: The Numbers-Only Pass

Before you plot anything, try to solve the case from summary statistics alone. This is what most people reach for first.

Run this:

summary(mystery)

What R prints:

mystery1 mystery2 mystery3 mystery4 Min. : 62.34 Min. : 40.22 Min. : 68.06 Min. : 49.62 1st Qu.: 88.02 1st Qu.: 50.42 1st Qu.: 80.78 1st Qu.: 76.84 Median :100.58 Median : 67.19 Median :102.56 Median : 91.86 Mean : 99.05 Mean : 80.23 Mean :102.17 Mean : 99.37 3rd Qu.:107.41 3rd Qu.: 95.60 3rd Qu.:123.84 3rd Qu.:120.35 Max. :130.24 Max. :208.19 Max. :143.76 Max. :217.66 mystery5 mystery6 Min. : 76.81 Min. : 84.83 1st Qu.: 89.92 1st Qu.: 98.52 Median : 98.81 Median :106.19 Mean :100.30 Mean :105.68 3rd Qu.:105.48 3rd Qu.:112.60 Max. :165.00 Max. :127.37

🔮 Commit to a prediction now. Using only the numbers above — especially how far the mean sits from the median — write your best guess for each variable. You will be held to this later, and being wrong here is the point of the exercise, not a failure at it.

Question 1: Which variables look normal from the numbers alone, and what in the summary told you so?

Question 2: Which look non-normal, and what gave them away?

Question 3: How confident are you, on a scale of 1–5, and why?

Part 3: The Visual Pass

Now look at each variable properly. Run this block six times, once per variable — change mystery1 to mystery2, and so on, each time. This is the Chapter 11 diagnostic set.

Run this (then repeat for each variable):

x <- mystery$mystery1 # <-- change this line each time par(mfrow = c(1, 3)) # 1 row x 3 columns hist(x, col = "lightblue", main = "Histogram") boxplot(x, col = "lightgreen", main = "Boxplot") qqnorm(x, main = "Q-Q Plot") qqline(x, col = "red") par(mfrow = c(1, 1)) # reset mean(x) median(x)

Reading the Q-Q plot (Chapter 11): qqline() draws the red line through the 1st and 3rd quartiles of your data. Points hugging that line mean roughly normal. A curve away from it means skew. An S-shape means the tails are too heavy or too light. A few points flying off one end mean outliers.

Do not skip qqline(). A Q-Q plot without its reference line is a scatter of dots you can talk yourself into believing anything about.

Record your detective work

For EACH variable, fill in what you actually saw:

Be specific. "Looks weird" is not evidence; "the right tail curves up away from the line" is.

Variable Histogram Shape Q-Q Plot Pattern Mean vs Median Verdict
mystery1

mystery2

mystery3

mystery4

mystery5

mystery6

Part 4: Close-Up — What Two Points Can Do

One of these variables deserves a second look. Run this.

Run this:

boxplot.stats(mystery$mystery5)$out # which values does the boxplot flag? mean(mystery$mystery5) median(mystery$mystery5) core <- sort(mystery$mystery5)[1:38] # the same data with the two flagged values removed mean(core) median(core)

What R prints:

> boxplot.stats(mystery$mystery5)$out [1] 158 165 > mean(mystery$mystery5) [1] 100.2977 > median(mystery$mystery5) [1] 98.805 > core <- sort(mystery$mystery5)[1:38] > mean(core) [1] 97.07658 > median(core) [1] 98

Question 4: Two values out of forty were removed. The mean moved by 3.22; the median moved by 0.805 — almost exactly a quarter as far. Explain why the median barely budged.

Question 5: Look again at your Q-Q plot for mystery5. Where exactly did those two values appear relative to the red line, and would you have caught them from the summary() output in Part 2 alone?

Part 5: Where the Numbers Misled You

Go back and compare your Part 2 predictions against what the plots showed you in Part 3. For at least one variable, the two disagree — that disagreement is the most important thing in this module.

Question 6: Which variable did the numbers-only pass get wrong, and what did the plot show that the summary statistics hid?

Question 7: Complete this sentence in your own words: "A mean and median that are close together tell you the distribution is ____________, but they do not tell you it is ____________."

Part 6: Pattern Discovery

Look across all six variables. What PATTERNS do you notice?

Question 8: When data ARE normal, the histogram looks:

Question 9: When data ARE normal, the Q-Q plot shows points that:

Question 10: When data are NOT normal, I notice these warning signs:

Histogram warning signs:

Q-Q plot warning signs:

Mean vs Median warning signs:

Part 7: Create Your Field Guide

Based on your discoveries, create a "field guide" for spotting non-normal data:

📊 HISTOGRAM RED FLAGS

List at least 3 things that indicate non-normality in a histogram:

📈 Q-Q PLOT RED FLAGS

List at least 3 patterns in Q-Q plots that suggest problems:

🔢 DESCRIPTIVE STATISTICS RED FLAGS

List at least 2 statistical indicators of non-normality — and 1 kind of non-normality they will not catch:

Part 8: Check Your Answers

Ready to see how the six variables were actually generated?

Part 9: Reflection

Question 11: Were you correct? Which variables surprised you and why?

Question 12: What patterns did you miss initially that you now understand?

Question 13: Which type of non-normality was easiest to spot? Which was hardest?

🎯 Key Discoveries

What You Should Have Discovered:

✔ Normal Data Characteristics:

✔ Types of Non-Normality:

✔ Most Reliable Indicators:

  1. Q-Q Plot — the most sensitive of the three, and the only one that caught all four non-normal variables here
  2. Histogram — quick overview, but the shape changes with breaks and it can mislead at small n
  3. Boxplot — best for outliers specifically
  4. Mean vs Median — catches skew, and misses bimodality entirely

📚 Looking Ahead

In Module 3, you'll learn:

Notice what you did not use today: a significance test. Chapter 11 teaches the visual check first on purpose — the plot tells you how a distribution departs from normal, which a p-value never will.

📋 Before You Submit

✅ Submission Checklist

Grading: Credit/no-credit, not scored for correctness — but credit requires a genuine attempt; blank or clearly-unattempted answers earn no credit. Work through it with your partner and say what you actually think; a wrong idea you reasoned your way to is worth more here than a right one you copied.

📤 How to Submit

  1. Click "Save Progress" to ensure everything is stored
  2. Use Print: Ctrl+P (Windows) or Cmd+P (Mac)
  3. Choose "Save as PDF"
  4. Save as: module2_lastname1_lastname2.pdf
  5. Upload to your course management system

🎉 Great detective work! 🎉

You've learned to visually diagnose normality in R. In Module 3, you'll add statistical tests to your toolkit!