l10 confidence intervals

44
CONFIDENCE INTERVALS STAT 118 BIOSTATISTICS Lecture 10 Dept. of Medical Laboratories College of Applied Medical Sciences Qassim University March 2016

Upload: layal-fahad

Post on 10-Jan-2017

177 views

Category:

Healthcare


0 download

TRANSCRIPT

Page 1: L10 confidence intervals

CONFIDENCE INTERVALS

STAT 118 BIOSTATISTICS

Lecture 10Dept. of Medical Laboratories

College of Applied Medical Sciences Qassim University

March 2016

Page 2: L10 confidence intervals

2

Outline

1. Confidence Intervals for the Mean (Large Samples)

2. Sample size

3. Confidence Intervals for the Mean (Small Samples)

Page 3: L10 confidence intervals

3

1. Confidence Intervals for the Mean of Large Samples

• Objectives: Find a point estimate and a margin of error Construct and interpret confidence intervals for the

population mean Determine the minimum sample size required

when estimating μ (Sample Size Calculation)

Page 4: L10 confidence intervals

Point Estimate for Population μ

Point Estimate• A single value estimate for a population parameter• Most unbiased point estimate of the population mean

μ is the sample mean x

Estimate PopulationParameter…

with SampleStatistic

Mean: μ x

4

Page 5: L10 confidence intervals

Example: Point Estimate for Population μ

A social networking website allows its users to add friends, send messages, and update their personal profiles. The following represents a random sample of the number of friends for 40 users of the website. Find a point estimate of the population mean, µ. (Source: Facebook)

140 105 130 97 80 165 232 110 214 201 12298 65 88 154 133 121 82 130 211 153 11458 77 51 247 236 109 126 132 125 149 12274 59 218 192 90 117 105

5

Page 6: L10 confidence intervals

Solution: Point Estimate for Population μ

The sample mean of the data is

x x 5232 130.8n 40

Your point estimate for the mean number of friends forall users of the website is 130.8 friends.

6

Page 7: L10 confidence intervals

How confident do we want to be that the interval estimate contains the population mean μ?

Interval Estimate

Interval estimate• An interval, or range of values, used to estimate a

population parameter.

Point estimatex 130.8

125 130 135 140

Interval estimate

Right endpoint146.5

)145 150

Left endpoint115.1

