STAT 311: Confidence Intervals for Means · 2 days ago · Sampling Distribution of the Mean From...

25
STAT 311: Confidence Intervals for Means Y. Samuel Wang Summer 2016 Y. Samuel Wang STAT 311: Confidence Intervals for Means

Transcript of STAT 311: Confidence Intervals for Means · 2 days ago · Sampling Distribution of the Mean From...

Page 1: STAT 311: Confidence Intervals for Means · 2 days ago · Sampling Distribution of the Mean From the Central Limit Theorem, we know that as n, the size of my sample, increases p

STAT 311: Confidence Intervals for Means

Y. Samuel Wang

Summer 2016

Y. Samuel Wang STAT 311: Confidence Intervals for Means

Page 2: STAT 311: Confidence Intervals for Means · 2 days ago · Sampling Distribution of the Mean From the Central Limit Theorem, we know that as n, the size of my sample, increases p

Logistics

Homework has been posted

Y. Samuel Wang STAT 311: Confidence Intervals for Means

Page 3: STAT 311: Confidence Intervals for Means · 2 days ago · Sampling Distribution of the Mean From the Central Limit Theorem, we know that as n, the size of my sample, increases p

Sampling Distribution of the Mean

From the Central Limit Theorem, we know that as n, the size ofmy sample, increases

√nx̄n − µσ

→ N (0, 1)

...But in almost every case, we don’t know σ

Y. Samuel Wang STAT 311: Confidence Intervals for Means

Page 4: STAT 311: Confidence Intervals for Means · 2 days ago · Sampling Distribution of the Mean From the Central Limit Theorem, we know that as n, the size of my sample, increases p

Sampling Distribution of the Mean

From the Central Limit Theorem, we know that as n, the size ofmy sample, increases

√nx̄n − µσ

→ N (0, 1)

...But in almost every case, we don’t know σ

Y. Samuel Wang STAT 311: Confidence Intervals for Means

Page 5: STAT 311: Confidence Intervals for Means · 2 days ago · Sampling Distribution of the Mean From the Central Limit Theorem, we know that as n, the size of my sample, increases p

Sampling Distribution of the Mean

So typically we consider using sx , the standard deviation of thedata, to estimate σ, the population standard deviation

√nx̄n − µsx

The sample standard deviation, sx , is also a random variable andchanges from sample to sample. Yesterday in lab we talked about adistribution which arises from the ratio of certain random variables.

√nx̄n − µsx

→ tn−1

Turns out, when we plug in sx for σ, we end up with a Tdistribution with n − 1 degrees of freedom

Y. Samuel Wang STAT 311: Confidence Intervals for Means

Page 6: STAT 311: Confidence Intervals for Means · 2 days ago · Sampling Distribution of the Mean From the Central Limit Theorem, we know that as n, the size of my sample, increases p

Sampling Distribution of the Mean

So typically we consider using sx , the standard deviation of thedata, to estimate σ, the population standard deviation

√nx̄n − µsx

The sample standard deviation, sx , is also a random variable andchanges from sample to sample. Yesterday in lab we talked about adistribution which arises from the ratio of certain random variables.

√nx̄n − µsx

→ tn−1

Turns out, when we plug in sx for σ, we end up with a Tdistribution with n − 1 degrees of freedom

Y. Samuel Wang STAT 311: Confidence Intervals for Means

Page 7: STAT 311: Confidence Intervals for Means · 2 days ago · Sampling Distribution of the Mean From the Central Limit Theorem, we know that as n, the size of my sample, increases p

T Distribution

The T Distribution was developed by William Gosset while workingat the Guiness Brewery in Dublin, Ireland.

Figure : William Gosset

In particular, Gosset was interested in estimating the “degree ofsaccharine” in malt extract

Y. Samuel Wang STAT 311: Confidence Intervals for Means

Page 8: STAT 311: Confidence Intervals for Means · 2 days ago · Sampling Distribution of the Mean From the Central Limit Theorem, we know that as n, the size of my sample, increases p

T Distribution

The T distribution looks very similar to the Normal, but givesmore weight to “extreme” observations

As the degrees of freedom increase, the distribution looks moreand more like a normal distribution

Y. Samuel Wang STAT 311: Confidence Intervals for Means

Page 9: STAT 311: Confidence Intervals for Means · 2 days ago · Sampling Distribution of the Mean From the Central Limit Theorem, we know that as n, the size of my sample, increases p

Normal Probabilities

In particular-

.95 = P

(−t?n−1 ≤

√nx̄n − µsx

≤ t?n−1

)= P

