Statistics - Learn With Examples https://learnwithexamples.org/category/mathematics-and-statistics/statistics/ Lets Learn things the Easy Way Tue, 29 Sep 2026 09:07:01 +0000 en-US hourly 1 https://wordpress.org/?v=7.1.4 https://i0.wp.com/learnwithexamples.org/wp-content/uploads/2026/07/cropped-learnwithexamples-icon.png?fit=32%2C32&ssl=1 Statistics - Learn With Examples https://learnwithexamples.org/category/mathematics-and-statistics/statistics/ 32 32 228207193 Type I vs Type II Errors: False Alarms and Missed Signals https://learnwithexamples.org/type-i-vs-type-ii-errors/ https://learnwithexamples.org/type-i-vs-type-ii-errors/#respond Tue, 29 Sep 2026 09:06:59 +0000 https://learnwithexamples.org/?p=943 Hypothesis testing · Decisions under uncertainty Every test you have ever trusted can be wrong in exactly two ways. It can shout when nothing is happening, or it can stay…

The post Type I vs Type II Errors: False Alarms and Missed Signals appeared first on Learn With Examples.

]]>
Hypothesis testing · Decisions under uncertainty

Every test you have ever trusted can be wrong in exactly two ways. It can shout when nothing is happening, or it can stay silent when something is. Statisticians call these Type I and Type II errors, and once you see them clearly, you will start noticing them in smoke alarms, spam folders, courtrooms and hospital screenings.

Reading time: about 15 minutesLevel: beginner friendlyTopic: hypothesis testing

A story I tell every new analyst

Years ago I worked with a team that monitored server performance. They had an alert that fired whenever response time crossed a threshold. In the first month it fired forty times, and thirty-nine were nothing. By the second month, people stopped reading the messages. In the third month the one alert that mattered arrived, and it sat unread for two hours while a real outage grew.

That team had made both classic mistakes, one after the other. First they set the alarm too jumpy, which produced false alarms. Then, by training everyone to ignore it, they made real signals get missed. If you understand why that happened, you already understand the core of this article.

Here is the promise: by the end, you will be able to name each error, explain the trade-off between them, use the words alpha, beta and power without flinching, and decide which error matters more in a given situation. No advanced maths required. When the numbers do appear, I have computed them so you can follow along.

The idea of a null hypothesis in plain words

Before we can talk about errors, we need one setup idea. Almost every statistical test begins with a boring default assumption called the null hypothesis, written H0. It says “nothing is going on.” The new drug does nothing. The new web page converts no better than the old one. The coin is fair. The defendant is innocent.

Then you look at evidence and ask a single question: is this evidence surprising enough, under the assumption that nothing is going on, that I should stop believing it? If yes, you reject the null. If not, you fail to reject it, which is different from proving it true. It just means you did not find enough evidence.

The whole topic in two lines.

Type I error: you reject the null when it was actually true. A false alarm, or false positive.

Type II error: you fail to reject the null when it was actually false. A missed signal, or false negative.

The four possible outcomes

Any test ends in one of four situations, depending on what is true in reality and what the test says. Two are correct decisions and two are errors. The grid below is worth memorising.

What the test tells youKeep H0 (no signal found)Reject H0 (signal found)RealityNothingis going onSomethingis going onCorrectTrue negative. Calm day.Type I errorFalse alarm (false positive)Type II errorMissed signal (false negative)CorrectTrue positive. Real signal caught.
Reality on the left, the test’s verdict across the top. The two red and blue cells are the errors.

Look at how symmetrical the grid is, and how differently the errors feel. A false alarm is loud and visible: someone complains, someone investigates, someone wastes an afternoon. A missed signal is silent by nature. Nobody notices what did not happen. That imbalance in visibility is why people routinely underweight Type II errors.

The memory trick that actually works

Students confuse the two constantly, and honestly so did I in the beginning. The trick that finally fixed it for me is the boy who cried wolf.

  • The first time, he shouts “Wolf!” and there is no wolf. That is a false alarm: Type I. Type one, the first mistake in the story.
  • The second time, a real wolf shows up and the villagers ignore him. That is a missed signal: Type II. Type two, the second mistake.

The order in the fable matches the numbering. If you remember nothing else from this article, remember the wolf.

Alpha and beta: the two probabilities behind the errors

Each error has a probability with a Greek letter attached.

  • α (alpha) is the probability of a Type I error. It is also called the significance level, and you choose it before you look at the data. The most common choice is 0.05, meaning you accept a 5% false-alarm rate when nothing is really happening.
  • β (beta) is the probability of a Type II error, the chance you miss a real effect.
  • Power = 1 − β is the probability you catch a real effect. Researchers often aim for at least 80%.

Think of alpha as how easily you are fooled by noise, and power as how well you can hear a real signal. A good study keeps the first low and the second high.

Seeing the trade-off with two overlapping curves

Here is the picture I draw on whiteboards. There are two bell curves. The left one shows what your test statistic looks like when nothing is going on. The right one shows what it looks like when there is a real effect. You choose a cut-off: any result to the right of the line triggers the alarm.

decision cut-offNothing going onReal effect presentα = 5.0%β = 19.6%Red tail = false alarms (Type I). Blue tail = missed signals (Type II).
Moving the cut-off left or right changes both errors at once.

The red tail is the false-alarm zone. Even when nothing is going on, a small share of results land beyond the line, and with this cut-off that share is 5.0%. The blue tail is the missed-signal zone. When the effect is real, some results still fall short of the line, and here that is 19.6%.

Now imagine sliding the cut-off. Move it to the left, and you catch more real effects but raise more false alarms. Move it to the right, and false alarms shrink while you miss more real effects. You cannot push both down by sliding the line. This is the fundamental trade-off of hypothesis testing. Here are actual numbers for four cut-off positions on this same pair of curves.

Cut-off (z)False alarms (α)Missed (β)PowerCharacter
115.9%6.7%93.3%Very sensitive, cries wolf often
1.6455.0%19.6%80.4%The classic 5% setting
2.3261.0%43.1%56.9%Stricter, 1% false alarms
30.1%69.1%30.9%Very strict, misses more real effects

Read down the columns. As the cut-off rises, the false alarms fall from a wild figure to a tiny one, but the missed signals climb steadily. There is no free lunch. The only question is which mistake you can better afford.

Which error is worse? It depends on the stakes

This is the part that separates textbook knowledge from professional judgment. There is no universal answer; the answer depends on what each mistake costs. Tap through five situations below.

Courtroom

The null hypothesis is “the defendant is innocent.” The jury either convicts (rejects H0) or acquits (keeps H0).

Type IConvict innocent
Type IIFree the guilty
GuardedType I
Trade-offHigh bar

What it means. A Type I error here is convicting an innocent person, and the legal system deliberately builds walls against it: presumption of innocence, proof beyond reasonable doubt, unanimous juries. The price is that some guilty people go free (Type II). Societies choose which error hurts more, and courts choose to tolerate more Type II to avoid Type I.

Smoke alarm

The null hypothesis is “there is no fire.” The alarm sounds (rejects H0) or stays silent.

Type IBurnt toast alarm
Type IISilent during fire
GuardedType II
Trade-offSensitive

What it means. A false alarm (Type I) is annoying: burnt toast, a wasted evacuation. A missed fire (Type II) can be fatal. So alarm designers accept many false alarms to make sure real fires are almost never missed. The cut-off is set to be jumpy on purpose.

Medical screening

A screening test for a condition affecting 2% of people, with 90% sensitivity and 95% specificity, is used on 10,000 people.

False alarms490
Missed cases20
Caught180
Positive is real27%

What it means. Of 670 positive results, only 180 are real, about 27%, while 20 real cases slip through. Screening programs accept a fair number of false alarms because a follow-up test can clear them, whereas a missed case might not be found in time.

Spam filter

The null hypothesis is “this email is legitimate.” The filter flags it as spam (rejects H0) or delivers it.

Type IReal mail lost
Type IISpam in inbox
GuardedType I
Trade-offCautious

What it means. A Type I error is a real email, maybe a job offer or an invoice, landing in spam. A Type II error is a junk email in the inbox. Most people forgive the second far more easily than the first, so filters are tuned to let some junk through rather than to lose real messages.

A/B test

You test a new checkout page. H0 says it does no better than the old one. Suppose you collect 100 orders and need 5% false-alarm protection.

Cut-off≥59 of 100
Type I4.4%
Power62%
Type II38%

What it means. The rule is to declare the new page better only if you see at least 59 wins in 100 comparisons when a fair coin would give 50. That keeps false alarms at 4.4%. If the new page truly wins 60% of the time, this test detects it only 62% of the time, so 38% of the time you would miss a real improvement. More data raises power without raising false alarms.

Notice the pattern. Courts guard hard against Type I errors (convicting the innocent). Smoke alarms guard hard against Type II errors (missing a fire). Spam filters lean cautious about Type I errors (losing real mail). Screening programs accept lots of false alarms to avoid misses. In every case the threshold is a moral and practical choice wearing the costume of a number.

A closer look at medical screening

Medical tests give the clearest illustration of why false alarms are common even when a test is good. Suppose a condition affects 2% of a population. A screening test correctly flags 90% of people who have it (sensitivity) and correctly clears 95% of people who do not (specificity). Sounds excellent. Now screen 10,000 people.

  • 200 people have the condition. The test catches 180 and misses 20 (Type II errors).
  • 9,800 people are healthy. The test wrongly flags 490 of them (Type I errors) and correctly clears 9310.
Who gets a positive result? (10,000 people screened)180 real cases490 false alarms (Type I)Not shown: 20 real cases the test missed (Type II)Assumes 2% prevalence, 90% sensitivity, 95% specificity
Among positive results, false alarms outnumber real cases when the condition is rare.

That gives 670 positive results, of which only 180 are real. If you get a positive result, the chance you actually have the condition is about 27%. This surprises almost everyone. It does not mean the test is bad. It means the condition is rare, so even a small false-alarm rate produces a big pile of false alarms in absolute terms. This is why doctors follow up screening with a second, more specific test, and why a single positive result is a reason to investigate rather than a diagnosis.

How to reduce both errors: more data

If moving the cut-off only swaps one error for another, how do you get better on both? The answer is to sharpen the picture itself. A larger sample makes the two bell curves narrower, so they overlap less. With less overlap, you can hold false alarms at 5% and still catch far more real effects.

Here is a concrete illustration. Suppose a real effect exists that is about 0.3 standard deviations in size, which is modest. With a one-sided test at α = 5%, power grows with sample size like this.

Sample sizePowerChance of missing it (β)
1024.3%75.7%
2544.2%55.8%
5068.3%31.7%
7583.0%17.0%
10091.2%8.8%
15097.9%2.1%
20099.5%0.5%
80% power target10501001502000%50%100%n = 69 reaches 80%Sample size (effect = 0.3 standard deviations, α = 5%, one-sided)
Power climbs with sample size. In this scenario, about 69 observations are needed to reach the standard 80% target.

A study with 10 subjects has a small chance of detecting this effect at all, and its “no significant difference” result would be nearly meaningless. It tells you the study was too small, not that the effect is absent. This is one of the most common misreadings of research: treating a failure to find something as proof that nothing is there.

Other ways to raise power include reducing noise in the measurements, using a more precise instrument, comparing matched pairs instead of independent groups, and looking for larger effects. Statisticians call planning this before a study “a power analysis,” and it is one of the cheapest ways to avoid wasting a research budget.

A worked example: the A/B test

Let me show you the numbers in a familiar business setting. You redesign your checkout page and compare it against the old one across 100 head-to-head comparisons. Under the null hypothesis, the new page is no better, so each comparison is like a fair coin flip and you would expect about 50 wins.

You decide in advance that you want no more than a 5% false-alarm rate. Working through the exact binomial probabilities, that means you declare the new page better only if it wins at least 59 of 100. Under a fair coin, the chance of hitting that bar by luck is 4.4%. That is your effective Type I error rate.

Now suppose the new page really is better and wins 60% of the time. How often would this test detect that? Only about 62% of the time. The other 38% of the time you would return “no significant difference” and shelve a page that really was better. That is a Type II error, and it is expensive because nobody ever finds out about the money that was left on the table.

The fix is not to loosen alpha. It is to collect more comparisons. If you had 400 comparisons instead of 100, the same 60% effect would be detected far more often while the false-alarm rate stays at 5%.

The multiple-testing trap: false alarms pile up

Here is a hazard that catches even experienced people. An alpha of 5% sounds low. But it applies to each test separately. If you run many tests on data where nothing is truly going on, the chance of at least one false alarm grows fast.

Tests runChance of at least one false alarm
15.0%
522.6%
1040.1%
2064.2%
5092.3%
5%1 test23%5 tests40%10 tests64%20 tests92%50 tests
With nothing real to find, more tests means more false alarms.

Run 20 tests and you have a 64% chance of at least one “significant” result by pure luck. Run 50 and it is 92%. This is the mathematical heart of “p-hacking”: slicing the data many ways until something looks significant. It is also why a marketing dashboard with forty metrics will always show a few “winners.” The remedy is to decide your hypotheses in advance, limit the number of comparisons, or adjust the threshold using methods such as the Bonferroni correction, which divides alpha by the number of tests.

What the p-value has to do with all this

