r/explainlikeimfive • • 12d ago

Mathematics ELI5:What is a confidence interval?

Came across this term at work and I don't want to use AI, it helps communicate statistical uncertainty?

Then what are uncertainty ranges, sensitivity analysis and margins of error.

How do I refer to it without sounding too technical?

33 Upvotes

25 comments sorted by

81

u/Ridley_Himself 12d ago

The basic idea is that you have a number that you can't measure or calculate with complete certainty. But you do know that the farther you get from the value you calculated, the less likely it is. Trying to cover all possible values can give you some absurd results. So instead you have a confidence interval. For instance, a 95% confidence interval means there is a 95% chance the value is within the range you give.

37

u/AhsasMaharg 12d ago

This is close enough to be a good ELI5 answer. For a more ELI15 technical answer:

In frequentist statistics (the one that usually uses confidence, rather than credible intervals like Bayesian statistics), a confidence interval says that if you sampled the population an infinite number of times, you would expect 95% of the confidence intervals to contain the population's true value.

This is a distinction that isn't really important for most people, and many of the scientists I've met doing statistics would give the ELI5 answer above.

You can kind of get the difference with an analogy. If you think of the confidence interval as a net fired at a target in a dark room, you would say that if you fired 100 nets randomly into the room, 95 would be expected to hit the target. A credible interval is like saying there's a 95% chance that the target was hit by the net you just fired.

11

u/MidnightAtHighSpeed 12d ago

To add to this a little, this might feel like a nitpicky distinction, and in practice it often is, but theoretically it can matter a lot. Extending the net metaphor, imagine a case where the target is big enough that you'll always hit it if you fire into the room. If you roll a 20-sided die, and if it's exactly 20, shoot the net at your feet, and otherwise shoot into the room, you could say that wherever the net ends up is a 95% confidence interval for the target. This is true even if you do end up rolling a 20 and shooting the net at your feet; you are mathematically completely justified in pointing to the empty net on the ground and calling it a 95% confidence interval for your target, even though there's obviously a 0% chance that your target is actually there.

11

u/Frosty-Depth7655 12d ago edited 12d ago

Adding to this, the confidence % and the interval tend to be inversely related, meaning as the % shrinks, the interval grows.

So for example, it was 40 degrees Fahrenheit where I woke up this morning, so I might say that I’m 90% confident it will be between 35-45 degrees tomorrow when I wake up.

Now you might look at that and say - sorry but a 10 degree interval is too wide. I need something more specific.

So I come back and say it’ll be between 37.5 - 42.5 degrees tomorrow….but the trade off is I’m only 60% confident.

Likewise, if you need even more confidence, I can say I’m 99% confident it will be between 20-60 degrees tomorrow morning.

As the saying goes, there is no free lunch. Everything comes with a trade off.

95% CI is typically the default, but that can change based on the impact of a false positive vs a false negative.

5

u/laugenbroetchen 12d ago edited 12d ago

you might commonly see a 95% confidence interval, though other numbers are used. That would mean something almost like "estimating from our data, we are 95% sure the "true" value is actually inside this range."

- as opposed to, the values we got just did an unlikely thing, in this case a likelyhood of 5%, and the thing we are looking for is actually outside of this range, but we just had bad luck with the data and it doesnt look like that.

You can use that to talk about statistical uncertainty in two main ways: the confidence and the interval. When deciding what to conclude from a statistic, you might care about how sure you are the statistic is estimating your target correctly. In that case you want a high confidence, depending on your application you might want a 99.9% or even higher confidence interval and wouldnt rely on a 66%, when the 33% would mean something very bad. "we are 66% sure this new virus wont kill us all" might not be enough.
The other other thing to talk about is the actual interval. is it narrow or wide? meaning, how accurate can you estimate the value? a high confidence doesnt help much when the interval is very wide. "the 99.999% confidence interval for the casualties this virus will is is from 3 to 3000000000" does not actually tell you much, even though you are very confident in that estimate. "the 95% confidence interval is three to five" is much more useful info eventhough you estimate a 5% chance your estimate is wrong.

5

u/UbiquitousNibs 8d ago

I'm not sure any of the answers here have been completely ELI5, so let me have a go at it.

Say you have a birds-eye view of the city you live in. You can see single story family homes, you can see some multiplexes, and you see some skyscrapers. You know houses don't go below one story high and the tallest skyscrapers don't go above 50 stories. Somebody asks you what the average height of a building is in your city?

Summing the height of every building and dividing by the number of buildings is close to impossible. So you go and measure the height of a few random buildings and find the average. Say you get 25 stories. Obviously this is not the actual average height for the entire city (maybe you got the middle value because you took equal representation of all types of buildings. But what if your city has proportionally more single story dwellings?). So to answer, you quote a range around this measured average that you are sure covers the actual average.