(115

120

7

Page 8: L10 confidence intervals

Level of Confidence

Level of confidence c• The probability that the interval estimate contains the

population parameter.

zz = 0–zc zc

Critical values

½(1 – c)

c is the area under the standard normal curve between the critical values.

½(1 – c)

The remaining area in the tails is 1 – c .

c

Use the Standard Normal Table to find the corresponding z-scores.

8

Page 9: L10 confidence intervals

zc

Level of Confidence

zzc

The corresponding z-scores are ±1.645.

• If the level of confidence is 90%, this means that we are 90% confident that the interval contains the population mean μ.

c = 0.90

½(1 – c) = 0.05½(1 – c) = 0.05

–zc = –1.645 z = 0 zc = 1.645

9

Page 10: L10 confidence intervals

Sampling Error

Sampling error• The difference between the point estimate and the

actual population parameter value.• For μ:

the sampling error is the difference x – μ μ is generally unknown

x varies from sample to sample

10

Page 11: L10 confidence intervals

Margin of Error

Margin of error• The greatest possible distance between the point

estimate and the value of the parameter it is estimating for a given level of confidence, c.

• Denoted by E.

• Sometimes called the maximum error of estimate or error tolerance.

nσE zcσ x

zc

When n ≥ 30, the sample standard deviation, s, can be used for σ.

11

Page 12: L10 confidence intervals

12

Example: Finding the Margin of Error

Use the social networking website data and a 95% confidence level to find the margin of error for the mean number of friends for all users of the website. Assume the sample standard deviation is about 53.0.

Page 13: L10 confidence intervals

zc

Solution: Finding the Margin of Error

zzcz = 0

• First find the critical values0.95

0.0250.025

–zc = –1.96

95% of the area under the standard normal curve falls within 1.96 standard deviations of the mean. (You can approximate the distribution of the sample means with a normal curve by the Central Limit Theorem, because n = 40 ≥ 30.)

zc = 1.96

13

Page 14: L10 confidence intervals

Solution: Finding the Margin of Error

40

14

c cs

n nE

z z

1.96 53.0

You don’t know σ, but since n ≥ 30, you can use s in place of σ.

16.4

You are 95% confident that the margin of error for the population mean is about 16.4 friends.

Page 15: L10 confidence intervals

Confidence Intervals for the PopulationMean

A c-confidence interval for the population mean μ•

• The probability that the confidence interval contains μis c.

n

15

x E x E where E zc

Page 16: L10 confidence intervals

Constructing Confidence Intervals for μ

Finding a Confidence Interval for a Population Mean(n ≥ 30 or σ known with a normally distributed population)

In Words In Symbols

nx x

s

(x x)2

n 1

1. Find the sample statistics n andx.

2. Specify σ, if known.Otherwise, if n ≥ 30, find the sample standard deviation s and use it as an estimate for σ.

16

Page 17: L10 confidence intervals

Constructing Confidence Intervals for μ

3. Find the critical value zc that corresponds to the given level of confidence.

4. Find the margin of error E.

5. Find the left and right endpoints and form the confidence interval.

Use the Standard Normal Table or technology.

nE

zcLeft endpoint: x E Right endpoint: x E Interval:

x E x E

17

In Words In Symbols

Page 18: L10 confidence intervals

Example: Constructing a ConfidenceInterval

Construct a 95% confidence interval for the meannumber of friends for all users of the website.

Solution: Recall x 130.8 and E ≈ 16.4

114.4 < μ < 147.2

Left Endpoint:x E 130.8 16.4 114.4

18

Right Endpoint:x E 130.8 16.4 147.2

Page 19: L10 confidence intervals

Solution: Constructing a ConfidenceInterval

114.4 < μ < 147.2

With 95% confidence, you can say that the population mean number of friends is between 114.4 and 147.2.

19

Page 20: L10 confidence intervals

Example: Constructing a ConfidenceInterval σ Known

A college admissions director wishes to estimate the mean age of all students currently enrolled. In a random sample of 20 students, the mean age is found to be 22.9 years. From past studies, the standard deviation is known to be 1.5 years, and the population is normally distributed. Construct a 90% confidence interval of the population mean age.

20

Page 21: L10 confidence intervals

zc

Solution: Constructing a ConfidenceInterval σ Known

• First find the critical values

zzc

c = 0.90

½(1 – c) = 0.05½(1 – c) = 0.05

–zc = –1.645 z = 0 zc = 1.645

21

zc = 1.645

Page 22: L10 confidence intervals

• Margin of error:

Solution: Constructing a ConfidenceInterval σ Known

20c nE

z 1.645 1.5

0.6• Confidence interval: Left Endpoint:

x E 22.9 0.6 22.3

Right Endpoint:x E 22.9 0.6 23.522.3 < μ < 23.5

22

Page 23: L10 confidence intervals

Solution: Constructing a ConfidenceInterval σ Known

22.3 < μ < 23.5

23

22.9

)