The p-value is the probability of seeing data at least as extreme as yours, assuming the null hypothesis is true. You compare it with your pre-chosen alpha: if p is below alpha, you reject the null. The p-value itself is not the probability that the null is true, and it is not the probability that you made an error on this particular test. The false-alarm rate belongs to the procedure across many uses, and alpha sets it.

A quick way to hold both ideas: alpha is the standard you set before the race; the p-value is the time you actually ran.

Real-world places these errors hide

Airport security

A false alarm stops a traveller for a bag check. A missed threat is catastrophic. Systems lean toward false alarms.

Fraud detection

Blocking a genuine card purchase annoys a customer (Type I). Missing a real theft costs money (Type II).

Drug trials

Approving a useless drug is a Type I error. Rejecting a useful one is Type II, and patients lose out.

Hiring tests

Rejecting a good candidate is a Type II error. Hiring a poor one is Type I, if “good enough” is the null.

One more subtlety worth knowing: which error is called “Type I” depends on how you phrase the null hypothesis. If you flip the null and alternative, the labels flip. In practice, the null is the cautious default, and you should always state it out loud before you decide what each error means.

Six mistakes I keep seeing (tap to open)

1. Reading “not significant” as “no effect”

A non-significant result may simply reflect a small sample or noisy data. It means you did not find enough evidence, not that the effect is zero. Check the power.

2. Treating 5% as a law of nature

Alpha of 0.05 is a convention. In particle physics the standard is far stricter, and in early-stage screening a looser threshold can be sensible. Pick it based on the cost of each error.

3. Optimising one error and forgetting the other

Making a test extremely strict drives Type I errors near zero while Type II errors soar. A perfectly cautious test can be perfectly useless.

4. Running many tests and reporting the winners

Without a correction, false alarms accumulate. Decide the questions first, or adjust your threshold.

5. Mixing up the p-value with the error rate

The p-value belongs to the data you observed. Alpha is the false-alarm rate you are designing into the procedure.

6. Ignoring base rates

When the thing you are hunting is rare, even a low false-alarm rate produces more false alarms than real detections. The screening example shows how.

Quick quiz: test yourself

Tap each question to reveal the answer and its reasoning.

A pregnancy test says “not pregnant” but the person is pregnant. What kind of error is this?
  1. Type I
  2. Type II
  3. Both
  4. Neither

The null is “not pregnant.” Keeping it when it is false is a missed signal, a Type II error.

A fire alarm sounds because of burnt toast. Which error?
  1. Type I (false alarm)
  2. Type II (missed signal)
  3. Correct decision
  4. Power

Rejecting a true null (“no fire”) is a Type I error.

Which change lowers the chance of a Type II error without raising the Type I rate?
  1. Lowering the significance level
  2. Using a stricter cut-off
  3. Collecting a larger sample
  4. Ignoring the data

A larger sample sharpens the picture, raising power (1 − β) while α stays fixed.

If β = 0.20, what is the power of the test?
  1. 0.05
  2. 0.20
  3. 0.95
  4. 0.80

Power = 1 − β = 0.80.

You run 20 independent tests at α = 0.05 when nothing is real. About how likely is at least one false alarm?
  1. 5%
  2. About 64%
  3. 20%
  4. 100%

1 − 0.9520 = 64%. False alarms accumulate quickly across many tests.

Frequently asked questions

What is the difference between Type I and Type II errors?

A Type I error is a false positive: you reject a null hypothesis that is actually true. A Type II error is a false negative: you fail to reject a null hypothesis that is actually false.

How do I remember which is which?

Think of the boy who cried wolf. The first time he cried wolf with no wolf, that was a Type I error, a false alarm. The second time, when the wolf was real and nobody believed him, that was a Type II error, a missed signal.

What is the significance level (alpha)?

Alpha is the probability of a Type I error that you are willing to accept, commonly 5%. It is set before you look at the data.

What is statistical power?

Power is the probability of detecting a real effect, equal to 1 minus the probability of a Type II error. Researchers often aim for 80% power or more.

Can I reduce both errors at once?

Yes, by collecting more data or by reducing noise in your measurements. For a fixed sample, lowering one error raises the other.

Is the p-value the probability of a Type I error?

Not exactly. The p-value is the probability of seeing data at least this extreme if the null were true. Alpha, chosen in advance, is the false-alarm rate the procedure is designed to have.

The takeaway

A Type I error is a false alarm, a Type II error is a missed signal, and every real-world test trades one against the other. Decide which mistake costs more, set the threshold accordingly, and collect enough data that you are not forced to choose between two bad options.

Next time somebody proudly announces a “statistically significant” result, or a “no significant difference,” ask two questions: how many false alarms could this procedure produce, and how likely was it to catch a real effect in the first place?

Type I errorType II errorfalse positivefalse negativestatistical powerhypothesis testing

The post Type I vs Type II Errors: False Alarms and Missed Signals appeared first on Learn With Examples.

]]>
https://learnwithexamples.org/type-i-vs-type-ii-errors/feed/ 0 943
Range, IQR and Quartiles Explained https://learnwithexamples.org/range-iqr-and-quartiles-explained/ https://learnwithexamples.org/range-iqr-and-quartiles-explained/#respond Tue, 29 Sep 2026 08:55:49 +0000 https://learnwithexamples.org/?p=939 Descriptive statistics · Spread · Box plots Two classes can share the same average and the same highest and lowest scores, and still be completely different places to teach. One…

The post Range, IQR and Quartiles Explained appeared first on Learn With Examples.

]]>
Descriptive statistics · Spread · Box plots

Two classes can share the same average and the same highest and lowest scores, and still be completely different places to teach. One is a tight pack, the other is scattered from top to bottom. Range, quartiles and the interquartile range (IQR) are the three tools that let you tell those classes apart, and they take about ten minutes to learn properly.

Reading time: about 15 minutesLevel: beginner to intermediateYou only need a pencil

The problem with “the average”

I have reviewed reports for a long time, and the sentence that worries me most is: “the average delivery time is 27 minutes.” It sounds precise. But is every delivery close to 27, or do half arrive in 15 and the rest take 40? The average cannot tell you. It describes the centre of your data and says nothing about how spread out the values are.

Spread matters in daily life more than most people realise. A commute that averages 35 minutes but sometimes takes 75 makes you leave early. A salary band with an average of ₹67k that is really one founder and eight employees makes the average meaningless. A medicine that lowers blood pressure by 10 points on average but by 40 for some people and zero for others deserves a very different conversation.

So we describe data with two questions: where is the middle, and how far apart are the values? This article is about the second question, with the simplest measure first (range), the smarter measure next (IQR), and the quartiles that connect them.

The three ideas in one glance.

Range = biggest − smallest. Quartiles split sorted data into four equal-sized groups (Q1, Q2 = median, Q3). IQR = Q3 − Q1, the width of the middle half of your data.

Range: the quick, blunt measure

The range is the easiest statistic in the book. Sort the data, subtract the smallest from the largest, done. If eleven students score 52, 58, 61, 64, 67, 70, 72, 75, 78, 84 and 95, the range is 95 − 52 = 43 marks.

The range has real virtues. It is instant to compute, easy to explain to anyone, and good for sanity checks: a thermometer reading range of 200 degrees in one day tells you a sensor is broken. Many everyday questions are really range questions: “What is the cheapest and the most expensive flight?” “What are the coldest and hottest days this week?”

But the range has one serious flaw. It uses only two numbers, and they are the two most extreme ones. Everything in between is ignored. Change one value in the middle and the range does not budge. Change one extreme value and the range can explode. That makes it fragile.

Picture ten homes in a neighbourhood priced between ₹38 lakh and ₹64 lakh. Now a farmhouse worth ₹410 lakh sells at the edge of town. The range leaps from about 26 lakh to 372 lakh, even though nothing changed for the other nine families. That is exactly the situation where we need something sturdier.

Quartiles: cutting your data into four equal groups

You already know the idea from the median: line the data up in order and split it in half. Quartiles take that one step further and split the ordered data into four groups with (about) the same number of values in each.

  • Q1 (first quartile, the 25th percentile): a quarter of the data sits at or below it.
  • Q2 (second quartile): this is simply the median, with half the data on either side.
  • Q3 (third quartile, the 75th percentile): three quarters of the data sits at or below it.

Here is a small example you can see rather than imagine. Twelve colleagues report their commute times in minutes. The dots are sorted, and colours mark the four groups of three.

15253545556575Commute time in minutes222527303235384145505875Q1 = 28.5Median = 36.5Q3 = 47.5
Twelve commute times, split into four equal groups by Q1, the median, and Q3.

Notice that quartiles are not fancy. They are just three cut-points that make four equal piles. Q1 is 28.5, the median is 36.5, and Q3 is 47.5 minutes. A quarter of people commute 28.5 minutes or less, half commute 36.5 or less, and three quarters commute 47.5 or less.

How to find quartiles by hand, step by step

Let me walk through the method most textbooks teach, using the eleven exam scores. This is the one I recommend learning first because you can do it on paper without any software.

Step 1: Sort the data

52, 58, 61, 64, 67, 70, 72, 75, 78, 84, 95. Always sort first. Skipping this step is the most common way to get a wrong answer.

Step 2: Find the median (Q2)

There are 11 values, so the middle one is the 6th: 70. Five values sit on each side.

Step 3: Find the median of the lower half (Q1)

The lower half is 52, 58, 61, 64, 67. Its middle value is 61. That is Q1.

Step 4: Find the median of the upper half (Q3)

The upper half is 72, 75, 78, 84, 95. Its middle value is 78. That is Q3.

Step 5: Subtract to get the IQR

IQR = Q3 − Q1 = 78 − 61 = 17. So the middle half of the class scored within a 17-mark window, even though the full range is 43.

5060708090100Exam score (out of 100)Q1 61Median 70Q3 78Exam scores of 11 students
A box plot of the eleven exam scores. The box runs from Q1 to Q3 and the orange line marks the median.

What about an even number of values?

With 12 commute times, there is no single middle value, so the median is the average of the 6th and 7th values. Then you split the data cleanly into two halves of six and find the median of each. The lower half is 22, 25, 27, 30, 32, 35, and its median is (27 + 30) / 2 = 28.5. The upper half is 38, 41, 45, 50, 58, 75, and its median is (45 + 50) / 2 = 47.5. That is where Q1 = 28.5 and Q3 = 47.5 came from. No mystery.

Why your calculator and Excel sometimes disagree

Here is something nobody warns you about. If you compute quartiles in Excel and compare with the textbook, you may get a slightly different answer. That does not mean anyone made a mistake. There are several accepted methods for defining quartiles, and they agree on large data but can differ on small datasets. Here is the same exam data run through three common methods.

MethodQ1Q3IQR
Median of halves (Tukey / most textbooks)617817
Inclusive, (n − 1)p, Excel QUARTILE.INC and NumPy default62.576.514
Exclusive, (n + 1)p, Excel QUARTILE.EXC617817

And for the twelve commute times:

MethodQ1Q3IQR
Median of halves28.547.519
Inclusive29.2546.2517
Exclusive27.7548.7521

The answers differ by a point or two. In real analysis with hundreds of records, the difference is negligible. In an exam, follow the method your teacher uses. In a report, mention which method your software uses, or just stay consistent. I once saw a two-hour argument between two analysts who were both correct, using different quartile definitions. Do not be those two.

The five-number summary

Once you have quartiles, you can describe any dataset with just five numbers: minimum, Q1, median, Q3 and maximum. It is called the five-number summary, and it is the backbone of the box plot.

DatasetMinQ1MedianQ3Max
Exam scores5261707895
Commute minutes2228.536.547.575
House prices (lakh)38455160410
Startup pay (₹k)28313643.5320
Delivery minutes182226.53152

Five numbers, and you already know where the centre is, how wide the middle half is, and how far the extremes reach. That is a lot of information in one row.

Same range, very different classes

Now the payoff. Here are two classes of ten students. Both have a lowest score of 45 and a highest of 95. Both have a range of 50. Any teacher looking only at the range would say the classes look identical.

405060708090100Test scoreClass XClass Y
Class X and Class Y share the same range, but their boxes are very different widths.

Class X has an IQR of only 6. Most students scored between 62 and 68, with two students far away at the edges. Class Y has an IQR of 25, with scores spread evenly from 55 to 80 in the middle half. Same range, wildly different teaching challenges. In Class X you teach to the pack and support two outliers. In Class Y you need differentiated instruction across the whole room.

This is why I say the IQR is often the honest sibling of the range. It answers “how spread out are the typical values?” rather than “how far apart are the two weirdest values?”

Outliers and the 1.5 × IQR rule

The IQR does a second job that I use constantly: it gives you a fair way to flag unusual values. The statistician John Tukey proposed a simple rule that is now standard in box plots.

Lower fence = Q1 − 1.5 × IQR     Upper fence = Q3 + 1.5 × IQRvalues outside the fences are flagged as potential outliers

For the exam scores, the fences are 35.5 and 103.5, so nobody is unusual. Now look at the startup where nine people earn between 28 and 45 (thousand rupees a month) and the founder takes 320.

050100150200250300350Monthly pay, in thousand rupeesQ1 31Median 36Q3 43.5Startup team pay (9 people)
Monthly pay at a nine-person startup. The orange dot beyond the upper fence is the founder.

The upper fence is 62.25, so 320 is flagged. Two things are worth noticing. The mean pay is 67.2, higher than eight of the nine people, so the average paints a false picture. The median is 36, which is far more representative. And the IQR of 12.5 describes the spread among typical employees, uninfluenced by the founder. Whenever a dataset has one or two giant values, the median and the IQR should be your default pair.

