stat301distribution of sample mean - stat.tamu.edusuhasini/...of_sample_mean.pdf · mean rating of...

69
Objectives p Population versus sample (CIS, Chapter 6) p Toward statistical inference p Sampling variability p Further reading: p IPS: Section 5.1. p OS3: Section 4.1

Transcript of stat301distribution of sample mean - stat.tamu.edusuhasini/...of_sample_mean.pdf · mean rating of...

Page 1: stat301distribution of sample mean - stat.tamu.edusuhasini/...of_sample_mean.pdf · mean rating of a product. Population Sample. Sample 1: Sampling variability p This is the distribution

Objectives

p Population versus sample (CIS, Chapter 6)

p Toward statistical inference

p Sampling variability

p Further reading:

p IPS: Section 5.1.

p OS3: Section 4.1

Page 2: stat301distribution of sample mean - stat.tamu.edusuhasini/...of_sample_mean.pdf · mean rating of a product. Population Sample. Sample 1: Sampling variability p This is the distribution

Memorizeonthez-tablesp -1.28 corresponds to 10%. 1.28 corresponds to 90%

p Corresponds to 80% CI for the mean (see Chapter 6)

p -1.64 corresponds to 5%. 1.64 corresponds to 95% p Corresponds to 90% CI for the mean (see Chapter 6)

p -1.96 corresponds to 2.5%. 1.96 corresponds to 97.5%p Corresponds to 95% CI for the mean (see Chapter 6)

p - 2.57 corresponds to 0.5%. 2.57 corresponds to 99.5%p Correspond to 99% CI for the mean (see Chapter 6)

Page 3: stat301distribution of sample mean - stat.tamu.edusuhasini/...of_sample_mean.pdf · mean rating of a product. Population Sample. Sample 1: Sampling variability p This is the distribution

Amazonreviews

Page 4: stat301distribution of sample mean - stat.tamu.edusuhasini/...of_sample_mean.pdf · mean rating of a product. Population Sample. Sample 1: Sampling variability p This is the distribution

p Which tracker should I buy. How to compare them?p The smart Lintelek has the best average rating of 4.8 stars. p But the sample size for the smart Lintelek is on 58.p The other two trackers, have worse reviews (average 4.2 and 4.4), but

their sample sizes are substantially larger, 174 and 261.p How can we compare these numbers?p If more people are asked, the averages will change. p Ideally, we could compare the “true” averages (mean based on the

population). This way we can definitively say that people prefer one product to another based on their mean.

Page 5: stat301distribution of sample mean - stat.tamu.edusuhasini/...of_sample_mean.pdf · mean rating of a product. Population Sample. Sample 1: Sampling variability p This is the distribution

Ourfutureaimp Once we have completed Chapters 5, 6 and 7 we should be able to

understand the following statistical output (related to the reviews on the previous page):

p These results use that the distribution of the sample mean is close to normal, which is the purpose of this chapter.

Page 6: stat301distribution of sample mean - stat.tamu.edusuhasini/...of_sample_mean.pdf · mean rating of a product. Population Sample. Sample 1: Sampling variability p This is the distribution

Refresher:Definitionsp Sample: The part of the population

we actually examine and for which we do have data. p Examples: consumers who have

purchased the product.

p A statistic is a number describing a characteristic of a sample. Usually it is the sample average such as an amazon rating.

p Population: The entire group of individuals in which we are interested but cannot assess or observe directly.

p Examples: All online consumers.

p A parameter is a number describing a characteristic of the population. Usually it is the mean, such as the mean rating of a product.

Population

Sample

Page 7: stat301distribution of sample mean - stat.tamu.edusuhasini/...of_sample_mean.pdf · mean rating of a product. Population Sample. Sample 1: Sampling variability p This is the distribution

Sample1:Samplingvariabilityp This is the distribution (histogram) of heights in the stat301 class.

Throughout the semester, in class I have drawn 5 heights in each sample. It is the same as drawing numbers from the distribution above.Statcrunch can do exactly the same thing. We do this on the next slide.

Page 8: stat301distribution of sample mean - stat.tamu.edusuhasini/...of_sample_mean.pdf · mean rating of a product. Population Sample. Sample 1: Sampling variability p This is the distribution

p This is Statcrunch drawing a sample of 5. The top plot is the histogram of the heights (identical to the one of the previous page).

This is a sample of size 5. 68, 68, 69, 70 and 70. Similar to the 5 heights on the board.

The green bar on the bottom plot is the average of these 5 heights. Which is 69 inches.

Page 9: stat301distribution of sample mean - stat.tamu.edusuhasini/...of_sample_mean.pdf · mean rating of a product. Population Sample. Sample 1: Sampling variability p This is the distribution

Sample2:Samplingvariabilityp We draw another sample of size 5.

We draw another sample of size 5.

This time the heights are 61, 63, 65, 66, 72

The average of this is65.4Which is the green block on the bottom plot.

Page 10: stat301distribution of sample mean - stat.tamu.edusuhasini/...of_sample_mean.pdf · mean rating of a product. Population Sample. Sample 1: Sampling variability p This is the distribution

Samplingvariabilityp We have observed the variability over the past few weeks

p The sample means vary from sample to sample.

Page 11: stat301distribution of sample mean - stat.tamu.edusuhasini/...of_sample_mean.pdf · mean rating of a product. Population Sample. Sample 1: Sampling variability p This is the distribution

