Lecture 7: Confidence Intervals in Statistics, Lecture notes of Statistics

An explanation of confidence intervals, with examples using normal distribution data for birth weight, paint primer thickness, concrete tensile strength, and clinton vs trump polls. It covers the theory behind confidence intervals, formulas for test statistic and confidence intervals, and the relationship with hypothesis testing.

Typology: Lecture notes

2018/2019

Uploaded on 04/20/2019

kefart
kefart 🇺🇸

4.4

(11)

55 documents

1 / 26

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Lecture 7: Confidence Intervals
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a

Partial preview of the text

Download Lecture 7: Confidence Intervals in Statistics and more Lecture notes Statistics in PDF only on Docsity!

Lecture 7: Confidence Intervals

Outline

Lecture 7: Confidence Intervals Example – Birth Weight Theory – Confidence Interval Confidence Interval for μ Example – Paint Primer Thickness Example – Concrete Tensile Strength Example – Clinton vs Trump Polls Approximation CI for proportion Conservative CI for proportion Justifying the conservative CI for proportion Formulae for test statistic & confidence intervals

Example – Birth Weight

mean(x)

[1] 3.

(i) An estimate for μ is x¯ = 3. 179 (ii) X¯ ∼ N (μ, 0. 5252 /8) → Z =

X¯ − μ

  1. 525 /

∼ N (0, 1).

0. 95 = P (− 1. 96 < Z < 1 .96)

= P

X¯ − μ

  1. 525 /

= P

X¯ − 1. 96 · 0. 525 /√ 8 < μ < X¯ + 1. 96 · 0. 525 /√ 8

Now, 3. 179 ± 1. 96 · 0. 525 /

8 , giving a 95% confidence interval of (2. 82 , 3 .54).

Revision – Probability

What is the green area?

qnorm(0.975)

[1] 1.

Distribution calculator

−1.96 0.00 1.96 5/

Confidence Interval for μ

I (^) If the sampling population is N (μ, σ^2 ) with known σ, 100(1 − α)% confidence interval for μ is ¯x ± z 1 −α/ 2 · √σn

where z 1 −α/ 2 = z∗^ such that P (Z < z∗) = 1 − α 2. I (^) In practice σ is unknown so we use x ¯ ± t 1 −α/ 2 ,n− 1 · √sn

where t 1 −α/ 2 ,n− 1 = t∗^ such that P (tn− 1 < t∗) = 1 − α 2. I (^) z 1 −α/ 2 and t 1 −α/ 2 ,n− 1 are called critical values. I √σn and √sn are standard errors of the estimate of μ. I (^) Remember tn− 1 → N (0, 1) as n → ∞!

Confidence Interval for μ

I (^) If the sampling population is N (μ, σ^2 ) with known σ, 100(1 − α)% confidence interval for μ is ¯x ± z 1 −α/ 2 · √σn

where z 1 −α/ 2 = z∗^ such that P (Z < z∗) = 1 − α 2. I (^) In practice σ is unknown so we use x ¯ ± t 1 −α/ 2 ,n− 1 · √sn

where t 1 −α/ 2 ,n− 1 = t∗^ such that P (tn− 1 < t∗) = 1 − α 2. I (^) z 1 −α/ 2 and t 1 −α/ 2 ,n− 1 are called critical values. I √σn and √sn are standard errors of the estimate of μ. I (^) Remember tn− 1 → N (0, 1) as n → ∞! I (^) What if the distribution of the sampling population is unknown?

Example – Paint Primer Thickness

Assume that paint primer thickness can be modelled by X ∼ N (μ, σ^2 ). In an ongoing process of quality control in an industrial system, the following first sample of values was obtained:

x = c(1.3, 1.1, 1.2, 1.25, 1.05, 0.95, 1.1, 1.16, 1.37, 0.98)

(i) What is a 95% confidence interval for the primer thickness? (ii) What is a 99% confidence interval for the primer thickness? (iii) The company advertises that the primer thickness is 1.25. What would you conclude?

Theory – Size of confidence interval

I (^) What happens if we increase the sample size n?

As we increase n, the confidence interval gets narrower, and so x¯ is a better estimate for the long term estimate of μ. I (^) What happens if we increase the confidence level 1 − α?

As we increase the confidence level, the confidence interval gets wider.

Example – Paint Primer Thickness

(i) A 95% CI for μ is: ¯x ± t 0. 975 , 9 · s √ n which is 1. 146 ± 2. 262 · 0 √.^13610 , giving (1. 05 , 1 .24). qt(0.975, 9)

[1] 2.

(ii) A 99% CI for μ is: ¯x ± t 0. 995 , 9 · s √ n which is 1. 146 ± 3. 250 · 0 √.^13610 , giving (1. 01 , 1 .29). qt(0.995, 9)

[1] 3.

Theory – Relationship with hypothesis testing

I (^) For a false positive rate of α, a set of possible hypothesis {H 0 : μ = μ 0 } which will be retained if μ 0 is within the 100(1 − α)% confidence interval. I (^) Note: this is a two-sided hypothesis test. I (^) Although we don’t explicitly mention, we implicitly assume confidence intervals are two-sided. Example – Paint Primer Thickness (iii) The CI does not contain H 0 : μ = 1. 25 hence the data provide evidence against the company’s advertising if we use false positive rate of 0.05.

Example – Concrete Tensile Strength

(i) Find a 95% CI for the mean tensile strength of small specimens, assuming that the strengths can be modelled by N (μ, 10002 ). (ii) Find a 90% CI for the mean difference in tensile strengths, assuming that the differences can be modelled by N (μ, σ^2 ).

Example – Concrete Tensile Strength

small = c(4404, 4326, 3788, 3475, 3418, 2262, 7415, 6993) mean(small)

[1] 4510.

sd(small)

[1] 1792.

(i) Assuming that the strengths can be modelled by N (μ, 10002 ), a 95% CI for the mean tensile strength of small specimens is: x ¯ ± 1. 96 · σ √ n which is

  1. 125 ± 1. 96 · 1000 /

which gives (3817, 5203).

Example – Clinton vs Trump Polls

From a recent report on the USA Election 2016^ , we find the following quotes: “The tighter race in Florida showed Clinton edging Trump 45% to 42% among likely voters, with Johnson at 5% and Stein at 3%. That three-point lead was within the poll’s margin of error.”

Image: Wikimedia Commons CC BY-SA 4.

“The NBC/WSJ/Marist poll Florida poll surveyed 700 likely voters between October 3-5 with a margin of error of plus or minus 3.7 percentage points.”

“The Pennsylvania poll surveyed 709 likely voters between October 3-6 with a margin of error of plus or minus 3.7 percentage points.”

A random survey of 2000 voters found that 1165 were going to vote for Hilary Clinton.

(i) Find a 95 % CI for the proportion of voters p that will vote for Hillary. (ii) What is the margin of error?

(iii) What is the smallest sample size needed to give a 95 % CI for p with width at most ± 0. 03?