A word of caution I give every junior analyst: an outlier flag is a prompt to investigate, not a permission slip to delete. It might be an error (someone typed 410 instead of 41), or it might be the most important data point you have. Look before you remove.

Range versus IQR on the same datasets

To see the difference at a glance, here are four datasets used in this article, each with its range (orange) and IQR (navy).

Exam scoresrange 43IQR 17Commutesrange 53IQR 19House pricesrange 372IQR 15Salariesrange 292IQR 12.5
Range and IQR side by side. Notice how much the range inflates when a single extreme value appears.

For exam scores and commute times the two measures are in the same neighbourhood. For house prices and startup pay, the range towers over the IQR because of one extreme value. That gap is itself a diagnostic: when the range is many times bigger than the IQR, you almost certainly have outliers or heavy skew.

Five real cases to explore

Tap a tab below. Each example uses actual numbers I ran through the method, with the sorted data shown so you can check my work by hand.

Exam scores

Eleven students sit a test. Sorted data: 52, 58, 61, 64, 67, 70, 72, 75, 78, 84, 95.

Range43
Q1 · Q361 · 78
IQR17
Outliersnone

What it tells you. The lowest score is 52 and the highest 95, so the range is 43. The median is 70. Q1 is 61 and Q3 is 78, so the IQR is 17. The middle half of the class is packed into a 17-mark band, while one high scorer stretches the range. Fences: 35.5 to 103.5, so nobody is flagged as an outlier.

Commute times

Twelve colleagues report their door-to-door commute. Sorted data: 22, 25, 27, 30, 32, 35, 38, 41, 45, 50, 58, 75.

Range53
Q1 · Q328.5 · 47.5
IQR19
Outliersnone

What it tells you. The range is 53 minutes, but the IQR is only 19. The median is 36.5. The upper fence is 76, so a 75-minute commute is long but not an outlier. When you tell a new hire “most people travel between 28.5 and 47.5 minutes,” you are quoting the IQR.

House prices

Ten homes sold in one neighbourhood, prices in lakh rupees. One is a large farmhouse. Sorted data: 38, 42, 45, 48, 50, 52, 55, 60, 64, 410.

Range372
Q1 · Q345 · 60
IQR15
Outliers410

What it tells you. The range is 372 lakh, driven entirely by the farmhouse at 410. The IQR is just 15. The fences are 22.5 and 82.5, so 410 is flagged as an outlier. Quoting the range would make the market look wildly unpredictable. The IQR tells you what a typical buyer will actually see.

Startup pay

Nine people work at a small startup, monthly pay in thousand rupees. The founder is on the far right. Sorted data: 28, 30, 32, 34, 36, 38, 42, 45, 320.

Range292
Q1 · Q331 · 43.5
IQR12.5
Outliers320

What it tells you. The range is 292, the IQR is 12.5. The median is 36, so half of the team earns 36 or less. The founder’s 320 is far beyond the upper fence of 62.25. Averages and ranges get dragged by a single big number, but quartiles barely notice.

Delivery times

Fourteen food orders are timed from kitchen to door. Sorted data: 18, 20, 21, 22, 24, 25, 26, 27, 28, 30, 31, 33, 36, 52.

Range34
Q1 · Q322 · 31
IQR9
Outliers52

What it tells you. The median delivery took 26.5 minutes and the IQR was 9. The upper fence is 44.5, so the 52-minute order is flagged as an outlier. A restaurant manager can promise “22 to 31 minutes for most orders” and investigate the slowest one separately.

In every tab, the same routine applies: sort, find the median, find the halves’ medians, subtract, check the fences. Learn the routine once and you can use it on any list of numbers, from test marks to server response times.

Reading a box plot like a professional

A box plot squeezes the five-number summary into a picture. Once you know the anatomy, you can read one at a glance.

  • The box spans Q1 to Q3, so its width is the IQR. A wide box means a wide spread among typical values.
  • The line inside is the median. If it is off-centre in the box, the data is skewed.
  • The whiskers reach the smallest and largest values that are still inside the fences.
  • The dots beyond the whiskers are the flagged outliers.

Two extra reading tips. If the median sits close to Q1 and the upper whisker is long, the data is skewed to the right, as with incomes or house prices. And when you compare several box plots, look at the boxes first and the whiskers second. The boxes tell you about typical performance, and the whiskers tell you about extremes.

Where these measures show up in real life

Salary bands

Recruiters quote the 25th to 75th percentile pay range for a role. That is Q1 to Q3.

Service promises

Delivery and support teams report the median and the 75th percentile, not just the average.

Growth charts

Paediatric charts use percentiles. A child at the 25th percentile of height is at Q1 for their age.

Quality control

Engineers use the IQR to detect sensor readings or parts that are far outside the normal spread.

In finance, the middle 50% of returns or prices is often more informative than the extremes. In education, admissions offices publish the middle 50% of test scores for admitted students. In sports analytics, a player’s IQR of scores describes consistency: a wide IQR means unpredictable, a narrow one means reliable.

Range, IQR or standard deviation?

You will sometimes be asked which measure of spread to use. Here is my rule of thumb after years of picking wrongly and correcting myself.

  • Use the range for quick checks, small datasets and situations where the extremes themselves matter, such as safety limits.
  • Use the IQR with the median when the data is skewed or contains outliers: incomes, prices, response times, hospital stays.
  • Use the standard deviation with the mean when the data is roughly symmetric and you plan further statistical work.

None of these is universally best. Each answers a slightly different question, and reporting two of them together, such as the median and the IQR, usually gives a fair picture.

Seven mistakes I see all the time (tap to open)

1. Forgetting to sort the data first

Quartiles depend on order. If you pick the “middle” of an unsorted list, you are just picking a random value.

2. Reporting the range as if it describes typical spread

The range describes the extremes only. For typical spread use the IQR.

3. Including the median in both halves inconsistently

With an odd number of values, decide up front whether the median is left out of the halves, and stay consistent. Most textbooks leave it out.

4. Assuming Excel and your textbook must agree

Different quartile definitions exist. Small differences are normal, especially with few values.

5. Deleting outliers automatically

Flagged values are a prompt to investigate. They may be errors, or they may be exactly the story.

6. Confusing IQR with the range of the middle

The IQR is Q3 minus Q1, not the difference between the 2nd and 3rd smallest values. It is defined by the quartiles.

7. Comparing IQRs across different units

An IQR of 15 minutes and an IQR of 15 kilos cannot be compared. To compare relative spread, divide by the median or use another scale-free measure.

Quick quiz: test yourself

Tap each question to reveal the answer and the working.

Data: 4, 7, 9, 12, 15, 18, 20, 23. What is the range?
  1. 16
  2. 19
  3. 23
  4. 12

Range = maximum − minimum = 23 − 4 = 19.

For the same data, what is the median?
  1. 9
  2. 15
  3. 13.5
  4. 12

Eight values, so the median is the average of the 4th and 5th: (12 + 15) / 2 = 13.5.

For the same data (median of halves), what is the IQR?
  1. 11
  2. 19
  3. 8
  4. 13.5

Lower half 4, 7, 9, 12 has median 8. Upper half 15, 18, 20, 23 has median 19. IQR = 19 − 8 = 11.

Q1 = 20 and Q3 = 30. What upper fence flags outliers?
  1. 35
  2. 40
  3. 45
  4. 50

IQR = 10. Upper fence = Q3 + 1.5 × IQR = 30 + 15 = 45. Anything above 45 is flagged.

Why is the IQR preferred to the range for skewed data with extreme values?
  1. It is easier to spell
  2. It uses every value
  3. It is always larger
  4. It ignores the extreme 25% at each end

The IQR looks only at the middle half of the data, so a single extreme value cannot distort it.

Frequently asked questions

What is the difference between range and IQR?

The range is the maximum minus the minimum, so it depends entirely on the two most extreme values. The IQR is Q3 minus Q1, the spread of the middle 50% of the data, so it is far more stable.

How do I find quartiles by hand?

Sort the data, find the median (Q2), then find the median of the lower half (Q1) and the median of the upper half (Q3). With an odd number of values, textbooks differ on whether the median belongs in the halves, so check what your course expects.

Why does Excel give different quartiles from my textbook?

Several valid quartile methods exist. Excel’s QUARTILE.INC and NumPy interpolate using (n − 1)p, QUARTILE.EXC uses (n + 1)p, and many textbooks use the median of halves. For small datasets they can differ slightly.

What is the 1.5 × IQR rule?

A common rule of thumb from John Tukey: values below Q1 − 1.5 × IQR or above Q3 + 1.5 × IQR are flagged as potential outliers. It is a flag for a closer look, not proof that a value is wrong.

What does a box plot show?

The box runs from Q1 to Q3 with a line at the median. The whiskers reach the most extreme values inside the fences, and dots beyond them are potential outliers.

When should I use standard deviation instead of IQR?

Use standard deviation for roughly symmetric data without extreme outliers, especially when you plan further calculations. Use the IQR with the median for skewed data or data with outliers.

The takeaway

The range tells you how far the extremes stretch. The quartiles tell you how the data is arranged in between. The IQR tells you how wide the middle half is, and it does so without being pulled around by extreme values. Sort, split, subtract, and check the fences.

Next time somebody quotes an average and a range and stops there, ask for the median and the IQR. You will understand the data better than most people in the room.

rangeinterquartile rangequartilesbox plotoutliersdescriptive statistics

The post Range, IQR and Quartiles Explained appeared first on Learn With Examples.

]]>
https://learnwithexamples.org/range-iqr-and-quartiles-explained/feed/ 0 939
Correlation vs Causation — Explained with Real Studies https://learnwithexamples.org/correlation-vs-causation/ https://learnwithexamples.org/correlation-vs-causation/#respond Tue, 04 Aug 2026 17:46:49 +0000 https://learnwithexamples.org/?p=853 Learn With Examples Two things moving together is a fact. One thing causing the other is a claim. The gap between them has produced bad headlines, wasted billions in research…

The post Correlation vs Causation — Explained with Real Studies appeared first on Learn With Examples.

]]>

Learn With Examples

Two things moving together is a fact. One thing causing the other is a claim. The gap between them has produced bad headlines, wasted billions in research money, and in a few famous cases, medical advice that actively harmed people.

Reading time13 min
LevelBeginner friendly
Includes5 real studies

In the 1990s, if you were a woman approaching menopause, your doctor may well have suggested hormone replacement therapy — not only for menopausal symptoms, but to protect your heart. The evidence looked strong. Large, careful observational studies following tens of thousands of nurses found that women taking HRT had substantially less coronary heart disease than women who didn’t.

Then, in 2002, a large randomised trial tested it properly. The heart protection wasn’t there. In the group studied, the therapy was associated with increased risks rather than reduced ones, and the trial arm was stopped early.

What went wrong? Nothing, statistically. The correlation was real. Women on HRT genuinely did have fewer heart attacks. But they were also, on average, wealthier, better educated, more likely to exercise, and more likely to see a doctor regularly. The therapy wasn’t protecting their hearts. Their circumstances were — and those same circumstances made them more likely to be prescribed HRT in the first place.

That’s the entire subject of this article, in one real example. Correlation is a measurement. Causation is an explanation. And the distance between them is where most misleading science reporting lives.

The core distinction

Two sentences that are not the same

Correlation: when one thing changes, another tends to change too. It’s an observation about patterns in data. It can be measured, quantified, and it’s often perfectly real.

Causation: changing the first thing makes the second thing change. It’s a claim about mechanism — and it requires far more evidence than a pattern.

Every correlation has at least four possible explanations, and only one of them is “A causes B”. The skill worth building is naming the other three.

First, what correlation actually measures

Correlation is usually expressed as a number between −1 and +1, written r. It tells you two things: the direction of the relationship and how tightly the points cluster around it. It tells you nothing whatsoever about why.

r = 0.0No relationship
r = 0.45Weak / noisy
r = 0.92Strong positive
r = -0.85Strong negative

Two properties matter here. First, a strong correlation is not stronger evidence of causation than a weak one — it’s just a tighter pattern. An r of 0.95 between two unrelated things is still a coincidence, merely a tidier-looking one. Second, correlation as usually measured only detects straight-line relationships. A real, powerful, curved relationship can produce an r near zero.

The number that fooled everyone. In 2012, a paper in a major medical journal noted that a country’s chocolate consumption correlated with its number of Nobel laureates per capita at roughly r = 0.79 — a strikingly strong figure. The author intended it partly as a joke about exactly this problem. It was reported widely and sincerely anyway. National wealth explains both: rich countries buy more chocolate and fund more research.

The five explanations for any correlation

When you see “X is linked to Y”, these are the candidates. Tap through them — each has a real example attached, and getting fluent in the list is most of the skill.

Why might two things move together?

tap an explanation
Pure chance

Coincidence

Compare enough variables and some will line up beautifully by luck alone. This isn’t a rare accident — it’s a mathematical certainty. Test a thousand random pairs at the usual significance threshold and roughly fifty will look “significant” with nothing behind them.

Real example: a 2000 paper in a teaching journal cheerfully demonstrated a statistically significant correlation between stork populations and human birth rates across European countries. The point was satire, and the mechanism is mundane: larger countries have more storks and more babies.