22.3 (

23.5

With 90% confidence, you can say that the mean age of all the students is between 22.3 and 23.5 years.

Point estimate

xx E x E

Page 24: L10 confidence intervals

24

Interpreting the Results

• μ is a fixed number. It is either in the confidenceinterval or not.

• Incorrect: “There is a 90% probability that the actual mean is in the interval (22.3, 23.5).”

• Correct: “If a large number of samples is collected and a confidence interval is created for each sample, approximately 90% of these intervals will contain μ.

Page 25: L10 confidence intervals

Interpreting the Results

The horizontal segments represent 90% confidence intervals for different samples of the same size. In the long run, 9 of every 10 such intervals will contain μ. μ

25

Page 26: L10 confidence intervals

2. Sample Size

• If σ is unknown, you can estimate it using s, provided you have a preliminary sample with at least 30 members.

• Given a c-confidence level and a margin of error E, the minimum sample size n needed to estimate the population mean µ is

2

26

En zc

Page 27: L10 confidence intervals

27

Example: Sample Size

You want to estimate the mean number of friends for all users of the website. How many users must be included in the sample if you want to be 95% confident that the sample mean is within seven friends of the population mean?Assume the sample standard deviation is about 53.0.

Page 28: L10 confidence intervals

zc

Solution: Sample Size

• First find the critical values

zc = 1.96

zzc

0.95

0.0250.025

–zc = –1.96

z = 0

zc = 1.96

28

Page 29: L10 confidence intervals

Solution: Sample Size

zc = 1.96 σ ≈ s ≈ 53.0 E = 7

2

29

2

E 7 220.23

n zc 1.96

53.0

When necessary, round up to obtain a whole number.

You should include at least 221 users in your sample.

Page 30: L10 confidence intervals

30

3. Confidence Intervals for the Mean(Small Samples)

• Objectives:

Interpret the t-distribution and use a t-distribution table

Construct confidence intervals when n < 30, the population is normally distributed, and σ is unknown

Page 31: L10 confidence intervals

The t-Distribution

• When the population standard deviation is unknown, the sample size is less than 30, and the random variable x is approximately normally distributed, it follows a t-distribution.

t x sn

• Critical values of t are denoted by tc.

31

Page 32: L10 confidence intervals

Properties of the t-Distribution1. The t-distribution is bell shaped and symmetric

about the mean.2. The t-distribution is a family of curves, each

determined by a parameter called the degrees of freedom. The degrees of freedom are the number of free choices left after a sample statistic such as xis calculated. When you use a t-distribution to estimate a population mean, the degrees of freedom are equal to one less than the sample size. d.f. = n – 1 Degrees of freedom

32

Page 33: L10 confidence intervals

Properties of the t-Distribution

3. The total area under a t-curve is 1 or 100%.4. The mean, median, and mode of the t-distribution are

equal to zero.5. As the degrees of freedom increase, the t-distribution

approaches the normal distribution. After 30 d.f., the t- distribution is very close to the standard normal z-distribution.

t0Standard normal curve

The tails in the t- distribution are “thicker” than those in the standard normal distribution.

d.f. = 2d.f. = 5

33

Page 34: L10 confidence intervals

Example: Critical Values of t

tc = 2.145

Find the critical value tc for a 95% confidence levelwhen the sample size is 15.

Solution: d.f. = n – 1 = 15 – 1 = 14Table 5: t-Distribution

34

Page 35: L10 confidence intervals

Solution: Critical Values of t

t

–tc = –2.145 tc = 2.145

95% of the area under the t-distribution curve with 14degrees of freedom lies between t = ±2.145.

c = 0.95

35

Page 36: L10 confidence intervals

Confidence Intervals for the PopulationMean

A c-confidence interval for the population mean μ•

• The probability that the confidence interval contains μis c.

s

36

nx E x E where E

tc

Page 37: L10 confidence intervals

Confidence Intervals and t-Distributions

2. Identify the degrees of freedom, the level of confidence c, and the critical value tc.

3. Find the margin of error E.

nx x s

(x x)2

n 1

nE tc

s

d.f. = n – 1

1. Identify the sample

statistics n, x ,

and s.

37

In Words In Symbols

Page 38: L10 confidence intervals

Confidence Intervals and t-Distributions

4. Find the left and right endpoints and form the confidence interval.

Left endpoint: x ERight endpoint: x EInterval:

x E x E

38

In Words In Symbols

Page 39: L10 confidence intervals

Example: Constructing a ConfidenceInterval

You randomly select 16 coffee shops and measure the temperature of the coffee sold at each. The sample mean temperature is 162.0ºF with a sample standard deviation of 10.0ºF. Find the 95% confidence interval for the population mean temperature. Assume the temperatures are approximately normally distributed.

Solution:Use the t-distribution (n < 30, σ is unknown,temperatures are approximately normally distributed).

39

Page 40: L10 confidence intervals

Solution: Constructing a ConfidenceInterval

• n =16, x = 162.0 s = 10.0 c = 0.95• df = n – 1 = 16 – 1 = 15• Critical Value Table 5: t-Distribution

40

tc = 2.131

Page 41: L10 confidence intervals

Solution: Constructing a ConfidenceInterval

• Margin of error:

16c nE t

2.13110

5.3

s

• Confidence interval: Left Endpoint:

x E 162 5.3 156.7

Right Endpoint:x E 162 5.3 167.3156.7 < μ < 167.3

41

Page 42: L10 confidence intervals

Solution: Constructing a ConfidenceInterval

• 156.7 < μ < 167.3

42

162.0

)

156.7 (

167.3

With 95% confidence, you can say that the population mean temperature of coffee sold is between 156.7ºF and 167.3ºF.

Point estimate

xx E x E

Page 43: L10 confidence intervals

No

Normal or t-Distribution?Is n ≥ 30?

Is the population normally,or approximately normally, distributed? Cannot use the normal

distribution or the t-distribution.Yes

Is σ known?No

If σ is unknown, use s instead.c n

Use the normal distribution with

E z

σYes

No

c nE z .

Use the normal distribution with

σ

Yes

and n – 1 degrees of freedom.

c

43

Use the t-distribution with

E t

sn

Page 44: L10 confidence intervals

Example: Normal or t-Distribution?

You randomly select 25 newly constructed houses. The sample mean construction cost is $181,000 and the population standard deviation is $28,000. Assuming construction costs are normally distributed, should you use the normal distribution, the t-distribution, or neither to construct a 95% confidence interval for the population mean construction cost?

Solution:Use the normal distribution (the population isnormally distributed and the population standarddeviation is known)

44