(−t?n−1

sx√n≤ x̄n − µ ≤ t?n−1

sx√n

)= P

(x̄ − t?n−1

sx√n≤ µ ≤ x̄ + t?n−1

sx√n

) (1)

So there is a 95% chance that when I form sample a x̄ and formthe interval (x̄ − t?n−1

sx√n, x̄ + t?n−1

sx√n

), it will contain the trueparameter µ

Y. Samuel Wang STAT 311: Confidence Intervals for Means

Page 10: STAT 311: Confidence Intervals for Means · 2 days ago · Sampling Distribution of the Mean From the Central Limit Theorem, we know that as n, the size of my sample, increases p

Normal Probabilities

In particular-

.95 = P

(−t?n−1 ≤

√nx̄n − µsx

≤ t?n−1

)= P

(−t?n−1

sx√n≤ x̄n − µ ≤ t?n−1

sx√n

)= P

(x̄ − t?n−1

sx√n≤ µ ≤ x̄ + t?n−1

sx√n

) (1)

So there is a 95% chance that when I form sample a x̄ and formthe interval (x̄ − t?n−1

sx√n, x̄ + t?n−1

sx√n

), it will contain the trueparameter µ

Y. Samuel Wang STAT 311: Confidence Intervals for Means

Page 11: STAT 311: Confidence Intervals for Means · 2 days ago · Sampling Distribution of the Mean From the Central Limit Theorem, we know that as n, the size of my sample, increases p

Example

Y. Samuel Wang STAT 311: Confidence Intervals for Means

Page 12: STAT 311: Confidence Intervals for Means · 2 days ago · Sampling Distribution of the Mean From the Central Limit Theorem, we know that as n, the size of my sample, increases p

Confidence Intervals in general

Hopefully you’ve picked up on a general pattern for Confidenceintervals

point estimate±multiplier× SE

Type Point Estimate Multiplier Standard Error

Single Proportion p̂ standard normal√

p̂(1−p̂)n

Diff in Proportions p̂1 − p̂2 standard normal√

p̂1(1−p̂1)n1

+ p̂2(1−p̂2)n2

Mean x̄ T distribution sxn

Y. Samuel Wang STAT 311: Confidence Intervals for Means

Page 13: STAT 311: Confidence Intervals for Means · 2 days ago · Sampling Distribution of the Mean From the Central Limit Theorem, we know that as n, the size of my sample, increases p

Means of paired differences

Now suppose that I want to estimate the average weight loss afterusing a specific work out regimen for 12 weeks. I record the weightof each individual before and after the program. For eachindividual, I denote the difference in weights as di .

I can still form confidence intervals for the mean of the differencesin the same exact way, except now the differences di are myobservations.

d̄ ± tn−1sd√n

Y. Samuel Wang STAT 311: Confidence Intervals for Means

Page 14: STAT 311: Confidence Intervals for Means · 2 days ago · Sampling Distribution of the Mean From the Central Limit Theorem, we know that as n, the size of my sample, increases p

Means of paired differences

Now suppose that I want to estimate the average weight loss afterusing a specific work out regimen for 12 weeks. I record the weightof each individual before and after the program. For eachindividual, I denote the difference in weights as di .

I can still form confidence intervals for the mean of the differencesin the same exact way, except now the differences di are myobservations.

d̄ ± tn−1sd√n

Y. Samuel Wang STAT 311: Confidence Intervals for Means

Page 15: STAT 311: Confidence Intervals for Means · 2 days ago · Sampling Distribution of the Mean From the Central Limit Theorem, we know that as n, the size of my sample, increases p

Difference in Means (independent samples)

Suppose I am interested in comparing the average IQ of studentsat UW agains the average IQ of students at WSU. My parameterof interest would be

µUW − µWSU

Can I create a confidence interval for the difference given a sampleof UW students and WSU students? In this case, the IQ of arandomly selected UW student is independent of the IQ of arandomly selected WSU student and it doesn’t quite make sense topair two randomly selected students together and take thedifference.

Y. Samuel Wang STAT 311: Confidence Intervals for Means

Page 16: STAT 311: Confidence Intervals for Means · 2 days ago · Sampling Distribution of the Mean From the Central Limit Theorem, we know that as n, the size of my sample, increases p

Difference in Means (independent samples)

For two populations, if I am interested in estimating

µ1 − µ2

I can use the point estimate of

x̄1 − x̄2

which has a mean of µ1 − µ2. When they are independent, the

variance of the point estimate isσ2