How to spot it: ask whether anyone predicted this relationship before looking. A pattern found by trawling data needs replication in fresh data before it means anything.

Most common culprit

A third variable (confounding)

Something else drives both. This is the explanation behind the majority of misleading health and social science headlines, and it’s the reason the HRT story went wrong.

Real example: a 1999 study reported that infants who slept with a night light were far more likely to become short-sighted. It made headlines worldwide. Follow-up studies the next year found the association vanished once parental short-sightedness was accounted for. Short-sighted parents were both more likely to use night lights and more likely to pass on the genes. The light was innocent.

How to spot it: ask who ends up in each group and why. If the groups differ in ways other than the thing being studied, the third variable is probably doing the work.

Backwards

Reverse causation

The arrow points the other way. B causes A, not A causes B — and in cross-sectional data, both look identical.

Real example: studies repeatedly find that people who skip breakfast weigh more, which produced years of “eat breakfast to lose weight” advice. When researchers actually randomised people to eat or skip breakfast, weight outcomes barely differed. A plausible reading is partly reverse: people already trying to lose weight skip meals.

Another: patients treated in hospital die at higher rates than people who stay home. Hospitals are not the danger — being seriously ill sends you there.

How to spot it: ask which came first. If the data can’t tell you, neither can the headline.

Who got counted

Selection bias

The relationship is an artefact of who ended up in the sample. Nothing is wrong with the analysis; the group being analysed was assembled in a skewed way.

Real example: the long-held belief that moderate drinking protects the heart rests heavily on comparisons with non-drinkers. But the “never drinks” group quietly includes people who stopped because they were already unwell — the “sick quitter” effect. Studies that separate lifelong abstainers from former drinkers, and genetic analyses that sidestep lifestyle entirely, find the protective effect largely disappears.

How to spot it: ask who is missing from the data, and why they’re missing.

Sometimes true

It really is causal

Sometimes A does cause B, and the correlation is the first clue. Dismissing every correlation is as lazy as accepting every one — the job is to work out which is which.

Real example: smoking and lung cancer. When the link emerged in the 1950s, sceptics argued exactly what this article argues: correlation isn’t causation, perhaps some genetic factor caused both the smoking habit and the cancer. That objection was answered not by one study but by a mountain of converging evidence — which is what real causal claims look like.

How to spot it: look for a dose-response pattern, a plausible mechanism, consistency across very different populations, and correct time ordering.

The question is never “is this correlation real?” It usually is. The question is “what else would produce this exact pattern?”

Five real studies, and what actually happened

These aren’t hypotheticals. Each is a case where a genuine correlation led somewhere — sometimes to a correction, once to a Nobel-worthy public health victory.

Case studies

tap a case
Confounding

Hormone therapy and heart disease

What observation suggestedLarge cohort studies through the 1980s and 90s found women on hormone replacement therapy had markedly less coronary heart disease. Guidelines and prescribing practice followed.
What the trial foundThe Women’s Health Initiative randomised trial, reported in 2002, found no cardiac protection. Risks in the studied population went the wrong way and the arm was halted early.

The lesson: the women taking HRT were healthier before they took anything — a pattern researchers now call the healthy-user effect. Careful statistical adjustment did not rescue the finding, because you can only adjust for confounders you thought to measure.

Confounding

Beta-carotene and lung cancer

What observation suggestedPeople eating diets rich in beta-carotene — carrots, leafy greens — had noticeably lower rates of lung cancer. Supplements looked like an obvious public health win.
What the trials foundTwo large randomised trials in the 1990s tested beta-carotene supplements in high-risk smokers. Lung cancer rates went up in the supplement groups, and one trial was stopped early.

The lesson: eating vegetables and swallowing an isolated compound are not the same intervention. The original correlation was probably tracking a whole dietary and lifestyle pattern, not the nutrient. This is one of the clearest cases where acting on a correlation caused measurable harm.

Confounding

Night lights and short-sightedness

What the 1999 study foundChildren who had slept with a night light or room light as infants were several times more likely to be short-sighted later. It was published in a top journal and reported around the world.
What followed in 2000Independent studies failed to replicate the effect once parental short-sightedness was included. Myopic parents were more likely to light the nursery — and more likely to pass on myopia.

The lesson: the fastest way to test a surprising finding is to ask what kind of household does the thing. Habits cluster with genetics, income and education, and any of those can be the real driver.

Selection bias

Moderate drinking and heart health

What decades of data suggestedA J-shaped curve: moderate drinkers appeared to have lower cardiovascular mortality than both heavy drinkers and non-drinkers. It became received wisdom, and a marketing gift.
What better methods suggestSeparating lifelong abstainers from people who quit for health reasons shrinks the benefit substantially. Genetic approaches, which avoid lifestyle confounding by design, find little support for a protective effect.

The lesson: the comparison group matters as much as the exposure group. If your baseline is quietly full of sick people, everything else looks healthy by contrast.

Genuinely causal

Smoking and lung cancer

The correlationStudies from the early 1950s, including a landmark study following British doctors for decades, found heavy smokers had dramatically elevated lung cancer rates.
Why it held upEnormous effect size, a clear dose-response gradient, risk falling after quitting, consistency across countries and study designs, animal and laboratory evidence, and an identified biological mechanism.

The lesson: this is the template for establishing causation without a randomised trial — you cannot ethically assign people to smoke. The criteria used to argue it, published in 1965, are still the standard checklist. Correlation was the starting point, not the conclusion.

Four corrections and one confirmation. That ratio is roughly what the history of nutritional and lifestyle epidemiology looks like — which is a good reason to treat single observational findings as questions rather than answers.

So how is causation established?

Not by one study. By methods that progressively strip away the alternative explanations. Here they are, weakest to strongest.

Anecdote
A story. Zero control over anything.
Cross-sectional
A snapshot. Can’t even establish which came first.
Cohort study
Follows people over time. Fixes time order, not confounding.
Natural experiment
Something outside the researcher’s control split the groups — a policy change, a lottery.
Randomised trial
Assignment by chance, so groups differ only by luck.
Replicated body of evidence
Many designs, many populations, one consistent answer.

Randomisation is the crucial step, and it’s worth understanding why it works. If you flip a coin to decide who gets the treatment, then income, diet, genetics, motivation and every other variable — including ones nobody has thought of — end up distributed roughly evenly between the groups. Statistical adjustment can only handle confounders you measured. Randomisation handles the ones you didn’t.

When you can’t randomise

You cannot assign people to smoke for thirty years, or to grow up poor. Researchers use other tools:

Natural experiments

A policy changes in one state and not its neighbour. Compare the two and the difference approximates a trial nobody ran.

Genetic approaches

Gene variants are allocated at conception, effectively at random. Comparing people by variant sidesteps lifestyle confounding — the method that undercut the drinking story.

Dose-response

If more exposure reliably means more effect, coincidence gets much harder to argue.

Triangulation

Several methods with different weaknesses pointing the same way. Each design’s blind spot is covered by another’s strength.

Reading a headline in thirty seconds

Six questions. You don’t need statistical training for any of them.

Ask thisWhy it mattersWarning sign
Trial or observation?Randomisation is what removes unknown confounders“Linked to”, “associated with”
Who is being compared?Groups may differ in a dozen unmeasured waysSelf-selected groups, volunteers
Could it run backwards?Reverse causation looks identical in a snapshotBoth measured at the same moment
Humans, and how many?Small or animal studies rarely justify adviceUnder a few hundred; mice
Relative or absolute risk?“Doubles your risk” can mean 1 in 100,000 to 2Percentages with no baseline
Has it replicated?A single striking finding is a hypothesis“New study finds”, “first evidence”

A quick vocabulary tell. Careful researchers write “associated with”, “linked to”, or “correlated with” precisely because they mean correlation. Headline writers then translate that into “causes”, “boosts”, “triggers” or “cures”. When the study says one thing and the headline says the other, trust the study — and notice that the gap is usually introduced after the science is finished.

Where this bites outside science

Business decisions

Customers using your new feature retain better — or your most committed customers were always the ones who tried new features.

Marketing spend

Ad spend correlates with sales. It also rises during the seasons when sales rise anyway. A holdout region tells you far more than a chart.

Education

Children in smaller classes score higher — and smaller classes cluster in wealthier districts with more of everything else.

Personal health

You started a supplement and felt better. So did the season, your sleep, and the illness that was ending anyway.

Check yourself

Five questions. Open each to check — the correct option is marked.

1. A study finds people who drink more coffee live longer. What’s the weakest conclusion to draw?
  • Coffee drinkers differ from non-drinkers in other ways
  • Coffee extends lifespan
  • The finding deserves a randomised test
  • Health may affect coffee habits, not the reverse

Observational data supports the association. The causal claim needs the alternatives ruled out first — and sick people often cut down on coffee, which is reverse causation.

2. In the night-light and myopia case, what was the third variable?
  • Screen time
  • Room size
  • Parental short-sightedness
  • The child’s age

Short-sighted parents were both more likely to use night lights and more likely to pass on myopia genetically. Account for the parents and the effect disappears.

3. Why does randomisation remove confounding so effectively?
  • It increases the sample size
  • It balances variables the researchers never even measured
  • It makes the correlation stronger
  • It removes measurement error

Statistical adjustment can only fix confounders you thought to record. Coin-flip assignment spreads the unknown ones evenly too.

4. “Hospital patients die more often than people at home.” What’s the flaw?
  • Coincidence
  • Reverse causation — illness sends people to hospital
  • The sample is too small
  • There’s no flaw

The arrow runs backwards. Being seriously ill causes hospital admission; the hospital didn’t cause the illness.

5. Why was smoking accepted as causing lung cancer without a randomised trial?
  • The correlation was very strong
  • A single large study settled it
  • Many independent lines of evidence converged — dose-response, mechanism, consistency, risk falling after quitting
  • Governments decided it

Strength alone was never sufficient — sceptics raised exactly the confounding objection. It was the convergence of many designs that closed the case.

Frequently asked questions

What is the difference between correlation and causation in simple terms?

Correlation means two things move together in the data. Causation means changing one actually produces a change in the other. Correlation is measured; causation is inferred, and it needs the alternative explanations ruled out first.

Can correlation ever prove causation?

Not on its own. But correlation plus dose-response, correct time ordering, a plausible mechanism, consistency across different populations and study designs, and preferably experimental evidence together can establish causation convincingly — as happened with smoking.

What is a confounding variable?

A third factor that influences both things being studied, creating a correlation between them that isn’t causal. Wealth confounds chocolate consumption and Nobel prizes; parental short-sightedness confounded night lights and myopia.

Why are randomised controlled trials considered the gold standard?

Because assignment by chance makes the groups comparable on everything, including factors nobody thought to measure. That’s the one thing statistical adjustment of observational data can never fully achieve.

Does “correlation is not causation” mean I should ignore observational studies?

No. Observational research is how most hypotheses start, and for many questions it’s the only ethical option. Treat a single observational finding as a good question rather than a settled answer, and give much more weight to results that replicate across different methods.

The takeaway

Correlation is a fact about data. Causation is a claim about the world. Moving from one to the other requires ruling out coincidence, third variables, reverse causation and selection bias — and the historical record shows how often that fails, even in careful hands, even in top journals.

The HRT story is worth keeping in mind precisely because nobody was careless. Good researchers, huge samples, real statistical rigour, and the answer was still wrong — because the women who took the therapy were different from the women who didn’t in ways the data never captured.

You don’t need to become a statistician. You need one reflex: when you read that X is linked to Y, pause and ask what else could produce that exact pattern. Usually you’ll think of something within about ten seconds. That reflex is worth more than any formula in this article.

correlation vs causationstatisticsconfoundingresearch methodscritical thinkingdata literacy

The post Correlation vs Causation — Explained with Real Studies appeared first on Learn With Examples.

]]>
https://learnwithexamples.org/correlation-vs-causation/feed/ 0 853
Outliers in Statistics — How to Detect, Handle and Never Ignore Them https://learnwithexamples.org/outliers-in-statistics/ https://learnwithexamples.org/outliers-in-statistics/#respond Thu, 16 Jul 2026 11:22:02 +0000 https://learnwithexamples.org/?p=754 Outliers in Statistics — How to Detect, Handle and Never Ignore Them Statistics · Mathematics One rogue data point can wreck an average, break a machine learning model, or hide…

The post Outliers in Statistics — How to Detect, Handle and Never Ignore Them appeared first on Learn With Examples.

]]>
Outliers in Statistics — How to Detect, Handle and Never Ignore Them

Statistics · Mathematics

One rogue data point can wreck an average, break a machine learning model, or hide a medical breakthrough. Outliers are the most misunderstood values in statistics — sometimes noise, sometimes the most important signal in your dataset. This guide shows you how to find them, what to do with them, and when removing them is actually the wrong call.

📖 18 min read 🔍 Interactive outlier detector 📊 Live dot plot and box plot 💻 Python code ❓ Quiz included

Section 01

What is an Outlier?

An outlier is a data point that lies far away from the rest of the observations in a dataset. It is a value that is unusually high or low compared to the typical range of the data.

Consider the salaries of five employees: £28k, £31k, £29k, £33k, £420k. That last value — £420k — is an outlier. It could be the CEO’s salary, a data entry error, or a completely different type of employee included by mistake. Each explanation calls for a different response.

Dot plot — spot the outlier

📌 No Universal Threshold