SamplingvariabilityAs illustrated in the previous example, for every sample taken from a population, we are likely to get a different set of individuals and calculate a different value for our statistic (such as the sample mean). This is called sampling variability.

This would suggest that the sample and the statistic contains no information about the population. However….

The good news is that, if we imagine taking lots of random samples of the same size from a given population, the variation from sample to sample—the sampling distribution—will follow a predictable pattern. All of statistical inference is based on this; to see how trustworthy a statistic is what happens of we kept repeating the sampling many times?

Page 12: stat301distribution of sample mean - stat.tamu.edusuhasini/...of_sample_mean.pdf · mean rating of a product. Population Sample. Sample 1: Sampling variability p This is the distribution

p Accuracy (bias) – Random samples provide accurate estimates of a parameter because they are unbiased (or close to unbiased, depending on the random sampling method).p This is done by sampling in a good way (ie. Randomly sampling over

the population of interest).p Typically we will assume an estimator is unbiased.p When reading an article identify the population of interest and

potentially biases which may arise.

p Reliability (variable) – A reliable estimation method is one that would give similar results if the random sampling is repeated over.p The less variable a statistic, the more reliable it is.p Random sampling enables us to measure the variability of a statistic.p We do this with the standard error – in the next slide we define what

this means.p Important: The larger the sample size, the less variable the

corresponding statistic will be.

We measure the quality of a statistic (such as the sample mean) with:

To understand the above concepts look at the question at the end of this page: http://onlinestatbook.com/2/estimation/characteristics.html

Page 13: stat301distribution of sample mean - stat.tamu.edusuhasini/...of_sample_mean.pdf · mean rating of a product. Population Sample. Sample 1: Sampling variability p This is the distribution

MeasuringVariabilityp We have come across variability before. Recall in Chapter 3 we

used the standard deviation to measure the variability in the sample. We recall that the sample standard deviation is the deviation from each observation to the sample mean:

s =

vuut 1

n� 1

nX

i=1

(Xi � X̄)2

q The same criterion is used to measure the variability in the sample mean (and all other estimators). This is called the standard error.

q More precisely, we measure the average spread from each estimator to the true mean.

q This sounds impossible. q Remarkably, we can find a very nice expression for the standard

error which requires very little effort!

Page 14: stat301distribution of sample mean - stat.tamu.edusuhasini/...of_sample_mean.pdf · mean rating of a product. Population Sample. Sample 1: Sampling variability p This is the distribution

Whatdoyoumean?p Variability of the sample mean is a very strange notion. But we have

been tracking this over the past few weeks when for each sample of heights we calculate the sample mean.

Here is the snap shot of your heights. The second column are your heights.The third column are your averages. So far this semester we have collected 31 of these. Observe that they vary from sample to sample.But just like the original heights we can evaluate its mean and standard deviation.

Page 15: stat301distribution of sample mean - stat.tamu.edusuhasini/...of_sample_mean.pdf · mean rating of a product. Population Sample. Sample 1: Sampling variability p This is the distribution

p Summary statistics of heights and average heights based on 5.

p The standard deviation of the sample mean/average of heights is substantially smaller than then the standard deviation of the heights.

p The standard deviation of the sample mean/average is called the standard error.

p It is related to the standard deviation of the heights through the formula

1.65 =4.22p

5

Page 16: stat301distribution of sample mean - stat.tamu.edusuhasini/...of_sample_mean.pdf · mean rating of a product. Population Sample. Sample 1: Sampling variability p This is the distribution

Summaryandwhat’stocomeThe techniques of statistics allow us to draw inference or conclusions about a population using the data from a sample.

p Your estimate of the population parameter is only as good as your sampling design. à Work hard to eliminate biases (design your experiment well).

p Your sample statistic is only an estimate − and if you randomly sampled again you would probably get a somewhat different result (more of this next).

p In the next section we will show:

q The distribution of the estimates (for much of the course it will be the sample mean) will (if the sample size is large enough) be normally distributed – even if the observations are not normal.

q The standard error (reliability) has a simple formula!

Page 17: stat301distribution of sample mean - stat.tamu.edusuhasini/...of_sample_mean.pdf · mean rating of a product. Population Sample. Sample 1: Sampling variability p This is the distribution

Objectivesp The mean and standard deviation of

p For normally distributed populations

p The central limit theorem (CIS, Chapter 8 and p103)

p Additional reading:

p IPS: Section 5.2

p OS3: For Standard Error see Section 4.1.3. For central limit theorem

see Section 4.2.3

x

Page 18: stat301distribution of sample mean - stat.tamu.edusuhasini/...of_sample_mean.pdf · mean rating of a product. Population Sample. Sample 1: Sampling variability p This is the distribution

Topic:Behaviorofsamplemeanp Learning objectives:

p Understand how the sampling app in Statcrunch works and why we use it.

p Understand what drawing a sample from a distribution means, and what sample size means.

p Understand that the distribution (density curve) of the data can have many different shapes. Sample size cannot change the shape.

p However, if you take the average of this sample and were able to draw several samples and take the average of each, then the distribution of the average:§ Will have less spread (variability) then the distribution of the data.§ Will be more symmetric than the distribution of the data.§ Will, for large sample sizes, be close to normal (how large depends

on how close the original data is to normal).p The spread of the sample mean is called the standard error and can be

