Upload
vuongliem
View
223
Download
0
Embed Size (px)
Citation preview
1
STAT 110
CHAPTER 4: INFERENTIAL METHODS FOR A SINGLE NUMERICAL
VARIABLE
In this chapter, we will consider inferential methods (hypothesis tests and confidence intervals)
for the mean of a single numerical variable. Consider the following example.
Example 4.1: Consider a study in which the weight of insulin-dependent diabetics is being
investigated. The variable of interest is the percent of their ideal body weight. For example,
a value of 120% implies that the individual weighs 20% more than their ideal weight, and a
value of 95% implies that the individual weighs 5% less than their ideal body weight. The
data from the table below are also given in the file Diabetics.JMP.
107 119 99 114 120 104 88 114 124
116 101 121 152 100 125 114 95 117
We can use JMP to summarize the data as follows:
Questions:
1. What is the mean of the observed data? The standard deviation?
2. If another sample of n=18 patients were obtained, would these new individuals have
a mean exactly the same as the mean from this sample? Why or why not?
3. Given your answer to the previous question, do you think it is appropriate to use
only this sample mean to make inferences about the true ideal body weights in the
greater population of insulin-dependent diabetics? Explain.
2
THE SAMPLING DISTRIBUTION OF THE SAMPLE MEAN
The sample mean is a random quantity; that is, it changes from sample-to-sample. Therefore,
the sample mean does have a distribution. Recall that this distribution will tell us two things:
1. What values the sample mean can assume
2. How often it will assume these values
This distribution is referred to as the sampling distribution of the sample mean. An
understanding of this sampling distribution allows us to make decisions about a population
mean for a single numerical variable. When we make decisions about the population mean, we
will use both of the following:
1. The sample mean (observed from our data)
2. The sampling distribution of the sample mean
As we saw in Chapter 2 when dealing with proportions, using this sampling distribution will
permit us to attach a level of confidence to our decision.
Exploring the Sampling Distribution of the Sample Mean
Before we discuss the procedure for inference, let’s consider the next activity to gain a better
understanding of how this particular sampling distribution works.
Example 4.2: Another “simulation study”….
Suppose we set up a hypothetical population of 500 insulin-dependent diabetics. This
population has been purposefully created so that the mean percent ideal body weight is
100%.
Questions:
1. Look at the histogram. What can you say about the shape of the distribution?
2. In this simulation study, what is our value of μ, the true population mean?
3
Note that in reality, the true population mean is usually an unknown quantity which we are
trying to estimate. If it were impossible or infeasible to collect data on the entire population, we
would take a sample from the population in order to estimate the average of the percent ideal
body weights. Let’s see what happens when we take various samples of size 5 from this
population. Take your first random sample of size 5, and record the percent ideal body weight
for each person in your sample. Then, find the mean for each sample. Repeat this procedure
two more times.
Person % ideal body
weight
1
2
3
4
5
Sample 1: 1x = ______
Person % ideal body
weight
1
2
3
4
5
Sample 2: 2x = ______
Person % ideal body
weight
1
2
3
4
5
Sample 3: 3x = ______
Next, repeat this procedure; however, this time you should take samples of size 10.
Person % ideal body
weight
1
2
3
4
5
6
7
8
9
10
Sample 1: 1x = ______
Person % ideal body
weight
1
2
3
4
5
6
7
8
9
10
Sample 2: 2x = ______
Person % ideal body
weight
1
2
3
4
5
6
7
8
9
10
Sample 3: 3x = ______
Questions:
1. Consider the means calculated from your random samples of size 5. We will use
the entire class’s data to construct a histogram of the sample means. Based on
the histogram, what can you say about the shape of the distribution?
2. How does the amount of variability in this sampling distribution compare to the
amount of variability in the original population? Why does this happen?
4
3. Next consider the means calculated from your random samples of size 10. Again, we
will use the class data to construct a histogram of these sample means. What can you
say about the shape of this distribution?
4. How does the amount of variability in this sampling distribution compare to the amount
of dispersion in the sampling distribution for samples of size 5? Why does this happen?
Next, let’s see what happens when we take many more samples than we did in class. The
following output shows the results from one-thousand random samples of size 5 and one-
thousand random samples of size 10.
5
Questions:
1. How does the shape of the sampling distribution change as the sample size increases?
2. How does the amount of variability in the sampling distribution change as the sample
size increases?
3. How does the center of the sampling distribution compare to this true population mean?
4. Given a sample size of 18, does a sample mean of 112.78 seem likely to occur by chance
if the true mean is really 100? What does this say about our research question?
6
Characteristics of the Distribution of the Sample Mean
To characterize the sampling distribution of the sample mean, we need to describe its center,
shape, and amount of variability (or dispersion).
1. The mean (or center) of the distribution of the sample mean is the same as the mean of
the original distribution.
Comment: We often use µ to denote the mean of a distribution. Therefore, the mean of the
sampling distribution is also µ.
2. The standard deviation (which measures variability, or dispersion) of the distribution of
the sample mean decreases as the sample size gets larger. Specifically, if we let σ denote
the standard deviation of the original distribution, then the standard deviation of the
distribution of the sample mean is given by
n
σ.
This quantity is often referred to as the standard error of the sample mean.
Central Limit Theorem for the Sample Mean
Consider a random sample of n observations from ANY population with mean µ and standard
deviation σ. Then, when n is sufficiently large, the sampling distribution of x will be
approximately a NORMAL distribution with a mean of µ and a standard deviation of n
σ.
Moreover, this approximation gets better as the sample size (n) increases.
Question: How large does n have to be?
If the original population is normally distributed, then the sampling distribution of the
mean will also be normally distributed regardless of the sample size (check this using
the applet mentioned below).
For most populations, samples of size n ≥ 30 or 40 will be sufficient to say that the
distribution is approximately normal.
The more skewed the distribution, the larger the sample size must be before the normal
approximation fits the sampling distribution well. If the distribution is very skewed, the
sample size may have to be much larger than 30!
You can experiment with various sample sizes using an applet found at the following web
address: http://onlinestatbook.com/stat_sim/sampling_dist/index.html.
7
Back to Example 4.1: Recall the study in which the weight of insulin-dependent diabetics is
being investigated. Some summaries from JMP are shown below.
Research Question: Does this data provide evidence that the mean percent of ideal body weight
for insulin-dependent diabetics differs from 100?
As mentioned at the beginning of this chapter, we know that the sample mean is a random
variable. For our sample, x =112.78. This probably would not be the case if another sample
were taken. Our goal is to use what we just learned about the sampling distribution of the
mean in addition to our sample mean x =112.78 to decide whether we have evidence that the
true POPULATION mean of percent ideal body weight differs from 100.
Consider these characteristics of the distribution of the sample mean for this example:
Center: The distribution of the sample mean for this example will be centered at a mean
of µ = 100 (assuming the null hypothesis is true).
Shape: Based on the Central Limit Theorem, the distribution for the sample mean will
be approximately normal IF
1. The sample size is sufficiently large, OR
2. The original distribution is approximately normally distributed.
Variability: The standard error of the distribution of the sample mean is n
σ.
Problem: What is σ? This is an unknown parameter (the population standard
deviation).
Solution: In practice, we will use the sample standard deviation s, which is our best
guess for the population standard deviation. That is, we will use
standard error of the distribution of the sample mean = n
s.
8
THE T-DISTRIBUTION
To determine whether or not the distance between µ (the hypothesized population mean) and
x (the mean from our observed sample) is larger than what we would expect by random
chance, we will use the following statistic:
ns
μxt
.
This new t-statistic comes from what is called a t-distribution. This is bell-shaped, symmetric,
and centered at zero—just like the normal distribution. The difference is that the t-distribution
is more variable than the standard normal distribution.
The amount of variability in a t-distribution depends on the sample size n. Therefore, this
distribution is indexed by its degrees of freedom (df).
For inference on a single mean, df = n - 1.
Consider the following t-distributions:
Questions:
1. Calculate the t-statistic for the data in Example 4.1:
ns
μxt
=
9
2. What does this t-statistic as a whole measure?
3. The distribution of the sample mean (under the null hypothesis) for this example is
pictured below. This helps us determine what values for the sample mean are unlikely
to occur by chance.
Based on the position of this test statistic on the above sampling distribution, do you
think that the sample mean from our observed data was likely to occur by random
chance alone? Given your answer to this question, what do you think about the null
hypothesis that the true mean percent ideal body weight for insulin-dependent diabetics
is 100? Explain.
10
A HYPOTHESIS TEST FOR A SINGLE MEAN
Step 0: Check the assumptions behind the test to be sure that the t-test is valid.
For this particular hypothesis test, we must consider the following:
a. If the sample size is sufficiently large, then the t-test is valid.
b. If the sample size is not sufficiently large, then it must be reasonable
to assume the population is normally distributed in order for the t-test
to be valid.
Step 1:
Convert the research question into Ho and Ha.
Step 2:
Determine α, the error rate. The default error rate is 5%. This implies that
decisions will be made with 95% confidence.
Step 3:
Calculate a test statistic from your data. For this test, the test statistic is
ns
μxt
Step 4:
Determine the p-value and make a decision concerning Ho. As we have seen,
the p-value is the probability (assuming H0 is true) of observing a value of the
test statistic that is at least as contradictory to the null hypothesis as the actual
test statistic computed from the sample data.
Lower-Tailed Test
(Ha contains <)
Upper-Tailed Test
(Ha contains >)
Two-Tailed Test
(Ha contains ≠)
Decision Rule: If the p-value is less than α, then the data supports the
alternative hypothesis. That is, we reject H0.
Step 5:
Write a conclusion in terms of the original research question. You should
state your p-value in your conclusion.
11
Back to Example 4.1: Carry out the hypothesis test to determine whether we have evidence that
the mean percent ideal body weight of insulin-dependent diabetics differs from 100.
Step 0: Check the assumptions behind the test to be sure that the test is valid.
a. Is the sample size sufficiently large?
b. If the sample size is not large, is it reasonable to assume the population
is normally distributed?
To check this assumption, we can examine a histogram of the data.
The following histogram shows both a smooth curve and a normal
curve superimposed on the data:
Question: Do the data appear to APPROXIMATELY follow a normal
distribution? Explain.
We can also use a normal quantile plot to assess normality.
If all points fall on or near the red reference line, this indicates that the
data are approximately normally distributed.
12
Step 1:
Convert the research question into Ho and Ha.
Ho: The mean percent ideal body weight of insulin-dependent diabetics is 100.
Ha: The mean percent ideal body weight of insulin-dependent diabetics differs
from 100.
Equivalently, we can state the hypotheses as follows:
Ho:
Ha:
Step 2:
Determine α, the error rate.
Step 3:
Calculate a test statistic from your data. For this test, the test statistic is
ns
μxt
=
In JMP, select Test Mean from the red-drop down arrow next to the variable
name. Enter the value from the null hypothesis in the Specify Hypothesized
Mean box:
Click OK, and JMP returns the following:
13
Step 4:
Determine the p-value and make a decision concerning Ho.
p-value:
Step 5:
Write a conclusion in terms of the original research question. You should
state your p-value in your conclusion.
“We have evidence that the mean percent ideal body weight of insulin-
dependent diabetics differs from 100 (p-value=.0016).”
14
CONFIDENCE INTERVAL FOR A SINGLE POPULATION MEAN
In the previous example, we have shown that we do have evidence which indicates that the
mean percent ideal body weight of insulin-dependent diabetics differs from 100. Our next
question is obvious: HOW MUCH does it differ? To answer this question, we must construct a
confidence interval.
Recall our discussion of confidence intervals from Chapter 1:
This procedure does NOT require any hypotheses concerning our population parameter of
interest (the mean, in this case). We will use both our sample data (in particular, the
observed mean) and the appropriate sampling distribution to obtain a range of likely values
for our population mean.
Comments:
1. A confidence interval allows us to estimate the population parameter of interest
(recall that the hypothesis test does NOT allow us to do this). Therefore, when
available, a confidence interval should always accompany the hypothesis test.
2. Because the confidence interval does not require any hypothesized value for the
population parameter, we can’t center our sampling distribution about the “true” or
hypothesized population mean. However, the confidence interval will still
incorporate both the data collected in our sample and what we know about sample-
to-sample variation. Consider the following example.
Example 4.3: Our goal is to construct a 95% confidence interval for the mean percent ideal body
weight of insulin-dependent diabetics. To do this, we will center our sampling distribution
at the observed mean. Then, we will find the lower and upper endpoints that separate the
middle 95% of the distribution from the rest (since we are constructing a 95% confidence
interval).
15
JMP automatically provides the endpoints of the 95% confidence interval:
Questions:
1. Interpret the meaning of this interval. What does this interval tell us about the true
percent of ideal body weight?
2. Does this interval agree with what you learned from the hypothesis test? Explain.
3. What additional information is gained by using a confidence interval over a simple
hypothesis test? Explain.
Margin of Error: Recall that the margin-of-error is defined as the distance between the center of
the confidence interval and either endpoint. For this problem, we have
Upper Endpoint – Center of Interval = 119.951 - 112.778 = 7.173
Center of Interval – Lower Endpoint = 112.778 – 105.605 = 7.173
So, the margin of error for this problem is ±7.173.
Question: Can you identify at least two ways to make this margin of error smaller?
1.
2.
16
Changing the Confidence Level in JMP
Recall the 95% confidence interval for the population mean:
To change the level of confidence, click on the red-drop down arrow and select Confidence
Interval.
The following will construct a 90% confidence interval for the mean:
Question: Did the margin of error change as you thought it should?
17
More On The Interpretation Of Confidence Intervals
The 95% refers to the process of constructing the confidence interval. This means that if we
were to take 100 samples of size 18, constructing a confidence interval each time, we would
expect 95% of them to capture the true population mean. Consider the following example:
Example 4.4: Our goal is to take samples from a population in order to estimate the true
population mean. Shown below are 10 random samples of size n = 5. Construct a
confidence interval for each of the samples.
Sample ID Data from
Sample
Sample Statistics 90% Confidence Interval
1
12.49983
11.4342
8.210933
7.373925
8.776002
Mean 9.65898
Std Dev 2.19771
7.56 ≤ μ ≤ 11.75
2
5.655407
8.903349
12.98215
10.22548
6.172528
Mean 8.78778
Std Dev 3.01349
5.91 ≤ μ ≤ 11.66
3
8.181802
12.08606
6.176875
5.556382
5.822172
Mean 7.56466
Std Dev 2.73035
4.96 ≤ μ ≤ 10.17
4
13.19405
5.122735
2.469639
7.373925
6.401793
Mean 6.91243
Std Dev 3.96465
3.13 ≤ μ ≤ 10.69
5
9.293009
10.52984
7.260893
10.50763
7.431728
Mean 9.00462
Std Dev 1.59555
7.31 ≤ μ ≤ 10.71
6
9.303573
2.354969
8.811873
17.06401
10.45554
Mean 9.59799
Std Dev 5.23552
4.6 ≤ μ ≤ 14.6
18
7
10.91127
8.023941
8.432168
14.17466
8.603912
Mean 10.02919
Std Dev 2.57711
7.58 ≤ μ ≤ 12.48
8
11.53353
5.782364
11.44628
10.61424
-1.68752
Mean 7.53778
Std Dev 5.67659
2.13 ≤ μ ≤ 12.95
9
8.197059
6.193274
9.114461
6.290799
9.661013
Mean 7.89132
Std Dev 1.59424
6.37 ≤ μ ≤ 9.41
10
6.53196
12.08221
6.81856
13.46314
9.183324
Mean 9.61584
Std Dev 3.09866
6.67 ≤ μ ≤ 11.75
A graphical representation of the intervals is presented below:
Questions:
1. Why are some of the 90% confidence intervals wider than others?
2. In truth, these 10 random samples were generated from a population with a mean of 10.
How many of the confidence intervals captured this true mean? What does it mean to
say that we are 90% confident?
19
ANOTHER EXAMPLE: INFERENCE FOR A SINGLE POPULATION MEAN
Example 4.5: The State Environmental Protection Agency (SEPA) is responsible for monitoring
the air pollution level for a large western metropolis. The air pollution level is considered to
be acceptable (or safe) if the mean pollution level is at or below a reading of 100 mg of
pollution per cubic yard of air. Air pollution levels substantially above the 100 mg/yd3 are
considered to be dangerous. To monitor air pollution levels, the SEPA will take a pollution
reading 10 times a day. If the evidence from this sample suggests that the air pollution
levels are unacceptable, then the SEPA must declare an air pollution emergency and must
impose emergency measures to reduce pollution levels. Suppose that the readings for one
day are as given in the following table (the data can be found in the file Pollution.JMP).
Question of Interest: Are the pollution levels unacceptable?
Pollution Level
(mg/yd3)
98.6
100.2
101.1
105.3
99.4
112.5
95.6
108.9
112.9
105.1
First, we select Analyze > Distribution to observe summaries of Pollution Level.
Then, we carry out the hypothesis test:
20
Step 0: Check the assumptions behind the test to be sure that the test is valid.
a. Is the sample size sufficiently large?
b. Is it reasonable to assume the population is normally distributed?
Step 1: Convert the research question into H0 and Ha.
Ho:
Ha:
Step 2: Determine α, the error rate.
Step 3: Calculate a test statistic from your data. We can use JMP as follows:
21
Mean of Error Standard
Value edHypothesiz - Mean Observed
ns
μx Statistic Test
Step 4: Determine the p-value and make a decision regarding H0.
p-value:
Step 5: Write a conclusion in terms of the original research question.
“We do not have enough evidence to conclude that the pollution levels are
unacceptable (p-value = .3208).”
22
Finally, we can compute and interpret the 95% confidence interval for this problem.
Interpretation: This means that we are 95% confident the true mean pollution level is between
98.37 and 102.51 mg/yd3.
THE WILCOXON SIGNED RANK TEST
When problems with normality in the data are present, there exists an alternative to the
standard t-test: the Wilcoxon Signed Rank test. This procedure does not require that the data
be normally distributed; however, THE DATA SHOULD BE SYMMETRIC IN ORDER FOR
THIS PROCEDURE TO BE APPROPRIATE.
Consider the following summary statistics and graphics from the previous example:
Question: Is the normality assumption questionable in this situation? If so, is it reasonable to
assume the distribution is symmetric?
23
To carry out the Wilcoxon Signed Rank Test in JMP, make sure this option is checked:
The results are as follows:
Questions:
1. What is your decision about our original research question when the Wilcoxon Signed
Rank test is used?
2. Which test do you think is more appropriate? Explain.