lecture - LICH

Download Report

Transcript lecture - LICH

Last lecture summary

2 3 6 5 3 3 1 3 4 3 5 6 5 4 1 5 5 2 4 2

Population 2014

2 3 6 5 3 3 1 3 4 3 pr ůměr = 3.3

5 pr ůměr = 1.7

4 1 5 5 5 2 6 4 2

Sample means 2014

n = 3 20 measurements

Data

5 1 4 3 1 1 6 6 5 3 5 4 4 1 4 5 1 3 2 5 4 5 5 1 3 3 5 5 2 3

Mean

3.3

1.7

5.7

4.0

3.0

3.0

3.7

3.7

3.7

3.3

Data

5 3 4 3 4 6 2 5 5 5 6 1 2 2 5 5 3 6 1 5 3 5 5 5 3 5 4 3 3 6

Mean

4.0

7.3

4.0

4.0

3.0

4.7

3.0

5.0

4.0

4.0

2014, n = 3, number of samples = 20

2014, n = 3, number of samples = 50

2014, n = 3, number of samples = 500

2014, n = 3, number of samples = 500 000

2014, n = 3, all possible samples (1 140)

2014, n = 5, all possible samples (15 504)

2014, n = 10, all possible samples (184 756)

Central limit theorem

• Distribution of sample means is normal.

• The distribution of means will increasingly approximate a normal distribution as the sample size 𝑛 increases.

• Its mean 𝑀 is equal to population mean.

𝑀 = 𝜇 𝑥 = 𝜇 • Its standard deviation 𝑆𝐸 is equal to population standard deviation divided by the square root of 𝑛 .

• 𝑆𝐸 is called

standard error

.

𝜎 𝑆𝐸 = 𝜎 𝑥 = 𝑛

ESTIMATION

Statistical inference

If we can’t conduct a census, we collect data from the sample of a population.

Goal: make conclusions about that population

Demonstration

• You sample 36 apples from your farm’s harvest of over 200 000 apples. The mean weight of the sample is 112 grams (with a 40 gram sample standard deviation).

• What is the probability that the mean weight of all 200 000 apples is within 100 and 124 grams?

What is the question?

• We would like to know the probability that the population mean is within 12 of the sample mean.

𝑃 𝜇 is within 12 of 𝑥 • But this is the same thing as 𝑃 𝑥 is within 12 of 𝜇 • But this is the same thing as 𝑃 𝑥 is within 12 of 𝑀 • So, if I am able to say how many standard deviations away from 𝑀 I am, I can use the Z-table to figure out the probability.

Slight complication

• There is one caveat, can you see it?

• We don’t know the standard deviation of a sampling distribution (standard error). We only know it equals to , but 𝜎 is uknown.

• W hat we’re going to do is to

estimate

𝜎 . Best thing we can do is to use sample standard deviation 𝑠 = 40 .

• 𝑆𝐸 = 40 6 error.

≈ 6.67

. This is our best estimate of a standard • Now you finish the example. What is the probability that population mean lies within 12 of the sample if the SE equals to 6.67?

• 92.82%

This is neat!

• You sample 36 apples from your farm’s harvest of over 200 000 apples. The mean weight of the

sample

is 112 grams (with a 40 gram sample standard deviation). What is the probability that the

population

mean weight of all 200 000 apples is within 100 and 124 grams?

• We started with very little information (we know just the sample statistics), but we can infere that with the probability of 92.82% a population mean lies within 12 of our sample mean!

Point vs. interval estimate

• You sample 36 apples from your farm’s harvest of over 200 000 apples. The mean weight of the sample is 112 grams (with a 40 gram sample standard deviation).

• Goal: estimate population mean 1.

2.

Population mean is estimated as sample mean. i.e. we say population mean equals to 112 g. This is called a

point estimate

( bodový odhad).

However, we can do better. We can estimate that our true population mean will lie with the 95% confidence within an interval of (

interval estimate

).

𝑥 ± 1.96 × 𝑠 𝑛

Confidence interval

• This type of result is called a

confidence interval

(interval spolehlivosti, konfiden ční interval).

𝑥 ± 𝑍 × 𝑠 𝑛 critical value kritick á hodnota margin of error mo žná odchylka • The number of stadandard errors you want to add/subtract depends on the

confidence level

(e.g. 95%) (hladina spolehlivosti).

Confidence level

• The desired level of confidence is set by the researcher, not determined by data.

• If you want to be 95% confident with your results, you add/subtract 1.96 standard errors (empirical rule says about 2 standard errors).

• 95% interval spolehlivosti Confidence level 80 90 95 98 99 Z-value 1.28

1.64

1.96

2.33

2.58

80%

1.28

95%

1.96

90%

1.64

99%

2.58

Small sample size confidence intervals • 7 patient’s blood pressure have been measured after having been given a new drug for 3 months. They had blood pressure increases of 1.5, 2.9, 0.9, 3.9, 3.2, 2.1 and 1.9. Construct a 95% confidence interval for the true expected blood pressure increase for all patients in a population.

• We will assume that our population distribution is normal, with 𝜇 and 𝜎 .

• We don’t know anything about this distribution but we have a sample. Let’s figure out everything you can figure out about this sample: • 𝑥 = 2.34

, 𝑠 = 1.04

• We estimate true population standard deviation with sample standard deviation 𝜎 ≈ 𝑠 = 1.04

• However, we are estimating our standard deviation with 𝑛 of only seven! This is probably goint to be not so good estimate.

• In general, if 𝒏 < 𝟑𝟎 this is considered a bad estimate.

William Sealy Gosset aka Student

• 1876-1937 • an employee of Guinness brewery • 1908 papers addressed the brewer's concern with small samples • "The probable error of a mean". Biometrika 6 (1): 1 –25. March 1908.

• Probable error of a correlation coefficient". Biometrika 6 (2/3): 302 – 310. September 1908.

Student t-distribution

• Instead of assuming a sampling distribution is normal we will use a Student t-distribution.

• It gives a better estimate of your confidence interval if you have a small sample size.

• It looks very similar to a normal distribution, but it has fatter tails to indicate the higher frequency of outliers which come with a small data set.

Student t-distribution

Student t-distribution

df – degree of freedom (stupe ň volnosti) df = 𝑛 − 1

Back to our case

• 𝑥 = 2.34

, 𝑠 = 1.04, 𝑛 = 7 • Because sample size is small, the sampling distribution of the mean won’t be normal. Instead, it will have a Student t-distribution with d. f. = 6 .

• Construct a 95% confidence interval, please 2.34 ± 2.447 × 1.04

7 = 2.34 ± 0.962

for 𝑛 < 30: 𝑛−1 × 𝑠 𝑛

• • • neco × 𝑠 𝑛 1.

2.

3.

Just to summarize, the margin of error depends on the confidence level (common is 95%) • the sample size 𝑛 as the sample size increases, the margin of error decreases • • For the bigger sample we have a smaller interval for which we’re pretty sure the true population lies.

the variability of the data (i.e. on

σ

) more variability increases the margin of error • Margin of error does not measure anything else than chance variation.

It doesn’t measure any bias or errors that happen during the proces.

It does not tell anything about the correctness of your data!!!