calculated with the formula σ/√n.p You will need to use this app later, to check the reliability of the data

analysis.

Page 19: stat301distribution of sample mean - stat.tamu.edusuhasini/...of_sample_mean.pdf · mean rating of a product. Population Sample. Sample 1: Sampling variability p This is the distribution

p In class, we have been selecting 5 students (this is called a sample) and for each sample we evaluated the average height (sample mean).

p Our objective is to understand the behaviour or distribution of the average.

p We collected many samples of size 5. In total 31 were collected. The histogram of the sample mean (of these 31 samples) is below.

p To get a real idea of the shape, I would like to do this more than 31 times….and you are a bit exhausted.

Page 20: stat301distribution of sample mean - stat.tamu.edusuhasini/...of_sample_mean.pdf · mean rating of a product. Population Sample. Sample 1: Sampling variability p This is the distribution

Simulationtoolsusedp To demonstrate the concepts, I will be using an Applet in Statcrunch

called sampling distribution. It is highly recommended that you try this out yourself. p Applets -> Sampling Distributions.

p Select the distribution (from uniform etc) or choose the data table (your own data). Press compute.

Page 21: stat301distribution of sample mean - stat.tamu.edusuhasini/...of_sample_mean.pdf · mean rating of a product. Population Sample. Sample 1: Sampling variability p This is the distribution

Checkingnormalityofthesamplemeanp When the window pops up and put in your specific details.

Click on the blue box next to Sample means. Another window will then pop up with the QQplot.

By pressing the 1000 times button I have drawn 1000 samples. Whereas by doing it by hand I have only managed 31 times. The computer allows me to do it 1000 times. The green plot is the histogram of 20000 averages

Page 22: stat301distribution of sample mean - stat.tamu.edusuhasini/...of_sample_mean.pdf · mean rating of a product. Population Sample. Sample 1: Sampling variability p This is the distribution

Distributionofaverage:sample5p Let us now look at the distribution of the sample mean of all

samples of size 5. That is we sample 5 people take their height and evaluate the sample mean.

The distribution of heights

A sample of 5 people were asked their height. And their average evaluated.

This is a histogram of 20000 such averages.

Page 23: stat301distribution of sample mean - stat.tamu.edusuhasini/...of_sample_mean.pdf · mean rating of a product. Population Sample. Sample 1: Sampling variability p This is the distribution

QQplot ofaverage:sample5p Because we have 20K averages we can make a QQplot of these

sample means, of all samples of size 5 (corresponding to the histogram on the previous page).

The histogram of the sample mean is more bell-shaped than the original distribution. It is centered about the population mean of 66.7.• However, it is certainly not

normal. But there is less spread in the distribution of the averages than the original histogram.

• The QQplot shows a large deviation from normality in the tails.

Page 24: stat301distribution of sample mean - stat.tamu.edusuhasini/...of_sample_mean.pdf · mean rating of a product. Population Sample. Sample 1: Sampling variability p This is the distribution

Distributionofaverage:sample20p Let us now look at the distribution of the sample mean of all

samples of size 20. That is we sample 20 students from the population ask their height and take the sample mean.

The distribution of heights

A sample of 20 students who were asked their height. For this sample the average height is 66.25.

We do the same thing many (20K) times. Every average based on 20 students is plotted in this histogram.

Page 25: stat301distribution of sample mean - stat.tamu.edusuhasini/...of_sample_mean.pdf · mean rating of a product. Population Sample. Sample 1: Sampling variability p This is the distribution

QQplot ofaverage:sample20

p Let us now look at the QQplot of the sample mean of all samples of size 20 (corresponding to the histogram on the previous page)

Observations:

1. The histogram of the sample mean is a lot more normal than the original distribution.

2. The distribution of the sample means is centered about the population mean 66.7.

3. The spike that was seen for sample size 5 has gone

Page 26: stat301distribution of sample mean - stat.tamu.edusuhasini/...of_sample_mean.pdf · mean rating of a product. Population Sample. Sample 1: Sampling variability p This is the distribution

Distributionofaverage:sample50

p Let us now look at the distribution of the sample mean of samples of size 50.

A sample of 50 students who were sampled. For this sample the average height is 67.

We do the same thing many (20K) times. The average scores are plotted in this histogram.

Page 27: stat301distribution of sample mean - stat.tamu.edusuhasini/...of_sample_mean.pdf · mean rating of a product. Population Sample. Sample 1: Sampling variability p This is the distribution

QQplot ofaverage:sample50

p Let us now look at the QQplot of the sample mean of all samples of size 50 (corresponding to the histogram on the previous page)

Observations: 1. The histogram of the sample

mean is pretty much normal. 2. There is even less spread in

the distribution of the averages than the original histogram.

3. It is centered about the population mean 66.7.

4. The QQplot shows only a very tiny deviation from normality in the tails of the distribution.

Page 28: stat301distribution of sample mean - stat.tamu.edusuhasini/...of_sample_mean.pdf · mean rating of a product. Population Sample. Sample 1: Sampling variability p This is the distribution

Summary:Differentsamplesizes

Page 29: stat301distribution of sample mean - stat.tamu.edusuhasini/...of_sample_mean.pdf · mean rating of a product. Population Sample. Sample 1: Sampling variability p This is the distribution

Conclusionq The heights of this class do not have a normal distribution.

