1 Probability and Statistics Confidence Intervals.

Post on 18-Jan-2018

233 views 4 download

description

3 doctors’ weights Standard deviation reflects the natural variability of weights in the population mean= 150 lbs; standard deviation = 15 lbs Relative frequency of 1000 observations of weight -1 SD+1 SD -2 SD +2 SD -3 SD +3 SD

Transcript of 1 Probability and Statistics Confidence Intervals.

1

Probability and StatisticsConfidence Intervals

2

Example 1: Weights of doctors

Experimental question: Are practicing doctors setting a good example for their patients in their weights?Experiment: Take a sample of practicing doctors and measure their weightsSample statistic: mean weight for the sampleIF weight is normally distributed in doctors with a mean of 150 lbs and standard deviation of 15, how much would you expect the sample average to vary if you could repeat the experiment over and over?

3

doctors’ weights

Standard deviation reflects

the natural variability of weights in the

population

mean= 150 lbs; standard deviation =

15 lbs

Relative frequency of 1000 observations of weight

-1 SD +1 SD

-2 SD +2 SD

-3 SD +3 SD

4

1000 doctors’ weights

average weight from samples of 2

-1 SD +1 SD-2 SD +2 SD

-3 SD +3 SD

4

5 average weight from samples of 10

-1 SD +1 SD-2 SD +2 SD

-3 SD +3 SD

5

6 average weight from samples of 100

-1 SD +1 SD-2 SD +2 SD

-3 SD +3 SD

6

7

Provides Range of Values Based on Observations from 1 Sample

Gives Information about Closeness to Unknown Population Parameter

Stated in terms of Probability Never 100% Sure

Confidence Interval Estimation

8

A Probability That the Population Parameter Falls Somewhere Within the

Interval.

Elements of Confidence Interval Estimation

Confidence Interval Sample Statistic

Confidence Limit (Lower)

Confidence Limit (Upper)

Population Parameter

Population Parameter

9

Parameter = Statistic ± Its

Error

Confidence Limits for Population Mean

Error

Error

Error

= Error =

10

Point estimate (measure of how confident we want to be) (standard error)

Confidence IntervalsThe value of the statistic in my

sample (eg., mean, odds ratio, etc.)

From a Z table or a T table, depending on the sampling distribution of the statistic.

Standard error of the statistic.

11

Common “Z” levels of confidence

Commonly used confidence levels are 90%, 95%, and 99%

Confidence Level Z value

1.281.6451.962.332.583.083.27

80%90%95%98%99%

99.8%99.9%

12

Approximate Confidence IntervalsApproximate Confidence Intervals The normal approximation can be used to compute approximate

confidence intervals if the sample size is large (n>30).

1.64 S.E

1.96 S.E

2.57 S.E

90% Confidence Interval

99 % Confidence Interval

95 % Confidence Interval

Margin of error

μ-1.96SE μ μ+1.96SE

Area under the normal curve = 95%

13

Expressions for C.I.’sExpressions for C.I.’s

The 90% C.I. for the population mean:

The 95% C.I. for the population mean:

The 99% C.I. for the population mean:

s is the standard deviation of the n observations.

is the sample average of n observations in a simple random sample of size n, where n is large (>30)

14

General remarks on C.I.’sGeneral remarks on C.I.’sThe purpose of a C.I. is to estimate an unknown parameter

with an indication of how accurate the estimate is and of how confident we are that the result is correct.

The methods used here rely on the assumption that the sample is randomly selected.

Any confidence interval has two parts: estimate ± margin of error

The confidence level states the probability that the method will give a correct answer, i.e. the confidence interval contains the “true” value of the parameter.

The margin of error of a confidence interval decreases as• The confidence level decreases• The sample size n increases

15

1. Notice the trade off between the margin of error and the confidence level. The greater the confidence you want to place in your prediction, the larger the margin of error is (and hence less informative you have to make your interval).

2. A C.I. gives the range of values for the unknown population average that are plausible, in the light of the observed sample average. The confidence level says how plausible.

3. A C.I. is defined for the population parameter, NOT the sample statistic.

3. To make a margin of error smaller, you can take a larger sample!

Remarks:

16

The true meaning of a confidence interval

In the following computer simulation:Imagine that the true population mean is 10. A computer took 50 samples of the same size from the same population and calculated the 95% confidence interval for each sample. Here are the results…

17

95% Confidence Intervals

18

3 misses = 6% error rate

For a 95% confidence interval, you can be 95% confident that you captured the true population value.

95% Confidence Intervals

19

Confidence Intervals for our weight example…

(Sample statistic) ± (measure of how confident we want to be) ×

(standard error)95% CI: 160 ± 1.96 × 1.5 =

157–163 lbs99% CI: 160 ± 2.58 × 1.5 =

156–164 lbsNote how the confidence intervals do

not cross the null value of 150!

20

Duality with hypothesis tests.

Null value95% confidence interval

Null hypothesis: Average weight is 150 lbs.Alternative hypothesis: Average weight is not

150 lbs.P-value < .05

150 151 152 153 154 155 156 157 158 159 160 161 162 163

21

Null value99% confidence

interval

Null hypothesis: Average weight is 150 lbs.Alternative hypothesis: Average weight is not

150 lbs.P-value < .01

150 151 152 153 154 155 156 157 158 159 160 161 162 163

Duality with hypothesis tests.

22

Practice problem1. Waiting times (in hours) at a popular restaurant are believed to be approximately normally distributed with a SD of 1.5 hr. during busy periods.

a. A sample of 20 customers revealed a mean waiting time of 1.52 hours. Construct the 95% confidence interval for the estimate of the population mean. b. Suppose that the mean of 1.52 hours had resulted from a sample of 32 customers. Find the 95% confidence interval. c. What effect does larger sample size have on the confidence interval?

23

Common “Z” levels of confidence

Commonly used confidence levels are 90%, 95%, and 99%

Confidence Level Z value

1.281.6451.962.332.583.083.27

80%90%95%98%99%

99.8%99.9%

24

Answer (a)a. A sample of 20 customers revealed a mean waiting time of 1.52 hours. Construct the 95% confidence interval for the estimate of the population mean.

1.521.96 1.520

=1.521.96 0.33( )=1.520.65

95% Confidence Interval is (0.87, 2.17)

25

Answer (b, c)b. Suppose that the mean of 1.52 hours had resulted from a sample of 32 customers. Find the 95% confidence interval.

c. What effect does larger sample size have on the confidence interval?

Makes the confidence interval narrower (more precision).

1.521.96 1.532

=1.521.96 0.27( )=1.520.53

95% Confidence Interval is (0.99, 2.05)

Example

assignmentfinal book assignment of the term !!!!!

p. 307-310 6.4-6.9