There is no single agreed-upon definition of “how far is too far.” Different detection methods use different thresholds. An outlier is always defined relative to the rest of the data and the context of the problem.

1.5×
IQR — the classic Tukey fence threshold for mild outliers
3×
IQR — extreme outlier threshold used in robust statistics
±3σ
Z-score threshold — only 0.27% of normal data falls beyond this
±2σ
Conservative threshold used in some clinical and quality contexts

Section 02

Why Outliers Matter — The Impact on Statistics

Outliers can have a dramatic or minimal effect depending on which statistical measure you use. The mean is highly sensitive. The median is almost immune. Understanding this asymmetry is one of the most practical skills in applied statistics.

Salary example — the CEO effect

A team of 10 employees. Nine earn between £28,000 and £35,000. One is the CEO earning £500,000.

Including CEO (outlier present)

£78,200
Mean salary — wildly misleading
Nobody actually earns near this figure

Median (resistant to outlier)

£31,000
Median salary — accurate picture
Reflects what most employees actually earn
StatisticSensitivity to OutliersWhy
MeanHighly sensitiveEvery value is used in the calculation — one extreme value pulls the result
MedianVery resistantOnly cares about position — outliers don’t change the middle value
ModeResistantOnly counts frequency — one extreme value rarely changes the most common
Standard DeviationHighly sensitiveSquared differences amplify the effect of values far from the mean
IQRVery resistantBased on middle 50% of data — outliers in the tails don’t affect it
Correlation (r)Very sensitiveA single outlier can flip the sign of r from positive to negative
Linear RegressionHighly sensitiveThe regression line is pulled toward influential outliers (leverage points)
RangeMaximally sensitiveDefined entirely by the minimum and maximum — outliers determine it

💡 Resistance vs Sensitivity

Statistics that use position (median, IQR, quantiles) are called robust or resistant — they are unaffected by outliers. Statistics that use all values in arithmetic calculations (mean, standard deviation, variance) are non-robust and can be severely distorted by even a single outlier.

Section 03

Types of Outliers

Not all outliers are the same. Understanding why a value is an outlier determines what you should do with it.

TypeCauseExampleAction
Error outlier Data entry mistake, sensor malfunction, recording error Age recorded as 220 instead of 22; a weight sensor reading 0kg due to calibration failure Investigate and correct or remove
Natural outlier Genuine extreme value — real variation in the population Usain Bolt’s 100m time in a dataset of sprinters; a billionaire in income data Keep — it is real and may be meaningful
Interesting outlier Unexpected anomaly that signals something important An unusually high credit card transaction (fraud detection); a sudden spike in disease cases Investigate further — it may be the most important data point
Structural outlier Data from a different subgroup accidentally mixed in Adult heights in a children’s dataset; a commercial property in a residential price dataset Separate into correct group; do not simply delete

⚠ Classify Before You Act

The most important question is: why is this value an outlier? Answering that question determines everything — whether to keep it, remove it, investigate it, or report it. Blindly removing outliers without understanding their cause is one of the most common errors in data analysis.

Section 04

How to Detect Outliers — 4 Methods

📏

Z-Score Method

Calculate how many standard deviations each value is from the mean. Values with |z| > 3 are outliers. Best for normally distributed data.

z = (x − μ) / σ
Best for: normal distributions
📦

IQR / Tukey Fences

Uses the interquartile range. Values below Q1 − 1.5×IQR or above Q3 + 1.5×IQR are mild outliers. 3×IQR for extreme outliers. Robust to skewed data.

Lower = Q1 − 1.5×IQR
Upper = Q3 + 1.5×IQR
Best for: skewed data
🔬

Modified Z-Score

Uses the median and Median Absolute Deviation (MAD) instead of mean and standard deviation. More robust than regular Z-score. Values with |M| > 3.5 are outliers.

M = 0.6745 × (x − median) / MAD
Best for: small samples
👁

Visual Methods

Box plots show outliers as individual dots beyond the whiskers. Scatter plots reveal spatial outliers. Histograms show isolated bars. Always visualise before calculating.

Best for: first exploration

IQR Method — Worked Example

Dataset: 12, 15, 14, 10, 18, 14, 13, 100, 16, 11

1

Sort the data

10, 11, 12, 13, 14, 14, 15, 16, 18, 100

2

Find Q1 and Q3

Q1 (25th percentile) = 11.5  |  Q3 (75th percentile) = 15.5

3

Calculate IQR

IQR = Q3 − Q1 = 15.5 − 11.5 = 4.0

4

Calculate fences

Lower fence = 11.5 − (1.5 × 4.0) = 5.5
Upper fence = 15.5 + (1.5 × 4.0) = 21.5

5

Flag outliers

The value 100 is above 21.5 — it is an outlier. All other values fall within [5.5, 21.5].

Section 05

Interactive Outlier Detector

Enter your own dataset (comma-separated numbers) and choose a detection method. The detector will flag outliers instantly and show you the full statistical breakdown.

  Outlier Detector
Sorted data — ■ outlier   ■ mild   ■ normal

Section 06

Visualising Outliers with Box Plots

A box plot (also called a box-and-whisker plot) is the standard visual tool for outlier detection. The box shows the IQR (Q1 to Q3). The line inside is the median. The whiskers extend to the Tukey fences. Individual dots beyond the whiskers are outliers.

Box plot — the anatomy of outlier detection
Box Plot ElementWhat it showsStatistical meaning
Left edge of boxQ125th percentile — 25% of data is below this
Line inside boxMedian (Q2)50th percentile — the true middle
Right edge of boxQ375th percentile — 75% of data is below this
Box widthIQR = Q3 − Q1Middle 50% of the data — resistant to outliers
WhiskersQ1 − 1.5×IQR to Q3 + 1.5×IQRThe “expected” range — Tukey fences
Individual dotsOutliersAny value beyond the whiskers

Section 07

How to Handle Outliers — 5 Strategies

After detecting an outlier, you have five options. The right one depends on the type of outlier and your analytical goal.

🗑

1. Remove it

Delete the value from the dataset. Only appropriate for confirmed error outliers where the value is demonstrably wrong. Never remove without documenting why.

✏

2. Correct it

Fix the error if the true value is known. A weight of 700kg that should be 70kg can be corrected. Always preferable to removal when the correct value is recoverable.

🔒

3. Cap it (Winsorising)

Replace the outlier with the nearest fence value (e.g. Q3 + 1.5×IQR). Keeps the data point in the analysis but limits its influence. Common in financial modelling.

📐

4. Transform the data

Apply a log, square root, or Box-Cox transformation to compress the scale. Outliers become less extreme. Useful when skewed data is the underlying issue.

🛡

5. Use robust methods

Switch to statistics resistant to outliers: use median instead of mean, IQR instead of standard deviation, robust regression instead of OLS. Keeps all data intact.

✅ Decision Framework

Is it a data error? → Correct or remove it, document your decision.
Is it a real but extreme value? → Keep it, use robust statistics, report it.
Is it suspicious and unexplained? → Investigate before deciding.
Unsure? → Run your analysis both with and without the outlier and report both results.

Section 08

When You Should NEVER Remove an Outlier

The phrase “never ignore them” in the title of this article is deliberate. Outliers are sometimes the most important data points. Here is when removing them would be a serious mistake:

💳

Fraud Detection

An outlier transaction — an unusually large purchase in an unusual location — is the fraud. Removing outliers from a fraud detection model trains it to ignore the very signals it should catch.

Never remove
🦠

Disease Outbreaks

A sudden spike in illness cases in one region is an outlier in epidemiological data. That outlier is the outbreak. Smoothing it away could delay a public health response.

Never remove
🔬

Scientific Discovery

The discovery of penicillin began with an outlier — a petri dish where bacteria unexpectedly failed to grow near a mould. Fleming investigated rather than discarded.

Always investigate
🏭

Quality Control

A machine part that is far outside tolerance is an outlier in production data. That outlier signals equipment failure. Removing it from reports hides a critical manufacturing defect.

Never remove
🌍

Climate Science

Unusual temperature or CO₂ readings that deviate from historical patterns are outliers. These anomalies are often the most scientifically significant observations in the dataset.

Always investigate
📈

Market Crashes

Financial crises appear as extreme outliers in stock return data. Removing them from risk models (as many banks did pre-2008) leads to catastrophically underestimated risk.

Never remove

🔑 The Golden Rule

Never remove an outlier simply because it makes your analysis messier, your p-value higher, or your graph look cleaner. Outliers must be understood, not just eliminated. If you remove an outlier, document it explicitly, explain why, and consider reporting your analysis both ways.

Section 09

Real-World Examples

FieldThe OutlierTypeCorrect Action
Income dataBillionaires in a national income surveyNaturalUse median not mean; report separately; use log scale
Medical trialsPatient with extreme drug responseInterestingInvestigate — may indicate a genetic subgroup; never remove
Sports statisticsUsain Bolt’s 9.58s 100m world recordNaturalKeep — it is a genuine data point; report as exceptional
Customer dataCustomer age entered as 999ErrorRemove or set to null; flag for data quality review
ManufacturingComponent 50× outside toleranceInterestingHalt production; investigate equipment; never delete from log
House pricesLuxury penthouse in a suburb datasetStructuralAnalyse luxury and non-luxury properties separately
Network securityServer traffic spike at 3amInterestingInvestigate immediately — likely a breach or attack

Section 10

Python Code

IQR Method

Python
import numpy as np

data = np.array([12, 15, 14, 10, 18, 14, 13, 100, 16, 11, 9, 17])

Q1 = np.percentile(data, 25)
Q3 = np.percentile(data, 75)
IQR = Q3 - Q1

lower_fence = Q1 - 1.5 * IQR
upper_fence = Q3 + 1.5 * IQR

outliers = data[(data < lower_fence) | (data > upper_fence)]
clean    = data[(data >= lower_fence) & (data <= upper_fence)]

print(f"Q1={Q1}, Q3={Q3}, IQR={IQR}")
print(f"Fences: [{lower_fence:.1f}, {upper_fence:.1f}]")
print(f"Outliers: {outliers}")   # → [100]
print(f"Clean data: {clean}")

Z-Score Method

Python
from scipy import stats
import numpy as np

data = np.array([12, 15, 14, 10, 18, 14, 13, 100, 16, 11])

z_scores = np.abs(stats.zscore(data))
threshold = 3.0

outliers = data[z_scores > threshold]
print(f"Z-scores: {z_scores.round(2)}")
print(f"Outliers (|z| > {threshold}): {outliers}")  # → [100]

Modified Z-Score (most robust)

Python
import numpy as np

def modified_zscore(data):
    median = np.median(data)
    mad = np.median(np.abs(data - median))   # Median Absolute Deviation
    return 0.6745 * (data - median) / mad

data = np.array([12, 15, 14, 10, 18, 14, 13, 100, 16, 11])
m_scores = np.abs(modified_zscore(data))
outliers = data[m_scores > 3.5]
print(f"Outliers: {outliers}")  # → [100]

Winsorising (capping outliers)

Python
from scipy.stats import mstats
import numpy as np

data = np.array([12, 15, 14, 10, 18, 14, 13, 100, 16, 11])

# Winsorise at 5th and 95th percentiles
winsorised = mstats.winsorize(data, limits=[0.05, 0.05])
print(f"Original:   {data}")
print(f"Winsorised: {np.array(winsorised)}")
# 100 is replaced with the 95th percentile value

# Log transformation for right-skewed data
log_data = np.log1p(data)   # log(1+x) handles zeros safely
print(f"Log:        {log_data.round(2)}")
# 100 → 4.62, rest compressed into smaller range

Box plot visualisation with matplotlib

Python
import matplotlib.pyplot as plt
import numpy as np

data = [12, 15, 14, 10, 18, 14, 13, 100, 16, 11, 9, 17]

fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(12, 4))

# Box plot
bp = ax1.boxplot(data, vert=False, patch_artist=True,
                 flierprops=dict(marker='o', color='red', markersize=8))
bp['boxes'][0].set_facecolor('#99f6e4')
ax1.set_title('Box Plot — red dots are outliers')
ax1.set_xlabel('Value')

# Dot plot
ax2.scatter(data, [1]*len(data), alpha=0.7, s=80,
           c=['#e11d48' if x > 21 else '#0d9488' for x in data])
ax2.set_title('Dot Plot — red = outlier')
ax2.set_yticks([])

plt.tight_layout()
plt.show()

Section 11

Knowledge Quiz

Six questions to test your understanding of outliers in statistics.

  Outliers Quiz
Question 1 of 6

The post Outliers in Statistics — How to Detect, Handle and Never Ignore Them appeared first on Learn With Examples.

]]>
https://learnwithexamples.org/outliers-in-statistics/feed/ 0 754
Normal Distribution — Why Everything Forms a Bell Curve https://learnwithexamples.org/normal-distribution-why-everything-forms-a-bell-curve/ https://learnwithexamples.org/normal-distribution-why-everything-forms-a-bell-curve/#respond Thu, 16 Jul 2026 06:32:14 +0000 https://learnwithexamples.org/?p=744 Normal Distribution Explained — Why Everything Forms a Bell Curve Statistics · Mathematics Heights, exam scores, measurement errors, IQ, shoe sizes, rainfall — almost every naturally occurring dataset organises itself…

The post Normal Distribution — Why Everything Forms a Bell Curve appeared first on Learn With Examples.

]]>
Normal Distribution Explained — Why Everything Forms a Bell Curve