q The histogram shows of heights is right skewed. Standard deviation is σ= 4.3.

q If 5 student heights are sampled and the average evaluated, the distribution of the sample mean is “more symmetric than the original data”, with less spread 1.7=4.3/√5. We call

q We call 1.7 the standard error for the sample mean of size 5.

q If 50 people are interviewed and the average evaluated, the distribution of the sample mean is close to normal with less variability 0.6=4.3/√50. We call 0.6 the standard error for the sample mean of size 50.

q Variability of the sample means decreases as the sample size increases.

Page 30: stat301distribution of sample mean - stat.tamu.edusuhasini/...of_sample_mean.pdf · mean rating of a product. Population Sample. Sample 1: Sampling variability p This is the distribution

Formulaforstandarderrorp If the standard deviation of the original data is

p The formula for the standard error of the sample mean (standard deviation of sample mean) when the sample size is n is

�pn

Page 31: stat301distribution of sample mean - stat.tamu.edusuhasini/...of_sample_mean.pdf · mean rating of a product. Population Sample. Sample 1: Sampling variability p This is the distribution

q How does this help?

§ The standard error is used to explain how close to the sample mean should be from the population mean.

§ The sample mean is likely to be within a couple of standard errors of the population mean.

§ This is analogous to your height being with a few standard deviations of the population mean which is 66.7.

§ Normality of the sample mean us used to say that 95% of sample means (average heights) will be within 1.96 standard errors from the mean.

§ 1.96 comes from the normal tables (corresponds to 97.5%).

Page 32: stat301distribution of sample mean - stat.tamu.edusuhasini/...of_sample_mean.pdf · mean rating of a product. Population Sample. Sample 1: Sampling variability p This is the distribution

§ Applying this result: Near normality of the sample mean implies that 95% of of the sample means will be within 1.96 standard errors of the population mean.

§ The standard error is 4.3/√5 = 1.7.

§ There is a 95% chance the sample mean will be within 1.96 standard errors of the population mean.

§ This is the same thing as saying that there is a 95% chance the population mean will be within 1.96 standard errors of the sample mean.

§ On the board we have a sample mean based on 5. The true mean is “likely” to be within 1.96 standard errors of this sample mean.

Page 33: stat301distribution of sample mean - stat.tamu.edusuhasini/...of_sample_mean.pdf · mean rating of a product. Population Sample. Sample 1: Sampling variability p This is the distribution

QuestionTime

Page 34: stat301distribution of sample mean - stat.tamu.edusuhasini/...of_sample_mean.pdf · mean rating of a product. Population Sample. Sample 1: Sampling variability p This is the distribution

Properties:SamplemeanfornormallydistributeddataWhen a variable in a population is normally distributed, the sampling distribution of for all possible samples of size n is also normally distributed.

Note that the sample

average has less

variability than any

individual observation.

If the population is Normal(µ, s)

then the sample mean’s

distribution is Normal(µ, s/√n).

Population

Sampling distribution

x

Page 35: stat301distribution of sample mean - stat.tamu.edusuhasini/...of_sample_mean.pdf · mean rating of a product. Population Sample. Sample 1: Sampling variability p This is the distribution

Properties:Samplemeanofnon-normaldistributeddataCentral Limit Theorem: When randomly sampling from any population with mean μ and standard deviation σ (such as the distribution below), if n is large enough then the sampling distribution of is approximatelynormal: ~ N(μ, σ /√n).

Example of a non-normal distribution

x

Page 36: stat301distribution of sample mean - stat.tamu.edusuhasini/...of_sample_mean.pdf · mean rating of a product. Population Sample. Sample 1: Sampling variability p This is the distribution

Sampling distribution of

for n = 50 observations

Sampling distribution of

for n = 500 observations

x

x

Observations: The spread of the sample decreases as the sample size increases. It decreases according to the formula: σ/√n (this is called the standard error).

The more skewed the original data, the larger the sample size required for the sample mean to be close to normal.

Page 37: stat301distribution of sample mean - stat.tamu.edusuhasini/...of_sample_mean.pdf · mean rating of a product. Population Sample. Sample 1: Sampling variability p This is the distribution

QuestionTimep The distribution of heights has standard deviation 3. p A sample of one person is drawn. What is the standard error for the

average based on one?p (A) 3/1=3p (B) 3/2=1.5p (C) It is unknown.

http://www.easypolls.net/poll.html?p=59cbe9e5e4b0ede9e939139c

p A sample of 5 people is taken. What is the spread (standard error) of the average of 5 heights?p (A) 3p (B) 3/√5 = 1.34p (C) 3/5 = 0.6

http://www.easypolls.net/poll.html?p=59cbea36e4b0ede9e93913a0

Page 38: stat301distribution of sample mean - stat.tamu.edusuhasini/...of_sample_mean.pdf · mean rating of a product. Population Sample. Sample 1: Sampling variability p This is the distribution

Calculations

Page 39: stat301distribution of sample mean - stat.tamu.edusuhasini/...of_sample_mean.pdf · mean rating of a product. Population Sample. Sample 1: Sampling variability p This is the distribution

Topic:Calculationsp Learning targets:

p Be able to calculate probabilities for averages based on the average being close to normally distributed.

p Be able to assess is the sample average is close to normal based on the histogram of the data and the sample size.