1n1

+σ2

2n2

, so we use a standarderror of √

s21

n1+

s22

n2

Y. Samuel Wang STAT 311: Confidence Intervals for Means

Page 17: STAT 311: Confidence Intervals for Means · 2 days ago · Sampling Distribution of the Mean From the Central Limit Theorem, we know that as n, the size of my sample, increases p

Difference in Means (independent samples)

So I can form a confidence interval

(x̄1 − x̄2)± tdf

√s2

1

n1+

s22

n2

The degrees of freedom we should be using can get complicated.For this class, we will simply use df = min(n1 − 1, n2 − 1).

Y. Samuel Wang STAT 311: Confidence Intervals for Means

Page 18: STAT 311: Confidence Intervals for Means · 2 days ago · Sampling Distribution of the Mean From the Central Limit Theorem, we know that as n, the size of my sample, increases p

Difference in Means (independent samples)

So I can form a confidence interval

(x̄1 − x̄2)± tdf

√s2

1

n1+

s22

n2

The degrees of freedom we should be using can get complicated.For this class, we will simply use df = min(n1 − 1, n2 − 1).

Y. Samuel Wang STAT 311: Confidence Intervals for Means

Page 19: STAT 311: Confidence Intervals for Means · 2 days ago · Sampling Distribution of the Mean From the Central Limit Theorem, we know that as n, the size of my sample, increases p

Difference in Means (independent samples)

So I can form a confidence interval

(x̄1 − x̄2)± tdf

√s2

1

n1+

s22

n2

The degrees of freedom we should be using can get complicated.For this class, we will simply use df = min(n1 − 1, n2 − 1).

Y. Samuel Wang STAT 311: Confidence Intervals for Means

Page 20: STAT 311: Confidence Intervals for Means · 2 days ago · Sampling Distribution of the Mean From the Central Limit Theorem, we know that as n, the size of my sample, increases p

Difference in Means (independent samples)

So I can form a confidence interval

(x̄1 − x̄2)± tdf

√s2

1

n1+

s22

n2

The degrees of freedom we should be using can get complicated.For this class, we will simply use df = min(n1 − 1, n2 − 1).

Y. Samuel Wang STAT 311: Confidence Intervals for Means

Page 21: STAT 311: Confidence Intervals for Means · 2 days ago · Sampling Distribution of the Mean From the Central Limit Theorem, we know that as n, the size of my sample, increases p

Difference in Means (independent samples)

So I can form a confidence interval

(x̄1 − x̄2)± tdf

√s2

1

n1+

s22

n2

The degrees of freedom we should be using can get complicated.For this class, we will simply use df = min(n1 − 1, n2 − 1).

Y. Samuel Wang STAT 311: Confidence Intervals for Means

Page 22: STAT 311: Confidence Intervals for Means · 2 days ago · Sampling Distribution of the Mean From the Central Limit Theorem, we know that as n, the size of my sample, increases p

Difference in Means (independent samples)

So I can form a confidence interval

(x̄1 − x̄2)± tdf

√s2

1

n1+

s22

n2

The degrees of freedom we should be using can get complicated.For this class, we will simply use df = min(n1 − 1, n2 − 1).

Y. Samuel Wang STAT 311: Confidence Intervals for Means

Page 23: STAT 311: Confidence Intervals for Means · 2 days ago · Sampling Distribution of the Mean From the Central Limit Theorem, we know that as n, the size of my sample, increases p

Difference in Means (independent samples)

So I can form a confidence interval

(x̄1 − x̄2)± tdf

√s2

1

n1+

s22

n2

The degrees of freedom we should be using can get complicated.For this class, we will simply use df = min(n1 − 1, n2 − 1).

Y. Samuel Wang STAT 311: Confidence Intervals for Means

Page 24: STAT 311: Confidence Intervals for Means · 2 days ago · Sampling Distribution of the Mean From the Central Limit Theorem, we know that as n, the size of my sample, increases p

Difference in Means (independent samples)

So I can form a confidence interval

(x̄1 − x̄2)± tdf

√s2

1

n1+

s22

n2

The degrees of freedom we should be using can get complicated.For this class, we will simply use df = min(n1 − 1, n2 − 1).

Y. Samuel Wang STAT 311: Confidence Intervals for Means

Page 25: STAT 311: Confidence Intervals for Means · 2 days ago · Sampling Distribution of the Mean From the Central Limit Theorem, we know that as n, the size of my sample, increases p

Example

Y. Samuel Wang STAT 311: Confidence Intervals for Means