Statistics · Mathematics

Heights, exam scores, measurement errors, IQ, shoe sizes, rainfall — almost every naturally occurring dataset organises itself into the same iconic shape. This guide explains why, what the bell curve tells you, and how to use it — with live demos, a z-score calculator, and Python code.

📖 18 min read 📊 Live bell curve builder 🪙 Coin-flip simulation 🧮 Z-score calculator ❓ Quiz included

Section 01

What is a Normal Distribution?

A normal distribution (also called a Gaussian distribution or bell curve) is a way that data arranges itself around a central value — with most values clustered near the middle, and fewer and fewer values appearing as you move toward the extremes.

Plot it on a graph and you get the unmistakable bell shape: perfectly symmetric, peaked in the centre, tapering off equally on both sides. The curve never actually touches the x-axis — it just gets infinitely close at the extremes.

📌 Definition

A normal distribution is fully described by just two numbers: the mean (μ) — where the centre of the bell sits — and the standard deviation (σ) — how wide or narrow the bell is. Change either one and you get a different bell curve.

⚖

Perfectly Symmetric

The left half is a mirror image of the right. The mean, median, and mode are all equal and sit at the exact centre.

🏔

Unimodal

There is only one peak — the most common value. Values become progressively rarer as you move away from the centre.

∞

Asymptotic Tails

The curve approaches but never reaches zero. Extreme values are possible — just extraordinarily rare.

📐

Total Area = 1

The area under the entire curve equals exactly 1 (or 100%). This lets us read off probabilities directly from areas.

Section 02

Why Does Nature Produce Bell Curves?

This is the deep question. Why should human heights, leaf sizes, or measurement errors all form a bell? The answer comes from one of the most powerful theorems in all of mathematics: the Central Limit Theorem.

The Central Limit Theorem says: whenever a quantity is the result of many small, independent, random influences added together — the result will be normally distributed, no matter what distribution each individual influence has.

🌿 Why height is normally distributed

Your height is influenced by hundreds of genetic variants, each adding or subtracting a tiny amount. Some push you taller, some shorter, most roughly cancel out. The sum of hundreds of tiny random effects → bell curve. The same logic applies to birth weight, exam scores, and manufacturing tolerances.

The logic in three steps

1

Many independent influences

The outcome is the sum (or average) of many separate random inputs. Human height has ~700 genetic variants each contributing a tiny effect.

2

Most cancel out

For every influence that pushes the result high, there’s usually one pushing it low. The middle outcome (where they mostly balance) is most common.

3

Extremes are rare combinations

Getting an extreme value requires almost all the influences to push the same direction simultaneously — increasingly unlikely the more extreme you go.

Section 03

Interactive: Coin Flips Become a Bell Curve

The clearest way to see the Central Limit Theorem is with coin flips. Flip a coin 10 times and count heads. Do it thousands of times. The histogram of “number of heads” will form a perfect bell curve.

Click Flip & Toss to simulate thousands of experiments. Watch the histogram grow into a bell shape before your eyes.

  Coin Flip Simulation — Central Limit Theorem

💡 What you are seeing

Each bar shows how many times that number of heads appeared. With few trials the bars are jagged and uneven. As you increase trials to 10,000 — the bars smooth into a near-perfect bell. This is the Central Limit Theorem in action.

Section 04

Key Properties of the Normal Distribution

The normal distribution has a precise mathematical formula, but you don’t need to memorise it — you need to understand what its two parameters mean.

📐 The Formula (for reference)

f(x) = (1 / σ√2π) × e−½((x−μ)/σ)²
where μ = mean, σ = standard deviation, e = Euler’s number ≈ 2.718

ParameterSymbolControlsEffect on curve
Mean μ (mu) Centre / location Shifts the bell left or right without changing shape
Standard Deviation σ (sigma) Width / spread Larger σ → flatter, wider bell. Smaller σ → taller, narrower bell
Variance σ² Spread (squared) σ² = σ × σ. Often used in formulas; σ is easier to interpret

⚠ Mean = Median = Mode

In a perfect normal distribution, all three measures of central tendency are identical and sit at the peak of the bell. This is only true for symmetric distributions — skewed data breaks this equality.

Section 05

Interactive Bell Curve Builder

Drag the sliders to change the mean (μ) and standard deviation (σ). Watch how the bell curve shifts position and changes shape in real time.

  Bell Curve Builder
μ = 50 σ = 10 μ − σ = 40 μ + σ = 60 Range 68%: 40–60

Section 06

The 68-95-99.7 Empirical Rule

One of the most useful facts about the normal distribution is that fixed percentages of data always fall within 1, 2, and 3 standard deviations of the mean — regardless of what μ and σ actually are.

±1σ
Within 1 standard deviation of the mean
68%
68.27%
±2σ
Within 2 standard deviations of the mean
95%
95.45%
±3σ
Within 3 standard deviations of the mean
99.7%
99.73%

Worked Example — Adult Male Heights

Adult male heights in the UK are approximately normally distributed with μ = 175 cm and σ = 7 cm. Using the empirical rule:

RangeHeights% of menInterpretation
μ ± 1σ 168 cm – 182 cm 68.27% About 2 in 3 men
μ ± 2σ 161 cm – 189 cm 95.45% About 19 in 20 men
μ ± 3σ 154 cm – 196 cm 99.73% Nearly all men — only 1 in 370 outside this
Above 196 cm >3σ above mean 0.135% Extremely rare (1 in 740 men)

🏭 Six Sigma in Manufacturing

The famous “Six Sigma” quality standard means keeping defects within ±6 standard deviations — which means only 3.4 defects per million opportunities. This is why the empirical rule matters enormously in engineering and quality control.

Section 07

Z-Scores — Standardising Any Normal Distribution

A z-score tells you how many standard deviations a value is away from the mean. It lets you compare values from completely different normal distributions on the same scale.

z = (x − μ) / σ
x = your value  |  μ = mean  |  σ = standard deviation

What z-scores mean

Z-ScoreMeaningPercentile (approx)
z = 0Exactly at the mean50th percentile
z = +11 std dev above mean~84th percentile
z = −11 std dev below mean~16th percentile
z = +22 std devs above mean~97.7th percentile
z = −22 std devs below mean~2.3rd percentile
z = +33 std devs above mean~99.9th percentile

💡 Why z-scores are useful

A student scored 75 in Maths (μ=60, σ=10) and 82 in English (μ=75, σ=8). Which was the better performance relative to classmates?

Maths z = (75−60)/10 = +1.5  |  English z = (82−75)/8 = +0.875

The Maths score was relatively better — despite being a lower raw mark. Z-scores make this comparison possible.

Section 08

Interactive Z-Score Calculator

Enter any value, mean, and standard deviation to instantly calculate the z-score and see what percentile it corresponds to.

  Z-Score Calculator
z = 0.00

Section 09

Real-World Examples

The normal distribution appears across almost every domain of science, engineering, and everyday life.

📏

Human Heights

Adult heights within a gender and population are normally distributed. UK men: μ=175cm, σ=7cm. The tallest 2.5% are above ~189cm.

🎓

Exam Scores

When a test is well-designed, scores form a bell curve. Many standardised tests (SAT, IQ tests) are deliberately calibrated to produce μ=100, σ=15.

🏭

Manufacturing

A machine making bolts produces diameters that scatter around the target in a bell. Quality control uses σ to decide how many are defective.

📈

Stock Returns

Daily returns on a diversified index approximate a normal distribution. Risk models use σ (volatility) to estimate the probability of large losses.

🌧

Rainfall & Temperature

Monthly average temperatures at a location over many years form a bell. Climate scientists use deviations from the mean to measure unusual weather.

⚕

Medical Measurements

Blood pressure, cholesterol, birth weight — most biological measurements are normally distributed. “Normal range” usually means within ±2σ of the mean.

Section 10

When Data is NOT Normally Distributed

Not everything is a bell curve. Recognising when data isn’t normal is just as important as knowing when it is.

DistributionExampleShape
Right-skewed Income, house prices, city populations Long tail to the right. Most people earn little; a few earn millions.
Left-skewed Age at retirement, scores on an easy test Long tail to the left. Most values are high, few are very low.
Bimodal Height of mixed male/female population Two peaks — mixing two separate normal distributions.
Uniform Rolling a die, random number generators Flat — every value equally likely, no central peak.
Exponential Time between customer arrivals, time to equipment failure Drops steeply from zero — short times are far more common.
Power law Social media followers, earthquake magnitudes Extremely heavy tail. A tiny number dominate.

⚠ Always check before assuming normality

Many statistical tests assume your data is normal. Using them on skewed data gives misleading results. Always plot your data first (histogram or Q-Q plot) and run a normality test like Shapiro-Wilk before applying normal-distribution methods.

Section 11

Python Code

Plotting a bell curve

Python
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import norm

mu, sigma = 175, 7   # UK male heights: mean=175cm, std=7cm

x = np.linspace(mu - 4*sigma, mu + 4*sigma, 300)
y = norm.pdf(x, mu, sigma)

plt.figure(figsize=(10, 5))
plt.plot(x, y, color='#6366f1', linewidth=2.5)

# Shade the 1σ, 2σ, 3σ regions
for n, color, label in [(1,'#10b981','68%'),(2,'#f59e0b','95%'),(3,'#ef4444','99.7%')]:
    mask = (x >= mu - n*sigma) & (x <= mu + n*sigma)
    plt.fill_between(x, y, where=mask, alpha=0.2, color=color, label=f'{label} within {n}σ')

plt.title('Normal Distribution of UK Male Heights')
plt.xlabel('Height (cm)')
plt.ylabel('Probability Density')
plt.legend()
plt.tight_layout()
plt.show()

Z-scores and probabilities

Python
from scipy.stats import norm

mu, sigma = 175, 7
x = 185

# Z-score
z = (x - mu) / sigma
print(f"Z-score: {z:.2f}")           # → 1.43

# Probability of being BELOW this height
p_below = norm.cdf(x, mu, sigma)
print(f"P(height < 185): {p_below:.1%}")  # → 92.4%

# Probability of being ABOVE this height
p_above = 1 - p_below
print(f"P(height > 185): {p_above:.1%}")  # → 7.6%

# Probability of being BETWEEN two values
p_between = norm.cdf(182, mu, sigma) - norm.cdf(168, mu, sigma)
print(f"P(168 < height < 182): {p_between:.1%}")  # → 68.3%

# What height is at the 90th percentile?
p90 = norm.ppf(0.90, mu, sigma)
print(f"90th percentile height: {p90:.1f} cm")  # → 184.0 cm

Testing if data is normally distributed

Python
from scipy.stats import shapiro, normaltest
import numpy as np

data = np.random.normal(loc=175, scale=7, size=100)

# Shapiro-Wilk test (best for n < 5000)
stat, p = shapiro(data)
print(f"Shapiro-Wilk: stat={stat:.3f}, p={p:.3f}")
# If p > 0.05 → fail to reject normality (data is likely normal)

# D'Agostino K² test
stat2, p2 = normaltest(data)
print(f"Normaltest:   stat={stat2:.3f}, p={p2:.3f}")

# Quick visual check
import scipy.stats as stats
import matplotlib.pyplot as plt
stats.probplot(data, dist="norm", plot=plt)
plt.title("Q-Q Plot — points on the line = normal")
plt.show()

Section 12

Knowledge Quiz

Six questions to test your understanding of the normal distribution.

  Normal Distribution Quiz
Question 1 of 6

The post Normal Distribution — Why Everything Forms a Bell Curve appeared first on Learn With Examples.

]]>
https://learnwithexamples.org/normal-distribution-why-everything-forms-a-bell-curve/feed/ 0 744
How to Read Graphs in Math and Science Exams https://learnwithexamples.org/how-to-read-graphs-in-math-and-science-exams/ https://learnwithexamples.org/how-to-read-graphs-in-math-and-science-exams/#respond Mon, 02 Jun 2025 09:05:17 +0000 https://learnwithexamples.org/?p=392 How to Read Graphs in Math and Science Exams How to Read Graphs in Math and Science Exams Graphs are essential for conveying data in a clear and concise way,…

The post How to Read Graphs in Math and Science Exams appeared first on Learn With Examples.

]]>
How to Read Graphs in Math and Science Exams

How to Read Graphs in Math and Science Exams

Graphs are essential for conveying data in a clear and concise way, and you’ll find them in most math and science exams. Whether it’s a chemistry experiment result or a mathematical function, reading graphs effectively is crucial for scoring well. In this guide, you’ll learn strategies, explore interactive tools, and see visual examples designed for high school and college-level exams.

1. Types of Graphs You’ll See on Exams

Understanding the different types of graphs is the first step. Here are the most common ones with examples:

1.1 Line Graphs

Used to show how one variable changes over time. Common in physics and biology to show things like temperature, velocity, or growth over time.

Line Graph Example

1.2 Bar Graphs

These are great for comparing quantities. Each bar represents a category.

Bar Graph Example

1.3 Pie Charts

Used to show proportions or percentages.

Pie Chart Example

1.4 Scatter Plots

Used to determine relationships or correlations between two variables.

Scatter Plot Example

2. Anatomy of a Graph

  • X-Axis: Typically represents the independent variable (e.g., time).
  • Y-Axis: Represents the dependent variable (e.g., speed, population).
  • Title: Describes what the graph is about.
  • Legend: Helps interpret multiple lines or bars.
  • Scale: Pay attention to how values are spaced.

