+ - 0:00:00
Notes for current slide
Notes for next slide

Confidence Intervals

Dr. D’Agostino McGowan

1 / 21

confidence intervals

If we use the same sampling method to select different samples and computed an interval estimate for each sample, we would expect the true population parameter ( β1 ) to fall within the interval estimates 95% of the time.

2 / 21

What it is NOT

  • 95% CI: (5-9)

We would expect the true population parameter to fall within 5 to 9 95% of the time

3 / 21

What it is NOT

  • 95% CI: (5-9)

We would expect the true population parameter to fall within 5 to 9 95% of the time

3 / 21

What it is NOT

  • 95% CI: (5-9)

We would expect the true population parameter to fall within 5 - 9 95% of the time

4 / 21

What it is NOT

  • 95% CI: (5-9)

We would expect the true population parameter to fall within 5 - 9 95% of the time

Why?

5 / 21

What it is NOT

  • 95% CI: (5-9)

We would expect the true population parameter to fall within 5 - 9 95% of the time

Why?

  • The "true population parameter" is FIXED!
5 / 21

The true parameter is FIXED!

6 / 21

The true parameter is FIXED!

  • *when we are talking about confidence intervals, which rely on Frequentist theory. If you take a Bayesian inference class, you will learn about credible intervals which have different assumptions
6 / 21

Example

We are interested in the relationship between Age and Wage. To demonstrate what a confidence interval is, I am going to construct a "truth" for the relationship in Lucy-land.

Wage=2×Age+ϵ

7 / 21

Example

We are interested in the relationship between Age and Wage. To demonstrate what a confidence interval is, I am going to construct a "truth" for the relationship in Lucy-land.

Wage=2×Age+ϵ

What is the "true parameter" for the relationship between Age and Wage?

7 / 21

Example

We are interested in the relationship between Age and Wage. To demonstrate what a confidence interval is, I am going to construct a "truth" for the relationship in Lucy-land.

Wage=2×Age+ϵ

What is the "true parameter" for the relationship between Age and Wage?

  • 2!
7 / 21

Example

We are interested in the relationship between Age and Wage. To demonstrate what a confidence interval is, I am going to construct a "truth" for the relationship in Lucy-land.

Wage=2×Age+ϵ

  • Age ~ Normal(30, 10)
  • ϵ ~ Normal(0, 10)
  • Sample n=100
set.seed(7)
n <- 100
sample <- data.frame(
Age = rnorm(n, 30, 10)
)
sample$Wage <- 2 * sample$Age + rnorm(n, 0, 10)
8 / 21

Example

We are interested in the relationship between Age and Wage. To demonstrate what a confidence interval is, I am going to construct a "truth" for the relationship in Lucy-land.

Wage=2×Age+ϵ

head(sample)
## Age Wage
## 1 52.87247 110.93553
## 2 18.03228 41.93996
## 3 23.05707 45.32082
## 4 25.87707 40.01053
## 5 20.29327 43.67375
## 6 20.52720 25.01562
9 / 21

Example

We are interested in the relationship between Age and Wage. To demonstrate what a confidence interval is, I am going to construct a "truth" for the relationship in Lucy-land.

Wage=2×Age+ϵ

n <- 100
sample2 <- data.frame(
Age = rnorm(n, 30, 10)
)
sample2$Wage <- 2 * sample2$Age + rnorm(n, 0, 10)
10 / 21

Example

We are interested in the relationship between Age and Wage. To demonstrate what a confidence interval is, I am going to construct a "truth" for the relationship in Lucy-land.

Wage=2×Age+ϵ

head(sample)
## Age Wage
## 1 52.87247 110.93553
## 2 18.03228 41.93996
## 3 23.05707 45.32082
## 4 25.87707 40.01053
## 5 20.29327 43.67375
## 6 20.52720 25.01562
head(sample2)
## Age Wage
## 1 50.23344 105.71950
## 2 38.62492 74.49258
## 3 29.75091 60.04891
## 4 36.00635 68.13020
## 5 42.16481 80.15938
## 6 18.23468 24.82762
11 / 21

Example

We are interested in the relationship between Age and Wage. To demonstrate what a confidence interval is, I am going to construct a "truth" for the relationship in Lucy-land.

Wage=2×Age+ϵ Fit a linear model on the sample

12 / 21

Example

