Lecture 24
Confidence Intervals
DATA 8
Fall 2020
Announcements
Weekly Goals
Percentiles
Computing Percentiles
The Xth percentile is first value on the sorted list that is at least as large as X% of the elements.
Example: s = [1, 7, 3, 9, 5]
s_sorted = [1, 3, 5, 7, 9]
For a percentile that does not exactly correspond to an element, take the next greater element instead
The 80th percentile is ordered element 4: (80/100) * 5
percentile(80, s) is 7
Percentile
Data set
The percentile Function
percentile(p, values)
(Demo)
Discussion Question
Which are True, when s = [1, 7, 3, 9, 5]?
percentile(10, s) == 0
percentile(39, s) == percentile(40, s)
percentile(40, s) == percentile(41, s)
percentile(50, s) == 5
(Demo)
Estimation
Inference: Estimation
(Demo)
Variability of the Estimate
(Demo)
Quantifying Uncertainty
Estimate = Parameter + Error
(Demo)
Where to Get Another Sample?
The Bootstrap
The Bootstrap
Why the Bootstrap Works
population
sample
resamples
All of these look pretty similar, most likely.
Why We Need the Bootstrap
population
sample
resamples
What we wish we could get
What we really get
Real World vs. Bootstrap World
Real world:
Bootstrap world:
Hope: these two scenarios are analogous
The Bootstrap Principle
...are similar to what they are in the real world
Key to Resampling
(Demo)
Confidence Intervals
95% Confidence Interval
(Demo)
Each line here is a confidence interval from a fresh sample from the population