3. Interactive Line Graph: Temperature vs. Time

Input temperature readings over time to visualize how values change in a modern, interactive chart.

4. Practice Problem Example

Problem: The graph below shows the speed of a car over 10 seconds. During which time interval was the car decelerating?

Solution Tip: Look for a downward slope.

5. Real Exam Tips

  • Underline what the question asks before looking at the graph.
  • Watch out for tricky scales (e.g., gaps, unequal intervals).
  • Estimation is okay if precise numbers aren’t shown.
  • Always check the units.

6. Key Vocabulary

  • Slope: Steepness of the line (rise over run).
  • Intercept: Point where line crosses axis.
  • Plateau: A flat section—no change in variable.
  • Peak: Highest value reached.

8. Interactive Pie Chart: Category Proportions

Enter percentages for different categories to generate a pie chart showing proportions. The total must be 100.

Also check: How to Interpret Graphs and Charts

Also check: Understanding the Axes: X-Axis vs Y-Axis

The post How to Read Graphs in Math and Science Exams appeared first on Learn With Examples.

]]>
https://learnwithexamples.org/how-to-read-graphs-in-math-and-science-exams/feed/ 0 392
Understanding the Axes: X-Axis vs Y-Axis https://learnwithexamples.org/understanding-the-axes-x-axis-vs-y-axis/ https://learnwithexamples.org/understanding-the-axes-x-axis-vs-y-axis/#respond Mon, 02 Jun 2025 08:17:36 +0000 https://learnwithexamples.org/?p=383 Understanding the Axes: X-Axis vs Y-Axis Explained with Examples Introduction: The Foundation of Coordinate Systems Imagine trying to meet a friend in a large city without any street addresses or…

The post Understanding the Axes: X-Axis vs Y-Axis appeared first on Learn With Examples.

]]>
Understanding the Axes: X-Axis vs Y-Axis Explained with Examples

Introduction: The Foundation of Coordinate Systems

Imagine trying to meet a friend in a large city without any street addresses or directions. You’d probably end up wandering aimlessly, unable to pinpoint exactly where you need to go. This is exactly why we need coordinate systems in mathematics, science, and everyday applications – they provide us with a systematic way to locate and describe positions in space.

The X-axis and Y-axis form the backbone of the Cartesian coordinate system, named after French mathematician René Descartes. This system revolutionized mathematics by bridging the gap between algebra and geometry, allowing us to represent geometric shapes using algebraic equations and vice versa. Understanding these axes is crucial for anyone working with graphs, charts, maps, computer graphics, engineering, physics, and countless other fields.

Why This Matters

Whether you’re plotting a simple line graph for a school project, analyzing business data, programming a video game, or navigating with GPS, you’re using coordinate systems. The X and Y axes are the fundamental building blocks that make all of this possible.

The Cartesian Coordinate System: A Visual Foundation

The Cartesian coordinate system consists of two perpendicular lines that intersect at a point called the origin. These lines divide the plane into four sections called quadrants, creating a grid-like system that allows us to specify the exact location of any point using two numbers.

X
Y

In the diagram above, you can see the basic structure of a coordinate system. The horizontal line is the X-axis, the vertical line is the Y-axis, and the colored dots represent different points plotted on this system. Each point can be described using an ordered pair (x, y) that tells us exactly where it’s located.

The X-Axis: Your Horizontal Highway

The X-axis is the horizontal line in our coordinate system. Think of it as the foundation or the ground level of our mathematical world. It extends infinitely in both directions – to the left (negative direction) and to the right (positive direction) from the origin.

Key Characteristics of the X-Axis:

  • Orientation: Always horizontal, running from left to right
  • Direction: Positive values extend to the right, negative values to the left
  • Origin: The point where X equals zero (0, 0)
  • Units: Can represent any measurement unit depending on context
  • Independence: Changes in X-values don’t affect Y-values directly

Real-World Applications of the X-Axis

📈 Business Analytics

In a sales chart, the X-axis might represent months of the year. Moving from left to right shows the progression of time, helping businesses track performance over different periods.

🗺 Navigation Systems

GPS coordinates use the X-axis (longitude) to determine how far east or west you are from a reference point. This helps pinpoint your exact location on Earth.

🎮 Game Development

In video games, the X-axis controls horizontal movement. When your character moves left or right across the screen, they’re traveling along the X-axis.

The Y-Axis: Your Vertical Lifeline

The Y-axis is the vertical line in our coordinate system. If the X-axis is our foundation, then the Y-axis is our elevator – it takes us up and down through different levels of our mathematical space. Like the X-axis, it extends infinitely in both directions from the origin.

Key Characteristics of the Y-Axis:

  • Orientation: Always vertical, running from bottom to top
  • Direction: Positive values extend upward, negative values downward
  • Origin: The point where Y equals zero (0, 0)
  • Scale: Can be adjusted independently of the X-axis
  • Dependence: Often represents the outcome or result variable

Real-World Applications of the Y-Axis

📊 Scientific Research

In experiments, the Y-axis often represents the measured outcome. For example, in a temperature study, the Y-axis might show degrees while the X-axis shows time.

💰 Financial Planning

Investment charts use the Y-axis to show monetary values. As you move up the Y-axis, you see higher profits or account balances.

🏗 Architecture

Building blueprints use the Y-axis to represent height or elevation. This helps architects plan different floors and structural elements.

Interactive Coordinate Plotting

Try It Yourself: Plot Coordinates

Enter X and Y values to see how points are plotted on a coordinate system:

Understanding Coordinate Pairs (X, Y)

Every point on a coordinate plane is described by an ordered pair (x, y). The first number tells us the horizontal position (X-coordinate), and the second number tells us the vertical position (Y-coordinate). The order matters tremendously – (3, 5) is a completely different location than (5, 3).

Reading Coordinates: A Step-by-Step Process

To locate any point on a coordinate plane, follow these steps:

  1. Start at the origin (0, 0) where the axes intersect
  2. Move horizontally according to the X-coordinate (right for positive, left for negative)
  3. Move vertically according to the Y-coordinate (up for positive, down for negative)
  4. Mark the point where these movements intersect
Coordinate Pair X-Value (Horizontal) Y-Value (Vertical) Quadrant Description
(3, 4) 3 units right 4 units up I Upper right quadrant
(-2, 3) 2 units left 3 units up II Upper left quadrant
(-1, -2) 1 unit left 2 units down III Lower left quadrant
(4, -1) 4 units right 1 unit down IV Lower right quadrant

The Four Quadrants: Dividing the Coordinate Plane

The intersection of the X and Y axes creates four distinct regions called quadrants. Each quadrant has unique characteristics based on the signs (positive or negative) of the coordinates within it:

Quadrant I

Signs: (+X, +Y)
Location: Upper right
Example: (3, 4), (7, 2)
Real-world: Profit and growth scenarios

Quadrant II

Signs: (-X, +Y)
Location: Upper left
Example: (-2, 5), (-6, 1)
Real-world: Past events with positive outcomes

Quadrant III

Signs: (-X, -Y)
Location: Lower left
Example: (-4, -3), (-1, -7)
Real-world: Past events with negative outcomes

Quadrant IV

Signs: (+X, -Y)
Location: Lower right
Example: (5, -2), (8, -4)
Real-world: Future projections with current losses

Practical Applications in Different Fields

Economics and Business

In economic analysis, the X-axis often represents time periods (months, quarters, years), while the Y-axis shows financial metrics like revenue, costs, or profit margins. This helps businesses visualize trends, make predictions, and identify patterns in their performance over time.

Science and Engineering

Scientists use coordinate systems to plot experimental data. For instance, in physics experiments, the X-axis might represent time while the Y-axis shows velocity, acceleration, or displacement. This visual representation helps researchers understand relationships between variables and formulate scientific laws.

Computer Graphics and Gaming

Every pixel on your computer screen has X and Y coordinates. Game developers use these coordinates to position characters, objects, and interface elements. When you move your mouse cursor, you’re essentially changing its X and Y coordinates in real-time.

Geography and Mapping

Map systems use coordinate-based approaches where longitude corresponds to the X-axis (east-west position) and latitude corresponds to the Y-axis (north-south position). This allows GPS systems to pinpoint any location on Earth with remarkable accuracy.

Common Mistakes and How to Avoid Them

Mistake #1: Confusing X and Y Coordinates

The Problem: Switching the order of coordinates in an ordered pair

The Solution: Remember “X comes before Y” alphabetically, and “across before up” spatially

Memory Trick: “X marks the spot horizontally, Y reaches for the sky”

Mistake #2: Incorrect Sign Interpretation

The Problem: Misunderstanding positive and negative directions

The Solution: Positive X goes right, negative X goes left; positive Y goes up, negative Y goes down

Memory Trick: Think of a traditional number line: positive numbers are to the right and up

Mistake #3: Ignoring Scale Differences

The Problem: Assuming both axes have the same scale

The Solution: Always check the scale markers on both axes before interpreting data

Memory Trick: Look before you leap into conclusions about data relationships

Advanced Concepts: Beyond Basic Plotting

Slope and Rate of Change

When we connect points on a coordinate plane, we create lines that can tell us about the relationship between X and Y variables. The slope of a line represents how much Y changes for each unit change in X. This concept is fundamental in calculus, physics, and economics.

Transformations

Coordinate systems allow us to perform mathematical transformations like rotations, reflections, and translations. These operations are essential in computer graphics, robotics, and engineering design.

Multiple Axes Systems

While we’ve focused on 2D systems, many real-world applications require three-dimensional coordinate systems (X, Y, Z) or even higher-dimensional spaces. These concepts build directly on the foundation of understanding X and Y axes.

Tips for Mastering Coordinate Systems

  • Practice regularly: Plot different points daily to build muscle memory
  • Use real data: Work with actual datasets from your field of interest
  • Visualize first: Before calculating, try to estimate where a point should be
  • Check your work: Verify coordinates by moving step-by-step from the origin
  • Understand context: Always consider what the axes represent in real-world terms
  • Use technology: Graphing calculators and software can help verify your manual work
  • Connect concepts: Relate coordinate systems to other math topics you’re learning

Tools and Resources for Further Learning

Modern technology offers numerous ways to explore and work with coordinate systems. Graphing calculators, spreadsheet software like Excel or Google Sheets, mathematical software like Desmos or GeoGebra, and programming languages like Python or R all provide powerful tools for working with coordinates and creating visualizations.

For students and professionals alike, understanding how to use these tools effectively can dramatically improve your ability to analyze data, solve problems, and communicate mathematical concepts visually.

Conclusion: Building Your Mathematical Foundation

The X-axis and Y-axis are more than just lines on a graph – they’re fundamental tools that help us understand relationships, visualize data, and solve complex problems across countless fields. Whether you’re tracking business performance, conducting scientific research, developing software, or simply trying to understand the world around you, coordinate systems provide the framework for turning abstract concepts into concrete, visual understanding.

By mastering these concepts, you’re not just learning mathematics – you’re developing critical thinking skills that will serve you throughout your academic and professional career. The ability to visualize relationships between variables, interpret data accurately, and communicate findings clearly are invaluable skills in our increasingly data-driven world.

Remember, like any skill, proficiency with coordinate systems comes through practice and application. Start with simple examples, gradually work up to more complex scenarios, and always connect what you’re learning to real-world situations that interest you. With time and practice, reading and creating coordinate-based visualizations will become second nature.

Also check: How to Interpret Graphs and Charts

The post Understanding the Axes: X-Axis vs Y-Axis appeared first on Learn With Examples.

]]>
https://learnwithexamples.org/understanding-the-axes-x-axis-vs-y-axis/feed/ 0 383
How to Interpret Graphs and Charts: A Beginner’s Guide to Data Visualization https://learnwithexamples.org/how-to-interpret-graphs-and-charts/ https://learnwithexamples.org/how-to-interpret-graphs-and-charts/#respond Mon, 16 Sep 2024 11:47:19 +0000 https://learnwithexamples.org/?p=294 In today’s data-driven world, understanding how to interpret graphs and charts is a fundamental skill. Whether in business, education, or personal research, visualizing data helps make complex information more accessible.…

The post How to Interpret Graphs and Charts: A Beginner’s Guide to Data Visualization appeared first on Learn With Examples.

]]>
In today’s data-driven world, understanding how to interpret graphs and charts is a fundamental skill. Whether in business, education, or personal research, visualizing data helps make complex information more accessible. For beginners, learning how to read and interpret common graphs such as histograms, bar charts, and scatterplots is key to gaining insight from data. This guide provides a comprehensive introduction to these types of graphs, breaking down their components, and offering clear examples to help you become proficient at data interpretation.

Why Is Data Visualization Important?

Data visualization translates large datasets into an easily understandable form. By using visual elements like graphs and charts, we can:

  1. Identify Patterns: Visualizing data helps to recognize trends or outliers quickly.
  2. Simplify Complex Data: Charts and graphs condense complicated data into digestible visuals.
  3. Support Decision-Making: Business and academic fields use data visualization to guide strategic decisions.
  4. Enhance Communication: Well-crafted graphs and charts make it easier to communicate findings effectively.

To get the most out of data visualization, it’s essential to understand how different types of graphs represent data. Let’s start with some of the most common types: histograms, bar charts, and scatterplots.


1. Understanding Bar Charts

What Are Bar Charts?