p Be able to assess if the probabilities are accurate/correct based on how close the average is to normal.

p Be able to do “sum” type calculations.

Page 40: stat301distribution of sample mean - stat.tamu.edusuhasini/...of_sample_mean.pdf · mean rating of a product. Population Sample. Sample 1: Sampling variability p This is the distribution

`

Normaldata:CalculationPractice1

( ) 1100 1016 84 2.80.29.98212 50

xzn

-µ -= = = =s

In 2010 the combined SAT scores had mean 1016 and standard deviation 212. They also had approximately normal distribution.

Population distribution is Normal(μ = 1016; σ = 212).

p In Chapter 4, we used the normal distribution to show that the probability of a randomly selected student scoring 1100 or higher is 34.5%.

p Now, suppose 50 students are randomly selected and their SAT scores averaged. What is the probability that the average is greater than 1100?

Sampling distribution of the sample average when n = 50 is

Normal(μ = 1016; σ /√n = 212 /√ 50 = 29.98).

Using these values, the z-score for 1100 is

In Table A, the area to the right of 2.80 is 0.0025. So there is only a 0.25% chance that the average of 50 randomly sampled students is more than 1100. In this example we do not use the CLT because the original data is assumed normal.

Page 41: stat301distribution of sample mean - stat.tamu.edusuhasini/...of_sample_mean.pdf · mean rating of a product. Population Sample. Sample 1: Sampling variability p This is the distribution

On the left is the distribution of the SAT score for one person. The mean grade is 1016. And we see that there is a lot of variation. So 34.6% of students score more than 1100 in their SATs.

On the left is the distribution for the average SAT grade over 50students. This the average grade amongst a class of 50. The x-axis of both plots have been aligned. The average grade over 50 is clustered closer to the global average. There is less variation. The proportion of classes with an average grade over 1100 is very small; only 0.25%.

I purposely aligned the x-axis in both plots!

Page 42: stat301distribution of sample mean - stat.tamu.edusuhasini/...of_sample_mean.pdf · mean rating of a product. Population Sample. Sample 1: Sampling variability p This is the distribution

Normaldata:CalculationPractice2Hypokalemia is diagnosed when the mean μ blood potassium level is below 3.5mEq/dl. Suppose a diagnoses is made based on the blood sample. If the blood sample gives a potassium level less than 3.5 a diagnoses is made

Later we explain this is a wrong strategy and gives rise to too many false positives (false diagnoses).

Background Let us assume that a patient’s potassium levels varies daily according to the Normal(μ = 3.8, σ = 0.2) distribution (this person by definition does not have low potassium since μ = 3.8 > 3.5).Question If only one measurement is made, what is the probability that this patient will be misdiagnosed with Hypokalemia? Answer:

( ) 3.5 3.8 1.50.2

xz -µ -= = = -

sP(z < −1.5) = 0.0668 ≈ 7%.

Page 43: stat301distribution of sample mean - stat.tamu.edusuhasini/...of_sample_mean.pdf · mean rating of a product. Population Sample. Sample 1: Sampling variability p This is the distribution

Normaldata:CalculationPractice2

( ) 3.5 3.8 30.2 4

xzn

-µ -= = = -s

Question: suppose measurements are taken on 4 separate days, and the average evaluated. If the average is less than 3.5, low potassium is diagnosed. For the same patient, is the probability of a misdiagnosis?

Background A different patient arrives. Their potassium levels varies daily according to the Normal(μ = 3.5, σ = 0.2) distribution (this person by definition does not have low potassium since μ = 3.5 is not less than 3.5; they are close to the boundary).

Question (i) What is the chance of a false diagnoses based on one blood sample? (ii) What is the chance of a false diagnoses based on four blood samples?

P(z < −3) = 0.0013 ≈ 0.1%.

Page 44: stat301distribution of sample mean - stat.tamu.edusuhasini/...of_sample_mean.pdf · mean rating of a product. Population Sample. Sample 1: Sampling variability p This is the distribution

QuestionTimep Female heights are normally distributed with mean 65 inches and

standard deviation 2 inches. p The average of 9 (randomly) sampled females is taken. What is the

chance that their average height will be less than 63 inches?p (A) 99.87%p (B) 0.13%p (C) 3%p (D) 15.8%

Page 45: stat301distribution of sample mean - stat.tamu.edusuhasini/...of_sample_mean.pdf · mean rating of a product. Population Sample. Sample 1: Sampling variability p This is the distribution

Non-normaldata:CalculationPractice1p In Chapter 4 we discussed ACT scores. We argued that because the

grades were numerical discrete over a small range the grade distribution could not be normally distributed. BUT if the sample size is large enough the average will be close to normal. We recall the mean ACT score is 22 with standard deviation 5. p Question: 50 students are randomly selected and the average taken.

Calculate the proportion of averages which are greater than 20.p Answer: The mean of the sample mean has the same mean as the

original distribution, which we know is 22. The standard error of the sample mean is 5/√50 = 0.707.

On the left we have the histogram of ACT scores on the right we have the histogram of the average based on 50 pupils. The histogram of the average looks more normal.

Page 46: stat301distribution of sample mean - stat.tamu.edusuhasini/...of_sample_mean.pdf · mean rating of a product. Population Sample. Sample 1: Sampling variability p This is the distribution

p Answer: The mean of the sample mean has the same mean as the original distribution, which we know is 22. The standard error of the sample mean is 5/√50 = 0.707. We use this to make the z-transform

Looking up the z-tables using a computer we see that probability is 99.7%. This means there is a very large chance the average grade in a class of size 50 is greater is than 20.

z =20� 22

0.707= �2.82

Page 47: stat301distribution of sample mean - stat.tamu.edusuhasini/...of_sample_mean.pdf · mean rating of a product. Population Sample. Sample 1: Sampling variability p This is the distribution

Non-normaldata:CalculationPractice2p In Chapter 4 we discussed ACT scores. We argued that because the

grades were numerical discrete over a small range the grade distribution could not be normally distributed. BUT if the sample size is large enough the average will be close to normal. We recall the mean ACT score is 22 with standard deviation 5. p Question: 10 students are randomly selected and the average taken.

Calculate the proportion of averages which are greater than 20.p Answer: The mean of the sample mean has the same mean as the

original distribution, which we know is 22. The standard error of the sample mean is 5/√10 = 1.58.

p Again we use the normal distribution to calculate this chance (but keeping in mind that the sample size size is only 10, and the CLT may not be completely valid).

p The z-score is

p Find the area to the right of -1.26 gives 89%. There is an 89% chance the average grade in a class of 10 is over 20.

z =20� 22

1.58= �1.26

Page 48: stat301distribution of sample mean - stat.tamu.edusuhasini/...of_sample_mean.pdf · mean rating of a product. Population Sample. Sample 1: Sampling variability p This is the distribution

Non-normaldata:CalculationPractice3p Let us return to the weights of calves at 0.5 weeks.

q Question 1: Using the normal density calculate the proportion of calves that weight more than 100 pounds.

q Answer: Make a z-transform=(100-90.11)/7.7 =1.28. This corresponds to 90% in the z-tables. Therefore, if the calf weights follow a normal distribution, 10% of calves will weight more than 100 pounds.

q Looking at the plot, it seems that a normal density (with mean 90.11 and standard deviation 7.7) is a roughapproximation of the underlying distribution of calves weights (see also the QQplot given at the end of Chapter 4).

Page 49: stat301distribution of sample mean - stat.tamu.edusuhasini/...of_sample_mean.pdf · mean rating of a product. Population Sample. Sample 1: Sampling variability p This is the distribution

p Question (b): Let us suppose that the sample mean of 10 calves is taken. From the histogram of the sample mean, we see that it is close to normal. Using the normal distribution, what proportion of the sample means (based on samples of size 10) will be greater than 100 pounds?

p Answer: The mean of the sample mean is the same as the mean weight of cows which is 90.11. The standard error of the sample mean is 7.7/√10 = 2.4. By making the z-transform we have z=(100-90.11)/2.4 = 4.12. Looking up the z-tables, we see that it is in the far upper tails; the probability is close to 0%.

Page 50: stat301distribution of sample mean - stat.tamu.edusuhasini/...of_sample_mean.pdf · mean rating of a product. Population Sample. Sample 1: Sampling variability p This is the distribution

Conceptualunderstandingq Of the two calf probabilities calculated in Practice 3, which is

closest to the true proportion based on the correct distribution? q Both probabilities were calculated using the normal distribution.

But this is only an approximation of the true distribution of calf weights and sample mean of calf weights. From the histogram of calf weights we see that is only approximately normal. This means it is unlikely that the proportion calculated for the weight of one calf is exactly 10%.

q On the other hand the Central Limit Theorem tells is that the distribution of the sample mean gets closer to normal as the sample size grows. The second proportion we calculated was based on the average weight of 10 calves. The distribution of the average is closer to normal than the distribution of weights of single calves. This means the second proportion (of nearly 0%) will be closer to the true proportion based on the distribution of the sample mean (which is the green histogram on the previous slide).

Page 51: stat301distribution of sample mean - stat.tamu.edusuhasini/...of_sample_mean.pdf · mean rating of a product. Population Sample. Sample 1: Sampling variability p This is the distribution

QuestionTime(windchill 1)p Wind chill is the perceived decrease in air temperature felt by the

body due to wind.

The mean is -28 and the standard deviation is 36.

Assuming normality of the sample mean, calculate the chance the average wind chill factor over 3 consecutive days will be more than zero.

A. 77.7% B. 78.1% C. 8.9% D. 91.1%

Page 52: stat301distribution of sample mean - stat.tamu.edusuhasini/...of_sample_mean.pdf · mean rating of a product. Population Sample. Sample 1: Sampling variability p This is the distribution

QuestionTime(windchill 2)

Base on the plot and QQplot of the data, is the probability calculated on the previous slide close to the true probability calculated if one were able to obtain the histogram of all averages of sample size 3?

A. Yes, because the average will be normal.B. No, because the data is (thick tailed), clearly not normal. So an average

based on 3 is not enough to invoke the CLT.

Page 53: stat301distribution of sample mean - stat.tamu.edusuhasini/...of_sample_mean.pdf · mean rating of a product. Population Sample. Sample 1: Sampling variability p This is the distribution

Windchill averagebasedon3p We draw many samples each of size 3 from the windchill data and

evaluate the average for each sample. A QQplot of these averages is given below.

We see that the average based on three is still not normally, and there is a large deviation in the tails, especially larger than 0 (for the sample mean).

This means the probability calculated two slides back, which is based on the normal distribution will not be close to the true probability (based on the histogram of all averages).

Page 54: stat301distribution of sample mean - stat.tamu.edusuhasini/...of_sample_mean.pdf · mean rating of a product. Population Sample. Sample 1: Sampling variability p This is the distribution

Continued….

The lack of normality means the probability calculated two slides back (using the normal distribution) will not be close to the true probability (using the true histogram of averages).

The top plot is the true histogram of the averages. The bottom plot is the normal approximation. The probability we want to calculate is the green area to the right of 0. The normal probability is the red area. They do not exactly match. This mismatch is because the green histogram is not exactly normal.

Page 55: stat301distribution of sample mean - stat.tamu.edusuhasini/...of_sample_mean.pdf · mean rating of a product. Population Sample. Sample 1: Sampling variability p This is the distribution

Windchill averagebasedon30p We draw many samples each of size 30 from the windchill data and

evaluate the average for each sample. A QQplot of these averages is given below.

We see that the average based on 30 is very close to normal.

This means any calculations which involve the averages over 30 days and the normal distribution will be close to the truth.

Page 56: stat301distribution of sample mean - stat.tamu.edusuhasini/...of_sample_mean.pdf · mean rating of a product. Population Sample. Sample 1: Sampling variability p This is the distribution

Applicationto“sum”problems

Page 57: stat301distribution of sample mean - stat.tamu.edusuhasini/...of_sample_mean.pdf · mean rating of a product. Population Sample. Sample 1: Sampling variability p This is the distribution

Somemaths madeeasyp Question Suppose there are 5 bicycle racks outside Blocker and the

average number of cycles on each of the 5 racks is 20, how many cycles are there altogether?

p Answer: The answer is 100.p Why: The Sum is always

p Or using mathematical symbols:

p Since the sample mean is normal, this allows us to place calculate probabilities using sums.

Total Sum = Average⇥ Sample size

Total Sum =

nX

i=1

Xi = Sample Mean⇥ Sample size =

¯X ⇥ n

Page 58: stat301distribution of sample mean - stat.tamu.edusuhasini/...of_sample_mean.pdf · mean rating of a product. Population Sample. Sample 1: Sampling variability p This is the distribution

Sums:Calculationpracticep A farmer wants to use a vehicle to carry 30 0.5 week old calves. The

vehicle he plans to use can carry a maximum load of 2760 pounds. He knows that the mean weight of a calf is 90.11 pounds and the standard deviation is 7.7. What is the chance the vehicle can carry the calves? p We need to transform the total weight into the sample mean. We

observe, if the total weight of 30 calves needs to be less than 2760 pounds this is the same as the sample mean weight of 30 calves must be less than 2760/30 = 92:

30X

i=1

Xi < 2760 ) X̄ =1

30

30X

i=1

Xi <2760

30

Therefore, we have turned the problem from totals into averages and apply the CLT to calculate the probability using the normal distribution.

Page 59: stat301distribution of sample mean - stat.tamu.edusuhasini/...of_sample_mean.pdf · mean rating of a product. Population Sample. Sample 1: Sampling variability p This is the distribution

Calculationpractice(cont)p We know from the central limit theorem that the sample mean is close to

normally distributed. Thus the distribution of the sample mean is normal with mean 90.11 and standard deviation 7.7/√30 = 1.4.

p We know that for the vehicle to carry the calves, the sample mean has to be less than 92 pounds.

p Calculate the z-transform

p Look up the z-tables to get 91.1%. There is a 91.1% chance the sample mean will be less than 92 pounds. This is the same was there being a 91.1% chance the total weight of 30 calves will be less than 2760 pounds.

p Conclusion: 91.1% of the time the vehicle the will be carrying 30 calves legally.

P

30X

i=1

Xi < 2760

!= P

X̄ =

1

30

30X

i=1

Xi <2760

30

!= P (Z < 1.35) = 0.911

z =92� 90.11

1.2= 1.35

Page 60: stat301distribution of sample mean - stat.tamu.edusuhasini/...of_sample_mean.pdf · mean rating of a product. Population Sample. Sample 1: Sampling variability p This is the distribution

QuestionTimep Suppose the mean number of cans of lemonade consumed per

person at a party is 3 and the standard deviation is one. p A host is planning a party and is trying decide how many cans of

lemonade to purchase for the party. Suppose 200 people attend the party.

p Using the normal distribution (since averages based on a sample size of 200 may be close to normal), what is the chance/probability that they will need to purchase more than 700 cans of lemonade?p (A) 0%p (B) 0.9%p (C) 99.1%p (D) 100%

Page 61: stat301distribution of sample mean - stat.tamu.edusuhasini/...of_sample_mean.pdf · mean rating of a product. Population Sample. Sample 1: Sampling variability p This is the distribution

In many cases, even n = 40 is not large enough to

give results reliable enough when there is a lot at

stake. This is why clinical trials, political polls and

marketing surveys typically observe 100’s or even

1000’s of individuals.

Howlargeisalargeenoughsamplesize?It depends on the population distribution. More observations are required if the population distribution has a large standard deviation or if it is far from normal in distribution.

p A sample size of 25 is generally enough to obtain a normal sampling distribution from a population with some skewness or even mild outliers.

p A sample size of 40 will typically be good enough to overcome some skewness and outliers.

p More importantly, n should be large enough to make the standard error sufficiently small – then we can get meaningful and precise inferences.

p We can check this by using the Sampling distribution applet.

Page 62: stat301distribution of sample mean - stat.tamu.edusuhasini/...of_sample_mean.pdf · mean rating of a product. Population Sample. Sample 1: Sampling variability p This is the distribution

Theeffectofskewness ontheCLTBelow we look at the sample mean taken from data with a large right skew

This distribution is clearly right skewed.

This is is the distribution of the average of 20 observations drawn from the above right skewed distribution. We see that the means of both distributions are aligned (as we would expect). The distribution of the average is less skewed, but it still is skewed.

Page 63: stat301distribution of sample mean - stat.tamu.edusuhasini/...of_sample_mean.pdf · mean rating of a product. Population Sample. Sample 1: Sampling variability p This is the distribution

ThecorrespondingQQplot ofthesamplemeanObservations: 1. The QQplot deviates from

normality in the tables, especially in the tails. The distribution of the sample mean still has a slight right skew (look back at the QQplots in Chapter 4). This demonstrates that when data is highly skewed, we need a much large sample size for the CLT to kick in.

2. Calculations based on normality of the the average will not be completely correct.

Page 64: stat301distribution of sample mean - stat.tamu.edusuhasini/...of_sample_mean.pdf · mean rating of a product. Population Sample. Sample 1: Sampling variability p This is the distribution

EffectofbinarydataontheCLTBinary data arises in several situations where ever there are only two possible choices eg. Like or Dislike.

In this example, we have encrypted one outcome with zero and the other with 1 (it does not really matter which way). We see that the proportion in the one category is about 20% - this is what is meant by the mean. This data is discrete and clearly skewed.

Page 65: stat301distribution of sample mean - stat.tamu.edusuhasini/...of_sample_mean.pdf · mean rating of a product. Population Sample. Sample 1: Sampling variability p This is the distribution

ThecorrespondingQQplot ofthesamplemeanObservations: 1. We see that the standard

error is 0.0571 = 0.405/√50, which is as it should be.

2. However, the QQplotdeviates far from normality in the tables. The lines across demonstrate that the average over 50 still takes discrete values (though not integers). We also see a U shape that shows that the sample mean is still skewed.

3. Calculations based on normality of the the average will not be completely correct.

Page 66: stat301distribution of sample mean - stat.tamu.edusuhasini/...of_sample_mean.pdf · mean rating of a product. Population Sample. Sample 1: Sampling variability p This is the distribution

QuestionTimeLet’s consider the very large database of individual incomes from the Bureau of Labor Statistics as our population. Income is strongly right skewed.

p We take 1000 SRSs of 25 incomes, calculate the sample mean for each, and make a histogram of these 1000 means.

p We also take 1000 SRSs of 100 incomes, calculate the sample mean for each, and make a histogram of these 1000 means.

Which histogram corresponds to samples of size 100? Which to samples of size 25?

(A) Left = sample size 25, Right = sample size 100

(B) Left = sample size 100. Right = sample size 25.

http://www.easypolls.net/poll.html?p=59cc0140e4b0ede9e93913db

Page 67: stat301distribution of sample mean - stat.tamu.edusuhasini/...of_sample_mean.pdf · mean rating of a product. Population Sample. Sample 1: Sampling variability p This is the distribution

Somanystandarddeviations!In statistics we talk about different kinds of standard deviations, and it can be hard to keep track of them:p s is the standard deviation of a set (sample) of data. It is a statistic

we can compute once we have the data.p σ is the standard deviation of a population (which is much too big to

observe completely). It is a parameter – usually, we will never know its true value.

p σ /Ön is the standard deviation of the values of from all possible random samples of size n. It refers to the sample mean, not to data.It is also called the standard error of .

p s /Ön is our estimate of σ /Ön, since we do not know the value of σ.

x

x

From a survey of students taking statistics, n = 459 responded to the question “How many Facebook friends do you have?” The sample mean was = 566.9 and the sample standard deviation was s = 589.5. The standard error for the sample mean is s /Ön = 589.5/Ö459 = 27.52.

is an estimate for μ = mean of the population of all students required to take the class and s is an estimate for the population standard deviation σ.

x

x

Page 68: stat301distribution of sample mean - stat.tamu.edusuhasini/...of_sample_mean.pdf · mean rating of a product. Population Sample. Sample 1: Sampling variability p This is the distribution

Summary

p is always unbiased for μ, even if the population’s distribution is very different from a normal distribution.

p The standard deviation of , σ /√n, measures the variability due to random sampling.

p If the population is approximately normal or if the sample size n is large, we can use the normal distribution to compute probabilities for

. We just have to remember to use σ /√n, not σ, in the denominator when calculating z.

p This means we can say something about how close is likely to be to μ. Generally it is quite likely (95% chance) that it will be within 2 standard errors of μ.

p Not all variables are normally distributed and large samples are not always attainable. In such circumstances, a statistician should be consulted for proper methods of statistical inference and calculation.

x

x

x

x

Page 69: stat301distribution of sample mean - stat.tamu.edusuhasini/...of_sample_mean.pdf · mean rating of a product. Population Sample. Sample 1: Sampling variability p This is the distribution

AccompanyingproblemsassociatedwiththisChapter

p Quiz 5p Quiz 6p Homework 2, Q6.p Homework 3.