We are interested in the relationship between Age and Wage. To demonstrate what a confidence interval is, I am going to construct a "truth" for the relationship in Lucy-land.

Wage=2×Age+ϵ Fit a linear model on the sample

term estimate std.error statistic p.value conf.low conf.high
(Intercept) 0.9950715 3.2797052 0.3034027 0.7622261 -5.513397 7.503540
Age 2.0098559 0.0999765 20.1032929 0.0000000 1.811456 2.208256
12 / 21

Example

We are interested in the relationship between Age and Wage. To demonstrate what a confidence interval is, I am going to construct a "truth" for the relationship in Lucy-land.

Wage=2×Age+ϵ Fit a linear model on the sample

term estimate std.error statistic p.value conf.low conf.high
(Intercept) 0.9950715 3.2797052 0.3034027 0.7622261 -5.513397 7.503540
Age 2.0098559 0.0999765 20.1032929 0.0000000 1.811456 2.208256

95% CI: 1.81, 2.21

12 / 21

Example

What percent of the time does the "true parameter" fall within this interval?

term estimate std.error statistic p.value conf.low conf.high
(Intercept) 0.9950715 3.2797052 0.3034027 0.7622261 -5.513397 7.503540
Age 2.0098559 0.0999765 20.1032929 0.0000000 1.811456 2.208256

95% CI: 1.81, 2.21

13 / 21

Example

What percent of the time does 2 fall within this interval?

term estimate std.error statistic p.value conf.low conf.high
(Intercept) 0.9950715 3.2797052 0.3034027 0.7622261 -5.513397 7.503540
Age 2.0098559 0.0999765 20.1032929 0.0000000 1.811456 2.208256

95% CI: 1.81, 2.21

14 / 21

Example

We are interested in the relationship between Age and Wage. To demonstrate what a confidence interval is, I am going to construct a "truth" for the relationship in Lucy-land.

Wage=2×Age+ϵ Fit a linear model on the sample2

15 / 21

Example

We are interested in the relationship between Age and Wage. To demonstrate what a confidence interval is, I am going to construct a "truth" for the relationship in Lucy-land.

Wage=2×Age+ϵ Fit a linear model on the sample2

term estimate std.error statistic p.value conf.low conf.high
(Intercept) -2.819931 3.0542175 -0.9232909 0.3581233 -8.880926 3.241064
Age 2.078026 0.0968743 21.4507408 0.0000000 1.885782 2.270270
15 / 21

Example

We are interested in the relationship between Age and Wage. To demonstrate what a confidence interval is, I am going to construct a "truth" for the relationship in Lucy-land.

Wage=2×Age+ϵ Fit a linear model on the sample2

term estimate std.error statistic p.value conf.low conf.high
(Intercept) -2.819931 3.0542175 -0.9232909 0.3581233 -8.880926 3.241064
Age 2.078026 0.0968743 21.4507408 0.0000000 1.885782 2.270270

95% CI: 1.89, 2.27

15 / 21

Example

What percent of the time does 2 fall within this interval?

term estimate std.error statistic p.value conf.low conf.high
(Intercept) -2.819931 3.0542175 -0.9232909 0.3581233 -8.880926 3.241064
Age 2.078026 0.0968743 21.4507408 0.0000000 1.885782 2.270270

95% CI: 1.89, 2.27

16 / 21

Example

17 / 21

Example

18 / 21

Example

What percent of the intervals contain the "true parameter"?

18 / 21

Example

19 / 21

Example

What percent of the intervals contain the "true parameter"

19 / 21

Example

What percent of the intervals contain the "true parameter"

48 / 50 = 96%

19 / 21

Example

95 / 100 = 95%

20 / 21

Applicaton Exercise

  • Watch me code this up in the next lecture video
  • Code along with me, or repeat the same steps to build an understanding about confidence intervals
21 / 21

confidence intervals

If we use the same sampling method to select different samples and computed an interval estimate for each sample, we would expect the true population parameter ( β1 ) to fall within the interval estimates 95% of the time.

2 / 21
Paused

Help

Keyboard shortcuts

, , Pg Up, k Go to previous slide
, , Pg Dn, Space, j Go to next slide
Home Go to first slide
End Go to last slide
Number + Return Go to specific slide
b / m / f Toggle blackout / mirrored / fullscreen mode
c Clone slideshow
p Toggle presenter mode
t Restart the presentation timer
?, h Toggle this help
Esc Back to slideshow