FAQ: Statistical Thinking - Median and IQR

This community-built FAQ covers the “Median and IQR” exercise from the lesson “Statistical Thinking”.

Paths and Courses
This exercise can be found in the following Codecademy content:

Data Scientist: Analytics Specialist
Data Scientist: Natural Language Processing Specialist
Data Science Foundations
Data Scientist: Inference Specialist Career Path
Data Scientist: Machine Learning Specialist

Principles of Data Literacy

FAQs on the exercise Median and IQR

There are currently no frequently asked questions associated with this exercise – that’s where you come in! You can contribute to this section by offering your own questions, answers, or clarifications on this exercise. Ask or answer a question by clicking reply (reply) below.

If you’ve had an “aha” moment about the concepts, formatting, syntax, or anything else with this exercise, consider sharing those insights! Teaching others and answering their questions is one of the best ways to learn and stay sharp.

Join the Discussion. Help a fellow learner on their journey.

Ask or answer a question about this exercise by clicking reply (reply) below!
You can also find further discussion and get answers to your questions over in Language Help.

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources? Head to Language Help and Tips and Resources. If you are wanting feedback or inspiration for a project, check out Projects.

Looking for motivation to keep learning? Join our wider discussions in Community

Learn more about how to use this guide.

Found a bug? Report it online, or post in Bug Reporting

Have a question about your account or billing? Reach out to our customer support team!

None of the above? Find out where to ask other questions here!

Can somebody help me understand the proper difference between the Median and IQR?

This is what I believe about the Median and IQR:
For me, it seems that the median is created by following Q3-Q1. And that the IQR is 25%.

1 Like

The median is the middle number in the set when all the numbers are in order.
median = Q2

The interquartile range is the distance between the lower and upper quartile
IQR = Q3 - Q1

3 Likes

hi:)

In this course,

  • The first quartile marks 25% (Q1 = 10).
  • The second quartile marks 50% (Q2 = 13 — the median)
  • The third quartile marks 75% (Q3 = 22)

It’s hard for me to catch the concepts.
The idea that I understood is that 1Q is 25% of total span; in this case, 22(28-6).
How come Q1 would be 10? and
Q2 is 13. but the summary above said that 13 - the median.
I think 13 is already the median in that range.

Thank you for your time to answer my question, and have a happy coding life :slight_smile:

What this question is lacking is basically a total number of measures (points) which is essential to determine the median.

Total = 20

For even values of observations we need to take 2 middle points so:

20/2 = 10th point = 12
11th point = 14

Median = (10th point + 11th point) / 2

so:

Median = (12 + 14) / 2 = 13

You can do the same for 5th (25% of total) and 6th values to get Q1 and 15th (75% of total) and 16th to get Q3

Hope it helps

4 Likes

Thank you so much! I was totally lost by the numbers in the examples. Now, I understand how each quartile value was calculated.

I’m still a little confused though. The lesson says the distribution spans 22 values (which is 6 to 28). Shouldn’t that be 23 values? 6 + 22 is 28, but is the 6 not included in the span? (or is 28 not included in the span?) :thinking:

I only count 20 dots on the distribution. Why don’t I see 22?

hey, did you ever get an answer for this?

Hey there. I myslf just got clarified with it.

So if you look at the picture,


You can see there are totally 20 data points ( the blue dots ). To find IQR - which is basically separated into 3 parts Q1, Q2 and Q3.

  1. Q1 is 25% of total data points. So, out of 20 data points, 25% is 5. So, the first 5 data points is marked as Q1 (which is 10).
  2. Q2 is 50% of total data points. which is right? out of 20 data points, 10 will be the 50%. So, after 10 data points it is marked as Q2(which is 13). Q2 is also known as median. So 13 is median. You said, “but the summary above said that 13 - the median.” the ‘-’ is not subtraction or difference its just a mark ( dash ) indicating 13 is the median.
  3. Q3 is 75%. So, out of 20 data points 75% is 15. So after 15 data points Q3 is marked. Which is 22 here.

So, IQR = Q3-Q1 → 22-10 =12.

6 Likes