A bar chart is one of the simplest and most commonly used graphs to compare quantities across categories. Bar charts display rectangular bars, where the length of each bar is proportional to the value it represents. They are often used to represent categorical data, such as comparing sales numbers across different products or the population of various cities.

Components of a Bar Chart:

  • X-Axis (Horizontal Axis): Represents the categories being compared.
  • Y-Axis (Vertical Axis): Represents the numerical value for each category.
  • Bars: Each bar’s length corresponds to the value for that category.

Bar charts can be oriented horizontally or vertically, depending on preference or space constraints.

Types of Bar Charts:

  • Simple Bar Chart: Displays one set of data across different categories.
  • Grouped Bar Chart: Compares multiple datasets for each category by grouping bars side by side.
  • Stacked Bar Chart: Stacks bars on top of one another to show cumulative data for each category.

Example: A Simple Bar Chart

Let’s say a company tracks the number of sales for different products in one month. The bar chart below represents the sales data:

ProductSales (Units)
Product A100
Product B150
Product C90
Product D120

Using this data, a bar chart will show:

  • The X-axis listing Products A, B, C, and D.
  • The Y-axis showing the sales values from 0 to 150.
  • Bars extending from each product up to its corresponding sales number.

How to Interpret This Bar Chart:

  • Product B had the highest sales at 150 units.
  • Product C had the lowest sales at 90 units.
  • The difference between products can be quickly compared based on the length of their bars.

Common Uses of Bar Charts:

  • Comparing sales across products or services.
  • Displaying survey results across different demographic groups.
  • Illustrating differences between categories over time.

Also check: Understanding the Axes: X-Axis vs Y-Axis


2. Understanding Histograms

What Are Histograms?

A histogram is a type of bar chart that represents the distribution of numerical data. Unlike a standard bar chart that displays categorical data, a histogram organizes data into bins (ranges of values) to show how many data points fall into each bin. It is useful for understanding the frequency distribution of data and identifying patterns such as skewness, modality, and spread.

Components of a Histogram:

  • X-Axis (Horizontal Axis): Represents the bins or intervals of data.
  • Y-Axis (Vertical Axis): Represents the frequency or number of occurrences within each bin.
  • Bars: Each bar shows how many data points fall within each bin. The height of the bar represents the frequency.

Example: A Histogram of Exam Scores

Consider a set of student exam scores ranging from 0 to 100. The histogram below shows how frequently each score range (bin) occurred:

Score Range (Bin)Number of Students
0-205
21-4010
41-6015
61-8020
81-1005

This histogram would display:

  • The X-axis showing bins like 0-20, 21-40, etc.
  • The Y-axis showing the number of students in each bin.
  • Bars representing how many students scored within each range.

How to Interpret This Histogram:

  • The majority of students scored between 61 and 80 (20 students).
  • Fewer students scored either very high (81-100) or very low (0-20).
  • The data distribution appears skewed towards the higher end, meaning most students performed well on the exam.

Common Uses of Histograms:

  • Visualizing exam or test score distributions.
  • Understanding age distributions in populations.
  • Analyzing the frequency of certain measurements (e.g., height, weight).

3. Understanding Scatterplots

What Are Scatterplots?

A scatterplot is a graph that shows the relationship between two numerical variables. Each data point on the plot represents an individual observation. Scatterplots are used to detect patterns, trends, correlations, and potential outliers in data.

Components of a Scatterplot:

  • X-Axis (Horizontal Axis): Represents one numerical variable (independent variable).
  • Y-Axis (Vertical Axis): Represents another numerical variable (dependent variable).
  • Data Points: Each point corresponds to the values of both variables for a single observation.

Example: A Scatterplot of Study Time vs. Test Scores

Consider the following data on how many hours students spent studying and their corresponding test scores:

Study Time (Hours)Test Score (%)
255
465
670
880
1085

A scatterplot for this data will:

  • Show Study Time on the X-axis.
  • Show Test Scores on the Y-axis.
  • Each point on the graph represents a pair of values (study time and corresponding test score).

How to Interpret This Scatterplot:

  • The data shows a positive correlation: As study time increases, test scores also increase.
  • The relationship appears linear: A roughly straight line could be drawn through the points, indicating a direct relationship between the two variables.
  • There are no obvious outliers or points that deviate significantly from the overall trend.

Correlation in Scatterplots:

Scatterplots help identify different types of correlations:

  • Positive Correlation: As one variable increases, the other also increases.
  • Negative Correlation: As one variable increases, the other decreases.
  • No Correlation: There is no apparent relationship between the variables.

Common Uses of Scatterplots:

  • Analyzing relationships between variables in scientific studies.
  • Understanding correlations between marketing spend and sales performance.
  • Identifying trends in social data (e.g., income vs. education level).

Also check: Let’s Learn Statistics for Beginners


4. Choosing the Right Graph

When working with data, it’s crucial to choose the correct graph or chart to represent the information accurately. Here’s a simple guide to help you select the most appropriate visualization:

Bar Chart:

  • Use for comparing categories.
  • Example: Comparing monthly revenue for different products.

Histogram:

  • Use for visualizing the distribution of continuous data.
  • Example: Showing the age distribution of customers in a store.

Scatterplot:

  • Use for showing the relationship between two numerical variables.
  • Example: Analyzing how advertising spend affects sales.

5. Interpreting Graphs Accurately

While graphs and charts make it easier to visualize data, they can sometimes be misleading if not carefully interpreted. Here are some important tips to ensure accurate interpretation:

1. Check the Scale:

Look closely at the scale of the axes. Misleading scales can exaggerate or downplay the true relationship between the data points.

  • Example: A bar chart showing sales data may start the Y-axis at 50 instead of 0, making differences between bars look more significant than they are.

2. Consider the Data Range:

Understand the range of data displayed. For example, a histogram might group data into bins that are too large or small, hiding the true distribution.

3. Look for Trends, Not Outliers:

Outliers can skew the perception of the overall trend in data. Always focus on the general pattern or trend rather than individual outliers unless the outliers are particularly relevant.

4. Context Matters:

Understanding the context of the data is important. For example, a spike in sales for a particular product might be due to a seasonal event or a promotion rather than an organic trend.

5. Avoid Over-Interpreting Correlation:

In scatterplots, remember that correlation does not imply causation. Just because two variables are correlated doesn’t mean one is causing the other. Additional analysis is required to establish causality.


6. Common Pitfalls to Avoid

1. Using the Wrong Type of Graph:

One of the most common mistakes is using an inappropriate graph for the type of data. For example, using a bar chart to represent continuous data (better suited for a histogram) can lead to confusion.

2. Misleading Visual Cues:

Be mindful of visual cues that can mislead viewers. For example, using 3D effects on bar charts can distort the actual differences between categories.

3. Ignoring the Baseline:

In bar charts and line graphs, the baseline (often zero) should be clearly defined. Starting the Y-axis at a number other than zero can exaggerate differences.


7. Practice Example

Let’s apply what we’ve learned with a practical example. Suppose we are looking at the average daily temperatures (in Celsius) of two cities over a week:

DayCity ACity B
Monday2025
Tuesday2226
Wednesday2124
Thursday2325
Friday2427
Saturday2526
Sunday2325

Bar Chart:

A bar chart comparing the temperatures of City A and City B would show bars for each day of the week, allowing you to visually compare the temperatures side by side.

Scatterplot:

A scatterplot could show the relationship between the temperatures in City A and City B to see if there’s a pattern. If City B’s temperature is always slightly higher than City A’s, the points on the scatterplot will cluster near a straight line.


Conclusion

Understanding and interpreting graphs and charts is a powerful tool for analyzing data. By mastering the basics of common visualizations like bar charts, histograms, and scatterplots, beginners can quickly extract valuable insights from complex datasets. As you continue to practice, interpreting data will become second nature, enabling you to make informed decisions based on clear, visual evidence.

Whether you’re working on business reports, academic research, or personal projects, being able to accurately read and interpret graphs will significantly enhance your ability to understand and communicate data effectively.

The post How to Interpret Graphs and Charts: A Beginner’s Guide to Data Visualization appeared first on Learn With Examples.

]]>
https://learnwithexamples.org/how-to-interpret-graphs-and-charts/feed/ 0 294
Let’s Learn Statistics for Beginners: A Journey into the World of Numbers https://learnwithexamples.org/learn-statistics-for-beginners/ https://learnwithexamples.org/learn-statistics-for-beginners/#respond Mon, 29 Jan 2024 04:59:08 +0000 https://learnwithexamples.org/?p=31 Welcome, fellow learner, to the fascinating realm of statistics! If the mere mention of statistics makes you break into a cold sweat, fear not – we’re embarking on a journey…

The post Let’s Learn Statistics for Beginners: A Journey into the World of Numbers appeared first on Learn With Examples.

]]>
Welcome, fellow learner, to the fascinating realm of statistics! If the mere mention of statistics makes you break into a cold sweat, fear not – we’re embarking on a journey that will unravel the mysteries of numbers in the most straightforward and engaging manner possible.

The Adventure Begins: What is Statistics?

Imagine you’re at a fruit market, surrounded by vibrant colors and tempting aromas. You’re curious about the average size of the apples available. Statistics, my friend, is the tool that helps us make sense of such questions. It’s the science of collecting, analyzing, interpreting, presenting, and organizing data.

Our First Stop: Types of Statistics

Before we dive into the depths of statistical wonders, let’s make a quick pit stop to understand the two main types of statistics: Descriptive and Inferential.

Descriptive Statistics: Painting a Picture

Descriptive statistics are like the artist’s brush, creating a vivid picture of the data at hand. It involves methods that summarize and organize data, giving us a snapshot of what’s happening. Measures like mean, median, and mode are the palette that helps us paint the picture.

Example: Picture a basket of apples. The mean (average) size tells us the typical size of an apple, the median gives us the middle size, and the mode indicates the most common size. Descriptive statistics help us understand the “story” of our apple basket.

Inferential Statistics: Predicting the Future

Now, let’s put on our fortune-teller hats! Inferential statistics allows us to predict and make inferences about a population based on a sample. It’s like taking a small bite of one apple and confidently saying something about the entire orchard.

Example: Imagine sampling a few apples from the orchard. Inferential statistics would help us confidently say, “Most apples in the orchard are likely to be close in size to the ones we sampled.”

The Heart of the Matter: Probability

As our journey continues, we encounter the heartbeat of statistics – probability. Probability is the likelihood of an event occurring. It’s the GPS guiding us through the twists and turns of uncertainty.

Example: Think of a coin toss. The probability of getting heads or tails is 1 in 2, or 50%. Probability helps us anticipate outcomes and make informed decisions.

Embracing Distributions: Normal and Otherwise

Now, let’s explore the concept of distributions. Imagine our apple sizes forming a beautiful curve on a graph – that’s a distribution. The most famous of them all is the normal distribution, resembling a symmetric bell curve.

Example: If our apples follow a normal distribution, most of them cluster around the average size, with fewer extremes on either side. This pattern helps us understand and predict sizes better.

A Tale of Two Variables: Correlation and Regression

As we meander through the statistical landscape, we stumble upon the dynamic duo – correlation and regression. These concepts help us understand relationships between variables.

Correlation: Dance of the Variables

Correlation measures the strength and direction of a relationship between two variables. It’s like observing a dance – are the dancers moving together, or is one leading while the other follows?

Example: Let’s relate apple size to sweetness. Positive correlation would mean larger apples are generally sweeter, while negative correlation suggests the opposite.

Regression: Predicting the Future

Regression is our crystal ball, predicting the value of one variable based on another. It’s like foreseeing the sweetness of an apple based on its size.

Example: If we find a strong correlation between size and sweetness, regression helps us predict the sweetness of an apple solely based on its size.

Also check: Learn Algorithms

Hypothesis Testing: Where Curiosity Meets Science

Ever wondered if there’s a significant difference between the two groups? Hypothesis testing is our detective tool. It helps us decide if our observations are due to a real effect or just a coincidence.

Example: Picture two orchards – one using a new fertilizer and the other sticking to traditional methods. Hypothesis testing would tell us if the difference in apple size is statistically significant, helping us decide if the new fertilizer is the secret sauce.

The Final Frontier: Confidence Intervals

As our statistical odyssey nears its end, we encounter confidence intervals – our safety nets in the world of uncertainty. They provide a range of values within which we can be reasonably confident our true result lies.

Example: If our analysis tells us the average apple size is 10 centimetres with a confidence interval of 9 to 11 centimetres, we’re 95% confident that the true average size falls within this range.

Conclusion: Congratulations, You’re a Statistician in the Making!

Dear friend, we’ve covered the basics of statistics – from descriptive stats painting a picture to inferential stats predicting the future, and the dance of correlation to the crystal ball of regression. With probability as our guide, distributions shaping our understanding, hypothesis testing as our detective, and confidence intervals as our safety net, we’ve traversed the statistical landscape.

So, the next time you encounter a sea of numbers, remember the adventure we’ve shared. Embrace the data, ask questions, and let statistics be your guide. You’re no longer a beginner – you’re a statistician in the making, ready to unravel the stories hidden in the numbers! Happy stat-crunching!

For more learning articles keep visiting Learn with examples

The post Let’s Learn Statistics for Beginners: A Journey into the World of Numbers appeared first on Learn With Examples.

]]>
https://learnwithexamples.org/learn-statistics-for-beginners/feed/ 0 31