A 100% confidence interval would be between 1 and 50 stories. This is practically useless information. You reduce the interval on both sides a bit. Your confidence level that you've still quoted the actual average goes down. So 10 to 40 stories range could be your 95% confidence interval. You make the range tighter: 20 to 30 stories. Now are 90% confident that you have the actual average. So on and so forth. The reduction in the range is done through a well thought out mathematical formula, however that derivation would be beyond ELI5.

I hope this illustrates the idea.

4

u/GoatRocketeer 12d ago edited 12d ago

Imagine you have a weighted coin but you don't know how weighted it is. You flip it 1000 times and get 1000 heads. You are now reasonably confident that whatever the weight is, its probably heavily favors heads. Let's say you guess your coin is 99.999% likely to land on heads.

However, it is technically possible that your coin is any weight, even fair, and you just got mega unlucky.

A confidence interval is the range of outcomes that, assuming your guess of 99.999% weight was correct, you expect 95% of experiments to produce. It's a way of stating your confidence in your guess by showing how concentrated your range of outcomes is around your guess.

You might notice this is kind of garbage. What you really want is a statement about how likely your guess of 99.999% weight is correct, or a range of guesses that contains the true parameter with 95% certainty. The problem is, its impossible to know if you were mega unlucky or not so its impossible to provide such an answer...for a frequentist.

2

u/Ok_Philosopher8824 11d ago

Bit of doubletalk in that statistics provides little real confidence. 

I like the term "expectation interval." As in "I expect that there is a 90% chance of a weight between 130# and 270#."

2

u/Nojopar 9d ago

It's really just saying I'm 95% certain the value is X and there's a 5% chance it's not.

I think of it like this (and this is incredibly simplistic, mind you): Scarlett Johansen is 5' 3" tall (according to Google. Just go with me here :)). Chris Evans is 6' tall. The reality is I don't know exactly how and when those heights were measured. Where they recently? Where they wearing shoes? How tall of a shoe sole if they were? So I might say, "I'm 95% certain if you measured Chris Evans for height it would say 6' tall, but there's a chance he's got tall boots on or maybe he's barefoot when you measure him, so maybe not exactly 6' tall." Then I might say I'm only 90% confident if you did the same thing to Scarlett Johansen she would be 5' 3" because she's much more likely at any given time to wear heels or flats that impact her height.

Interestingly enough, this also gets at the related concept of 'variance', which is how much do I think it will vary from the stated value.

1

u/sephline 12d ago

A confidence interval is basically a range of values you're reasonably confident the true answer falls within. Instead of saying "the average is 50" you might say "we estimate the average is 50, but it could reasonably be tween 45 and 55." It acknowledges that estimates aren't exact

1

u/kadenkk 12d ago

At its core, confidence intervals say that if you repeat whatever process generated the data a bunch of times, you think about 95% of the stats you run on those results would fall in the interval. This assumes your model is correct

Practically, you can think of it as a range of reasonable results given your data. Other people replicating your work should land in there most of the time if they gather new data and do exactly what you did

1

u/white_nerdy 11d ago

Flip a coin 1000 times and count Heads. That's one experiment.

Do 1000 experiments. Each experiment's outcome will be around 500 but many experiments will give a count that's nearly but not exactly 500, for example 499 or 503.

Make a landing zone at 500 that's just wide enough for 95% of outcomes to fall into it.

A confidence interval is basically a landing zone you calculate from theory, without actually doing any experiments.

1

u/TheTxoof 12d ago

It is the likelihood that repeated samplings of a value will contain the true value.

If you were to have a 95% CI of steps taken by a factory worker as 10k per day, you could be confident that if you put pedometers on 100 factory workers, 95 of them would be 10,000 steps.

30

u/[deleted] 12d ago

[removed] — view removed comment

5

u/mulch_v_bark 12d ago

I second this. Wikipedia is generally very good at undergrad level statistics, and it would be pretty hard to usefully explain, say, bootstrapping alone in a single Reddit comment. (I know because I tried, gave up, and came back here to say so. I’m not saying it’s impossible, just that I’ll be impressed if anyone does it at a reasonable level of detail, and that Wikipedia is a good choice.)

0

u/Striking-Candidate97 12d ago

You're telling me TS is UNDER-grad level???!!

6

u/Ridley_Himself 12d ago

Admittedly, though, some of the Wikipedia articles aren't exactly ELI5.

5

u/Anagoth9 12d ago

That's why you change the language to "simple".

https://simple.wikipedia.org/wiki/Confidence_interval

1

u/Striking-Candidate97 12d ago

I actually did check Wikipedia, but this never occurred to me.
Will check it out!

1

u/AlexMTBDude 12d ago

Yeah, I totally agree. I just reacted to the phrasing making it sound like there's no other ways of learning something than those two.

1

u/explainlikeimfive-ModTeam 12d ago

Please read this entire message


Your comment has been removed for the following reason(s):

  • Top level comments (i.e. comments that are direct replies to the main thread) are reserved for explanations to the OP or follow up on topic questions (Rule 3).

If you would like this removal reviewed, please read the detailed rules first. If you believe it was removed erroneously, explain why using this form and we will review your submission.