Section 2: Hypothesis Testing
Section 2: Hypothesis Testing
In the previous section, we developed statistical methods, primarily in the form of confidence intervals, for answering the question "what is the value of the parameter
We'll derive good hypothesis tests for the usual population parameters, including:
- a population mean
- the difference in two population means,
, say - a population variance
- the ratio of two population variances,
, say - a population proportion
- the difference in two population proportions,
, say - three (or more!) means,
, and , say
We'll also work on deriving good hypothesis tests for the slope parameter
Lesson 9: Tests About Proportions
Lesson 9: Tests About ProportionsWe'll start our exploration of hypothesis tests by focusing on population proportions. Specifically, we'll derive the methods used for testing:
- whether a single population proportion
equals a particular value, - whether the difference in two population proportions
equals a particular value , say, with the most common value being 0
Thereby allowing us to test whether two populations' proportions are equal. Along the way, we'll learn two different approaches to hypothesis testing, one being the critical value approach and one being the
9.1 - The Basic Idea
9.1 - The Basic IdeaEvery time we perform a hypothesis test, this is the basic procedure that we will follow:
- We'll make an initial assumption about the population parameter.
- We'll collect evidence or else use somebody else's evidence (in either case, our evidence will come in the form of data).
- Based on the available evidence (data), we'll decide whether to "reject" or "not reject" our initial assumption.
Let's try to make this outlined procedure more concrete by taking a look at the following example.
Example 9-1

A four-sided (tetrahedral) die is tossed 1000 times, and 290 fours are observed. Is there evidence to conclude that the die is biased, that is, say, that more fours than expected are observed?
Answer
As the basic hypothesis testing procedure outlines above, the first step involves stating an initial assumption. It is:
Assume the die is unbiased. If the die is unbiased, then each side (1, 2, 3, and 4) is equally likely. So, we'll assume that p, the probability of getting a 4 is 0.25.
In general, the initial assumption is called the null hypothesis, and is denoted
That is, the initial assumption involves making a statement about a population proportion.
Now, the second step tells us that we need to collect evidence (data) for or against our initial assumption. In this case, that's already been done for us. We were told that the die was tossed
Now we just need to complete the third step of making the decision about whether or not to reject our initial assumption that the population proportion is 0.25. Recall that the Central Limit Theorem tells us that the sample proportion:
is approximately normally distributed with (assumed) mean:
and (assumed) standard deviation:
That means that:
follows a standard normal
So, we are assuming that the population proportion is 0.25 (in blue), but we've observed a sample proportion 0.290 (in red) that falls way out in the right tail of the normal distribution. It certainly doesn't appear impossible to obtain a sample proportion of 0.29. But, that's what we're left with deciding. That is, we have to decide if a sample proportion of 0.290 is more extreme that we'd expect if the population proportion
There are two approaches to making the decision:
- one is called the "critical value" (or "critical region" or "rejection region") approach
- and the other is called the "
-value" approach
Until we get to the page in this lesson titled The
Example (continued)
A four-sided (tetrahedral) die is tossed 1000 times, and 290 fours are observed. Is there evidence to conclude that the die is biased, that is, say, that more fours than expected are observed?
Answer
Okay, so now let's think about it. We probably wouldn't reject our initial assumption that the population proportion
Let's suppose that we decide to reject the null hypothesis
Here's a picture of such a "critical region" (or "rejection region"):
Note, by the way, that the "size" of the critical region is 0.05. This will become apparent in a bit when we talk below about the possible errors that we can make whenever we conduct a hypothesis test.
At any rate, let's get back to deciding whether our particular sample proportion appears to be too extreme. Well, it looks like we should reject the null hypothesis (our initial assumption
or equivalently since our test statistic:
is greater than 1.645.
Our conclusion: we say there is sufficient evidence to conclude
By the way, this example involves what is called a one-tailed test, or more specifically, a right-tailed test, because the critical region falls in only one of the two tails of the normal distribution, namely the right tail.
Before we continue on the next page at looking at two more examples, let's revisit the basic hypothesis testing procedure that we outlined above. This time, though, let's state the procedure in terms of performing a hypothesis test for a population proportion using the critical value approach. The basic procedure is:
- State the null hypothesis
and the alternative hypothesis . (By the way, some textbooks, including ours, use the notation instead of to denote the alternative hypothesis.) - Calculate the test statistic:
- Determine the critical region.
- Make a decision. Determine if the test statistic falls in the critical region. If it does, reject the null hypothesis. If it does not, do not reject the null hypothesis.
Now, back to those possible errors we can make when conducting such a hypothesis test.
Possible Errors
So, argh! Every time we conduct a hypothesis test, we have a chance of making an error. (Oh dear, why couldn't I have chosen a different profession?!)
If we reject the null hypothesis
(in favor of the alternative hypothesis ) when the null hypothesis is in fact true, we say we've committed a Type I error. For our example above, we set P(Type I error) equal to 0.05:Aha! That's why the 0.05! We wanted to minimize our chance of making a Type I error! In general, we denote
the "significance level of the test." Obviously, we want to minimize . Therefore, typical values are 0.01, 0.05, and 0.10.If we fail to reject the null hypothesis when the null hypothesis is false, we say we've committed a Type II error. For our example, suppose (unknown to us) that the population proportion
is actually 0.27. Then, the probability of a Type II error, in this case, is:In general, we denote
. Just as we want to minimize , we want to minimize . Typical values are 0.05, 0.10, and 0.20.
9.2 - More Examples
9.2 - More ExamplesLet's take a look at two more examples of a hypothesis test for a single proportion while recalling the hypothesis testing procedure we outlined on the previous page:
-
State the null hypothesis
and the alternative hypothesis . -
Calculate the test statistic:
-
Determine the critical region.
-
Make a decision. Determine if the test statistic falls in the critical region. If it does, reject the null hypothesis. If it does not, do not reject the null hypothesis.
The first example involves a hypothesis test for the proportion in which the alternative hypothesis is a "greater than hypothesis," that is, the alternative hypothesis is of the form
Example 9-2

Let p equal the proportion of drivers who use a seat belt in a state that does not have a mandatory seat belt law. It was claimed that
Answer
The observed sample proportion is:
Because it is claimed that
Because we're interested in seeing if the advertising campaign was successful, that is, that a greater proportion of people wear seat belts, the alternative hypothesis is:
The test statistic is therefore:
If we use a significance level of
That is, we reject the null hypothesis if the test statistic
Again, note that this is an example of a right-tailed hypothesis test because the action falls in the right tail of the normal distribution.
Example 9-3

A Gallup poll released on October 13, 2000, found that 47% of the 1052 U.S. adults surveyed classified themselves as "very happy" when given the choices of:
- "very happy"
- "fairly happy"
- "not too happy"
Suppose that a journalist who is a pessimist took advantage of this poll to write a headline titled "Poll finds that U.S. adults who are very happy are in the minority." Is the pessimistic journalist's headline warranted?
Answer
The sample proportion is:
Because we're interested in the majority/minority boundary line, the null hypothesis is:
Because the journalist claims that the proportion of very happy U.S. adults is a minority, that is, less than 0.50, the alternative hypothesis is:
The test statistic is therefore:
Now, this time, we need to put our critical region in the left tail of the normal distribution. If we use a significance level of
That is, we reject the null hypothesis if the test statistic
Note that this is an example of a left-tailed hypothesis test because the action falls in the left tail of the normal distribution.
9.3 - The P-Value Approach
9.3 - The P-Value ApproachExample 9-4

Up until now, we have used the critical region approach in conducting our hypothesis tests. Now, let's take a look at an example in which we use what is called the P-value approach.
Among patients with lung cancer, usually, 90% or more die within three years. As a result of new forms of treatment, it is felt that this rate has been reduced. In a recent study of n = 150 lung cancer patients, y = 128 died within three years. Is there sufficient evidence at the
Answer
The sample proportion is:
The null and alternative hypotheses are:
The test statistic is, therefore:
And, the rejection region is:
Since the test statistic Z = −1.92 < −1.645, we reject the null hypothesis. There is sufficient evidence at the
Example 9-4 (continued)

What if we set the significance level
Answer
In this case, with
Because the test statistic Z = −1.92 > −2.33, we do not reject the null hypothesis. There is insufficient evidence at the
Example 9-4 (continued)

In the first part of this example, we rejected the null hypothesis when
Answer
We would, of course, reject any time the critical value was smaller than our test statistic −1.92:
That is, we would reject if the critical value were −1.645, −1.83, and −1.92. But, we wouldn't reject if the critical value were −1.93. The
P(Z < −1.92) = 0.0274
So far, all of the examples we've considered have involved a one-tailed hypothesis test in which the alternative hypothesis involved either a less than (<) or a greater than (>) sign. What happens if we weren't sure of the direction in which the proportion could deviate from the hypothesized null value? That is, what if the alternative hypothesis involved a not-equal sign (≠)? Let's take a look at an example.
Example 9-4 (continued)

What if we wanted to perform a "two-tailed" test? That is, what if we wanted to test:
at the
Answer
Let's first consider the critical value approach. If we allow for the possibility that the sample proportion could either prove to be too large or too small, then we need to specify a threshold value, that is, a critical value, in each tail of the distribution. In this case, we divide the "significance level"
That is, our rejection rule is that we should reject the null hypothesis
Now for the P-value approach. Again, needing to allow for the possibility that the sample proportion is either too large or too small, we multiply the P-value we obtain for the one-tailed test by 2:
That is, the P-value is:
Because the P-value 0.055 is (just barely) greater than the significance level
Let's close this example by formalizing the definition of a P-value, as well as summarizing the P-value approach to conducting a hypothesis test.
- P-Value
-
The P-value is the smallest significance level
that leads us to reject the null hypothesis.Alternatively (and the way I prefer to think of P-values), the P-value is the probability that we'd observe a more extreme statistic than we did if the null hypothesis were true.
If the P-value is small, that is, if
Note!

By the way, to test
rather than the one we've been using:
One advantage of doing so is that the interpretation of the confidence interval — does it contain
Answer
For the sake of ease, let:
Two-tailed test. In this case, the critical region approach tells us to reject the null hypothesis
if
which is equivalent to rejecting the null hypothesis:
if
which is equivalent to rejecting the null hypothesis:
if
That's the same as saying that we should reject the null hypothesis
Left-tailed test. In this case, the critical region approach tells us to reject the null hypothesis
if
which is equivalent to rejecting the null hypothesis:
if
which is equivalent to rejecting the null hypothesis:
if
That's the same as saying that we should reject the null hypothesis
9.4 - Comparing Two Proportions
9.4 - Comparing Two ProportionsSo far, all of our examples involved testing whether a single population proportion p equals some value
Example 9-5

Time magazine reported the result of a telephone poll of 800 adult Americans. The question posed of the Americans who were surveyed was: "Should the federal tax on cigarettes be raised to pay for health care reform?" The results of the survey were:
Non- Smokers | Smokers |
---|---|
|
Is there sufficient evidence at the
Answer
If
against the alternative hypothesis:
Before we can actually conduct the hypothesis test, we'll have to derive the appropriate test statistic.
The test statistic for testing the difference in two population proportions, that is, for testing the null hypothesis
where:
the proportion of "successes" in the two samples combined.
Proof
Recall that:
is approximately normally distributed with mean:
and variance:
But, if we assume that the null hypothesis is true, then the population proportions equal some common value p, say, that is,
So, under the assumption that the null hypothesis is true, we have that:
follows (at least approximately) the standard normal N(0,1) distribution. Since we don't know the (assumed) common population proportion p any more than we know the proportions
the proportion of "successes" in the two samples combined. And, hence, our test statistic becomes:
as was to be proved.
Example 9-5 (continued)

Time magazine reported the result of a telephone poll of 800 adult Americans. The question posed of the Americans who were surveyed was: "Should the federal tax on cigarettes be raised to pay for health care reform?" The results of the survey were:
Non- Smokers | Smokers |
---|---|
|
Is there sufficient evidence at the
Answer
The overall sample proportion is:
That implies then that the test statistic for testing:
is:
Errr.... that Z-value is off the charts, so to speak. Let's go through the formalities anyway making the decision first using the rejection region approach, and then using the P-value approach. Putting half of the rejection region in each tail, we have:
That is, we reject the null hypothesis
Now for the P-value approach:
That is, the P-value is less than 0.0001. Because
Thankfully, as should always be the case, the two approaches.... the critical value approach and the P-value approach... lead to the same conclusion
Note!

For testing
instead of the one we used:
An advantage of doing so is again that the interpretation of the confidence interval — does it contain 0? — is always consistent with the hypothesis test decision.
9.5 - Using Minitab
9.5 - Using MinitabHypothesis Test for a Single Proportion
To illustrate how to tell Minitab to perform a Z-test for a single proportion, let's refer to the lung cancer example that appeared on the page called The P-Value Approach.
-
Under the Stat menu, select Basic Statistics, and then 1 Proportion...:
-
In the pop-up window that appears, click on the radio button labeled Summarized data. In the box labeled Number of events, type in the number of successes or events of interest, and in the box labeled Number of trials, type in the sample size n. Click on the box labeled Perform hypothesis test, and in the box labeled Hypothesized proportion, type in the value of the proportion assumed in the null hypothesis:
-
Click on the button labeled Options... In the pop-up window that appears, for the box labeled Alternative, select either less than, greater than, or not equal depending on the direction of the alternative hypothesis. Click on the box labeled Use test and interval based on normal distribution:
Then, click OK to return to the main pop-up window.
-
Then, upon clicking OK on the main pop-up window, the output should appear in the Session window:
Test of P = 0.9 vs p < 0.9 Sample X N Sample P 95% Upper Bound Z-Value P-Value 1 128 150 0.853333 0.900846 -1.91 0.028 Using the normal approximation.
As you can see, Minitab reports not only the value of the test statistic (Z = −1.91) but also the P-value (0.028) and the 95% confidence interval (one-sided in this case, because of the one-sided hypothesis).
Hypothesis Test for Comparing Two Proportions
To illustrate how to tell Minitab to perform a Z-test for comparing two population proportions, let's refer to the smoker survey example that appeared on the page called Comparing Two Proportions.
-
Under the Stat menu, select Basic Statistics, and then 2 Proportions...:
-
In the pop-up window that appears, click on the radio button labeled Summarized data. In the boxes labeled Events, type in the number of successes or events of interest for both the First and Second samples. And in the boxes labeled Trials, type in the size
of the First sample and the size of the Second sample: -
Click on the button labeled Options... In the pop-up window that appears, in the box labeled Test difference, type in the assumed value of the difference in the proportions that appears in the null hypothesis. The default value is 0.0, the value most commonly assumed, as it means that we are interested in testing for the equality of the population proportions. For the box labeled Alternative, select either less than, greater than, or not equal depending on the direction of the alternative hypothesis. Click on the box labeled Use pooled estimate of p for test:
Then, click OK to return to the main pop-up window.
-
Then, upon clicking OK on the main pop-up window, the output should appear in the Session window:
Sample X N Sample P 1 351 605 0.580165 2 41 195 0.210256 Difference = p (1) - p (2)
Estimate for difference: 0.369909
95% CI for difference: (0.0300499, 0.439319)
T-Test of difference = 0 (vs not =0): Z = 8.99 P-Value = 0.000
Fischer's exact test: P-Value = 0.000Again, as you can see, Minitab reports not only the value of the test statistic (Z = 8.99) but other useful things as well, including the P-value, which in this case is so small as to be deemed to be 0.000 to three digits. For scientific reporting purposes, we would typically write that as P < 0.0001.
Lesson 10: Tests About One Mean
Lesson 10: Tests About One MeanOverview
In this lesson, we'll continue our investigation of hypothesis testing. In this case, we'll focus our attention on a hypothesis test for a population mean
- a hypothesis test based on the normal distribution for the mean
for the completely unrealistic situation that the population variance is known - a hypothesis test based on the
-distribution for the mean for the (much more) realistic situation that the population variance is unknown - a hypothesis test based on the
-distribution for , the mean difference in the responses of two dependent populations
10.1 - Z-Test: When Population Variance is Known
10.1 - Z-Test: When Population Variance is KnownLet's start by acknowledging that it is completely unrealistic to think that we'd find ourselves in the situation of knowing the population variance, but not the population mean. Therefore, the hypothesis testing method that we learn on this page has limited practical use. We study it only because we'll use it later to learn about the "power" of a hypothesis test (by learning how to calculate Type II error rates). As usual, let's start with an example.
Example 10-1

Boys of a certain age are known to have a mean weight of
Answer
The null hypothesis is
follows the standard normal
for testing the null hypothesis
against any of the possible alternative hypotheses
For the example in hand, the value of the test statistic is:
The critical region approach tells us to reject the null hypothesis at the
As always, we draw the same conclusion by using the
As expected, we reject the null hypothesis because the
By the way, we'll learn how to ask Minitab to conduct the
N | Mean | SE Mean | 95% Upper Bound | Z | P |
---|---|---|---|---|---|
25 | 80.9400 | 2.3200 | 84.7561 | -1.75 | 0.040 |
10.2 - T-Test: When Population Variance is Unknown
10.2 - T-Test: When Population Variance is UnknownNow that, for purely pedagogical reasons, we have the unrealistic situation (of a known population variance) behind us, let's turn our attention to the realistic situation in which both the population mean and population variance are unknown.
Example 10-2

It is assumed that the mean systolic blood pressure is
Answer
The null hypothesis is
follows a
for testing the null hypothesis
The critical region approach tells us to reject the null hypothesis at the
Again, as always, we draw the same conclusion by using the
As expected, we reject the null hypothesis because
Again, we'll learn how to ask Minitab to conduct the t-test for a mean
N | Mean | StDev | SE Mean | 95% CI | T | P |
---|---|---|---|---|---|---|
100 | 130.100 | 21.210 | 2.121 | (125.891, 134.309) | 4.76 | 0.000 |
By the way, the decision to reject the null hypothesis is consistent with the one you would make using a 95% confidence interval. Using the data, a 95% confidence interval for the mean
which simplifies to
Anyway, the critical region approach for the
if
which is equivalent to rejecting:
if
which is equivalent to rejecting:
if
which, upon inserting the data for this particular example, is equivalent to rejecting:
if
which just happen to be (!) the endpoints of the 95% confidence interval for the mean. Indeed, the results are consistent!
10.3 - Paired T-Test
10.3 - Paired T-TestIn the next lesson, we'll learn how to compare the means of two independent populations, but there may be occasions in which we are interested in comparing the means of two dependent populations. For example, suppose a researcher is interested in determining whether the mean IQ of the population of first-born twins differs from the mean IQ of the population of second-born twins. She identifies a random sample of
or equivalently if:
Now, the population of first-born twins is not independent of the population of second-born twins. Since all of our distributional theory requires the independence of measurements, we're rather stuck. There's a way out though... we can "remove" the dependence between
Then, our null hypothesis involves just a single mean, which we'll denote
and then our hard work is done! We can just use the
to a
Example 10-3

Blood samples from
Subject | Lab 1 | Lab 2 | Diff |
---|---|---|---|
1 |
296 | 318 | -22 |
2 | 268 | 287 | -19 |
. | . | . | . |
. | . | . | . |
. | . | . | . |
10 | 262 | 285 | -23 |
Is there a statistically significant difference at the
Answer
The null hypothesis is
The critical region approach tells us to reject the null hypothesis at the
Again, we draw the same conclusion when using the
As expected, we reject the null hypothesis because
And, the Minitab output for this example looks like this:
N | Mean | StDev | SE Mean | 95% CI | T | P |
---|---|---|---|---|---|---|
10 | -14.4000 | 6.7700 | 2.1409 | (-19.2430, -9.5570) | -6.73 | 0.000 |
10.4 - Using Minitab
10.4 - Using MinitabZ-Test for a Single Mean
To illustrate how to tell Minitab to perform a Z-test for a single mean, let's refer to the boys weight example that appeared on the page called The Z-test: When Population Variance is Known.
-
Under the Stat menu, select Basic Statistics, and then 1-Sample Z...:
-
In the pop-up window that appears, click on the radio button labeled Summarized data. In the box labeled Sample size, type in the sample size n, and in the box labeled Mean, type in the sample mean. In the box labeled Standard deviation, type in the value of the known (or rather assumed!) population standard deviation. Click on the box labeled Perform hypothesis test, and in the box labeled Hypothesized mean, type in the value of the mean assumed in the null hypothesis:
-
Click on the button labeled Options... In the pop-up window that appears, for the box labeled Alternative, select either less than, greater than, or not equal depending on the direction of the alternative hypothesis:
Then, click OK to return to the main pop-up window.
-
Then, upon clicking OK on the main pop-up window, the output should appear in the Session window:
Test of mu = 85 vs < 85
The assumed standard deviation = 11.6N Mean SE Mean 95% Upper Bound Z P 25 80.94 2.32 84.76 -1.75 0.040
T-test for a Single Mean
To illustrate how to tell Minitab to perform a t-test for a single mean, let's refer to the systolic blood pressure example that appeared on the page called The T-test: When Population Variance is Unknown.
-
Under the Stat menu, select Basic Statistics, and then 1-Sample t...:
-
In the pop-up window that appears, click on the radio button labeled Summarized data. In the box labeled Sample size, type in the sample size n; in the box labeled Mean, type in the sample mean; and in the box labeled Standard deviation, type in the sample standard deviation. Click on the box labeled Perform hypothesis test, and in the box labeled Hypothesized mean, type in the value of the mean assumed in the null hypothesis:
-
Click on the button labeled Options... In the pop-up window that appears, for the box labeled Alternative, select either less than, greater than, or not equal depending on the direction of the alternative hypothesis:
Then, click OK to return to the main pop-up window.
-
Then, upon clicking OK on the main pop-up window, the output should appear in the Session window:
Test of mu = 120 vs not = 120 N Mean StDev SE Mean 95% CI T P 100 130.10 21.21 2.12 (125.89, 134.31) 4.76 0.000 (5) Note that a paired t-test can be performed in the same way. The summarized sample data would simply be the summarized differences. The extra step of calculating the differences would be required, however, if your data are the raw measurements from the two dependent samples. That is, if you have two columns containing, say, Before and After measurements for which you want to analyze Diff, their differences, you can use Minitab's calculator (under the Calc menu, select Calculator) to calculate the differences:
-
Upon clicking OK, the differences (Diff) should appear in your worksheet:
When performing the t-test, you'll then need to tell Minitab (in the Samples in columns box) that the differences are contained in the Diff column:
Here's what the paired t-test output would look like for this example:
One Sample T: Diff
Test of mu = 0 vs not = 0Variable N Mean StDev SE Mean 95% CI T P Diff 7 2.000 1.414 0.535 (0.692, 3.308) 3.74 0.010
Lesson 11: Tests of the Equality of Two Means
Lesson 11: Tests of the Equality of Two MeansOverview
In this lesson, we'll continue our investigation of hypothesis testing. In this case, we'll focus our attention on a hypothesis test for the difference in two population means
- a hypothesis test based on the
-distribution, known as the pooled two-sample -test, for when the (unknown) population variances and are equal - a hypothesis test based on the
-distribution, known as Welch's -test, for when the (unknown) population variances and are not equal
Of course, because population variances are generally not known, there is no way of being 100% sure that the population variances are equal or not equal. In order to be able to determine, therefore, which of the two hypothesis tests we should use, we'll need to make some assumptions about the equality of the variances based on our previous knowledge of the populations we're studying.
11.1 - When Population Variances Are Equal
11.1 - When Population Variances Are EqualLet's start with the good news, namely that we've already done the dirty theoretical work in developing a hypothesis test for the difference in two population means
follows a
is an unbiased estimator of the common variance
against any of the alternative hypotheses:
we can use the test statistic:
and follow the standard hypothesis testing procedures. Let's take a look at an example.
Example 11-1

A psychologist was interested in exploring whether or not male and female college students have different driving behaviors. There were several ways that she could quantify driving behaviors. She opted to focus on the fastest speed ever driven by an individual. Therefore, the particular statistical question she framed was as follows:
Is the mean fastest speed driven by male college students different than the mean fastest speed driven by female college students?
She conducted a survey of a random
Males (X) | Females (Y) |
---|---|
|
and here is a graphical summary of the data in the form of a dotplot:
Is there sufficient evidence at the
Answer
Because the observed standard deviations of the two samples are of similar magnitude, we'll assume that the population variances are equal. Let's also assume that the two populations of fastest speed driven for males and females are normally distributed. (We can confirm, or deny, such an assumption using a normal probability plot, but let's simplify our analysis for now.) The randomness of the two samples allows us to assume independence of the measurements as well.
Okay, assumptions all met, we can test the null hypothesis:
against the alternative hypothesis:
using the test statistic:
because, among other things, the pooled sample standard deviation is:
The critical value approach tells us to reject the null hypothesis in favor of the alternative hypothesis if:
We reject the null hypothesis because the test statistic (
There is sufficient evidence at the
Not surprisingly, the decision is the same using the
Therefore, because
By the way, we'll see how to tell Minitab to conduct a two-sample t-test in a bit here, but in the meantime, this is what the output would look like:
Two-Sample T: For Fastest
Gender | N | Mean | StDev | SE Mean |
---|---|---|---|---|
1 | 34 | 105.5 | 20.1 | 3.4 |
2 | 29 | 90.9 | 12.2 | 2.3 |
Difference = mu (1) - mu (2)
Estimate for difference: 14.6085
95% CI for difference: (6.0630, 23.1540)
T-Test of difference = 0 (vs not =) : T-Value = 3.42 P-Value = 0.001 DF = 61
Both use Pooled StDev = 16.9066
11.2 - When Population Variances Are Not Equal
11.2 - When Population Variances Are Not EqualLet's again start with the good news that we've already done the dirty theoretical work here. Recall that if you have two independent samples from two normal distributions with unequal variances
follows, at least approximately, a
If r doesn't equal an integer, as it usually doesn't, then we take the integer portion of
With that now being recalled, if we're interested in testing the null hypothesis:
against any of the alternative hypotheses:
we can use the test statistic:
and follow the standard hypothesis testing procedures. Let's return to our fastest speed driven example.
Example 11-1 (Continued)

A psychologist was interested in exploring whether or not male and female college students have different driving behaviors. There were a number of ways that she could quantify driving behaviors. She opted to focus on the fastest speed ever driven by an individual. Therefore, the particular statistical question she framed was as follows:
Is the mean fastest speed driven by male college students different than the mean fastest speed driven by female college students?
She conducted a survey of a random
Males (X) | Females (Y) |
---|---|
|
Is there sufficient evidence at the
Answer
This time let's not assume that the population variances are equal. Then, we'll see if we arrive at a different conclusion. Let's still assume though that the two populations of fastest speed driven for males and females are normally distributed. And, we'll again permit the randomness of the two samples to allow us to assume independence of the measurements as well.
That said, then we can test the null hypothesis:
against the alternative hypothesis:
comparing the test statistic:
to a
Oops... that's not an integer, so we're going to need to take the greatest integer portion of that
Then, the critical value approach tells us to reject the null hypothesis in favor of the alternative hypothesis if:
We reject the null hypothesis because the test statistic (
There is (again!) sufficient evidence at the
And again, the decision is the same using the
Therefore, because
At any rate, we see that in this case, our conclusion is the same regardless of whether or not we assume equality of the population variances.
And, just in case you're interested... we'll see how to tell Minitab to conduct a Welch's
Two-Sample T: For Fastest
Gender | N | Mean | StDev | SE Mean |
---|---|---|---|---|
1 | 34 | 105.5 | 20.1 | 3.4 |
2 | 29 | 90.9 | 12.2 | 2.3 |
Difference = mu (1) - mu (2)
Estimate for difference: 14.6085
95% CI for difference: (6.3575, 22.8596)
T-Test of difference = 0 (vs not =) : T-Value = 3.55 P-Value = 0.001 DF = 55
11.3 - Using Minitab
11.3 - Using MinitabJust as is the case for asking Minitab to calculate pooled t-intervals and Welch's t-intervals for
Let's recall the spider and prey example, in which the feeding habits of two species of net-casting spiders were studied. The species, the deinopis, and menneus coexist in eastern Australia. The following data were obtained on the size, in millimeters, of the prey of random samples of the two species:
sample 1 | sample 2 | sample 3 | sample 4 | sample 5 | sample 6 | sample 7 | sample 8 | sample 9 | sample 10 |
---|---|---|---|---|---|---|---|---|---|
12.9 | 10.2 | 7.4 | 7.0 | 10.5 | 11.9 | 7.1 | 9.9 | 14.4 | 11.3 |
sample 1 | sample 2 | sample 3 | sample 4 | sample 5 | sample 6 | sample 7 | sample 8 | sample 9 | sample 10 |
---|---|---|---|---|---|---|---|---|---|
10.2 | 6.9 | 10.9 | 11.0 | 10.1 | 5.3 | 7.5 | 10.3 | 9.2 | 8.8 |
Let's use the data and Minitab to test whether the mean prey size of the populations of the two types of spiders differs.
When the Data are Entered in Two Columns
-
Enter the data in two columns, such as:
-
Under the Stat menu, select Basic Statistics, and then select 2-Sample t...:
-
In the pop-up window that appears, select Samples in different columns. Specify the name of the First variable, and specify the name of the Second variable. For the two-sample (pooled) t-test, click on the box labeled Assume equal variances. (For Welch's t-test, leave the box labeled Assume equal variances unchecked.):
-
Click on the button labeled Options... In the pop-up window that appears, for the box labeled Alternative, select either less than, greater than, or not equal depending on the direction of the alternative hypothesis:
Then, click OK to return to the main pop-up window.
-
Then, upon clicking OK on the main pop-up window, the output should appear in the Session window:
Two-Sample T: For Deinopis vs Menneus Variable N Mean StDev SE Mean Deinopis 10 10.26 2.51 0.79 Menneus 10 9.02 1.90 0.60 Difference = mu (Deinopis) - mu (Menneus)
Estimate for difference: 1.240
95% CI for difference: (-0.852, 3.332)
T-Test of difference = 0 (vs not =): T-Value = 1.25 P-Value = 0.229 DF = 18
Both use Pooled StDev = 2.2266
When the Data are Entered in One Column, and a Grouping Variable in a Second Column
-
Enter the data in one column (called Prey, say), and the grouping variable in a second column (called Group, say, with 1 denoting a deinopis spider and 2 denoting a menneus spider), such as:
-
Under the Stat menu, select Basic Statistics, and then select 2-Sample t...:
-
In the pop-up window that appears, select Samples in one column. Specify the name of the Samples variable (Prey, for us) and specify the name of the Subscripts (grouping) variable (Group, for us). For the two-sample (pooled) t-test, click on the box labeled Assume equal variances. (For Welch's t-test, leave the box labeled Assume equal variances unchecked.):
-
Click on the button labeled Options... In the pop-up window that appears, for the box labeled Alternative, select either less than, greater than, or not equal depending on the direction of the alternative hypothesis:
Then, click OK to return to the main pop-up window.
-
Then, upon clicking OK on the main pop-up window, the output should appear in the Session window:
Two-Sample T: For Prey
Group N Mean StDev SE Mean 1 10 10.26 2.51 0.79 2 10 9.02 1.90 0.60 Difference = mu (1) - mu (2)
Estimate for difference: 1.240
95% CI for difference: (-0.852, 3.332)
T-Test of difference = 0 (vs not =): T-Value = 1.25 P-Value = 0.229 DF = 18
Both use Pooled StDev = 2.2266
Lesson 12: Tests for Variances
Lesson 12: Tests for VariancesContinuing our development of hypothesis tests for various population parameters, in this lesson, we'll focus on hypothesis tests for population variances. Specifically, we'll develop:
- a hypothesis test for testing whether a single population variance
equals a particular value - a hypothesis test for testing whether two population variances are equal
12.1 - One Variance
12.1 - One VarianceYeehah again! The theoretical work for developing a hypothesis test for a population variance
follows a chi-square distribution with n−1 degrees of freedom. Therefore, if we're interested in testing the null hypothesis:
against any of the alternative hypotheses:
we can use the test statistic:
and follow the standard hypothesis testing procedures. Let's take a look at an example.
Example 12-1

A manufacturer of hard safety hats for construction workers is concerned about the mean and the variation of the forces its helmets transmits to wearers when subjected to an external force. The manufacturer has designed the helmets so that the mean force transmitted by the helmets to the workers is 800 pounds (or less) with a standard deviation to be less than 40 pounds. Tests were run on a random sample of n = 40 helmets, and the sample mean and sample standard deviation were found to be 825 pounds and 48.5 pounds, respectively.
Do the data provide sufficient evidence, at the
Answer
We're interested in testing the null hypothesis:
against the alternative hypothesis:
Therefore, the value of the test statistic is:
Is the test statistic too large for the null hypothesis to be true? Well, the critical value approach would have us finding the threshold value such that the probability of rejecting the null hypothesis if it were true, that is, of committing a Type I error, is small... 0.05, in this case. Using Minitab (or a chi-square probability table), we see that the cutoff value is 54.572:
That is, we reject the null hypothesis in favor of the alternative hypothesis if the test statistic
Therefore, we conclude that there is sufficient evidence, at the 0.05 level, to conclude that the population standard deviation exceeds 40.
Of course, the P-value approach yields the same conclusion. In this case, the P-value is the probablity that we would observe a chi-square(39) random variable more extreme than 57.336:
As the drawing illustrates, the P-value is 0.029 (as determined using the chi-square probability calculator in Minitab). Because
Do the data provide sufficient evidence, at the
Answer
In this case, we're interested in testing the null hypothesis:
against the alternative hypothesis:
The value of the test statistic remains the same. It is again:
Now, is the test statistic either too large or too small for the null hypothesis to be true? Well, the critical value approach would have us dividing the significance level
That is, we reject the null hypothesis in favor of the two-sided alternative hypothesis if the test statistic
Therefore, we fail to reject the null hypothesis. There is insufficient evidence, at the 0.05 level, to conclude that the population standard deviation differs from 40.
Of course, the P-value approach again yields the same conclusion. In this case, we simply double the P-value we obtained for the one-tailed test yielding a P-value of 0.058:
Because
The above example illustrates an important fact, namely, that the conclusion for the one-sided test does not always agree with the conclusion for the two-sided test. If you have reason to believe that the parameter will differ from the null value in a particular direction, then you should conduct the one-sided test.
12.2 - Two Variances
12.2 - Two VariancesLet's now recall the theory necessary for developing a hypothesis test for testing the equality of two population variances. Suppose
have independent chi-square distributions with n−1 and m−1 degrees of freedom, respectively. Therefore:
follows an F distribution with n−1 numerator degrees of freedom and m−1 denominator degrees of freedom. Therefore, if we're interested in testing the null hypothesis:
against any of the alternative hypotheses:
we can use the test statistic:
and follow the standard hypothesis testing procedures. When doing so, we might also want to recall this important fact about the F-distribution:
so that when we use the critical value approach for a two-sided alternative:
we reject if the test statistic F is too large:
or if the test statistic F is too small:
Okay, let's take a look at an example. In the last lesson, we performed a two-sample t-test (as well as Welch's test) to test whether the mean fastest speed driven by the population of male college students differs from the mean fastest speed driven by the population of female college students. When we performed the two-sample t-test, we just assumed the population variances were equal. Let's revisit that example again to see if our assumption of equal variances is valid.
Example 12-2

A psychologist was interested in exploring whether or not male and female college students have different driving behaviors. The particular statistical question she framed was as follows:
Is the mean fastest speed driven by male college students different than the mean fastest speed driven by female college students?
The psychologist conducted a survey of a random
Males (X) | Females (Y) |
---|---|
|
Is there sufficient evidence at the
Answer
We're interested in testing the null hypothesis:
against the alternative hypothesis:
The value of the test statistic is:
(Note that I intentionally put the variance of what we're calling the Y sample in the numerator and the variance of what we're calling the X sample in the denominator. I did this only so that my results match the Minitab output we'll obtain on the next page. In doing so, we just need to make sure that we keep track of the correct numerator and denominator degrees of freedom.) Using the critical value approach, we divide the significance level
Because the test statistic falls in the rejection region, that is, because
12.3 - Using Minitab
12.3 - Using MinitabIn each case, we'll illustrate how to perform the hypothesis tests of this lesson using summarized data.
Hypothesis Test for One Variance
-
Under the Stat menu, select Basic Statistics, and then select 1 Variance...:
-
In the pop-up window that appears, in the box labeled Data, select Sample standard deviation (or alternatively Sample variance). In the box labeled Sample size, type in the size n of the sample. In the box labeled Sample standard deviation, type in the sample standard deviation. Click on the box labeled Perform hypothesis test, and in the box labeled Value, type in the Hypothesized standard deviation (or alternatively the Hypothesized variance):
-
Click on the button labeled Options... In the pop-up window that appears, for the box labeled Alternative, select either less than, greater than, or not equal depending on the direction of the alternative hypothesis:
Then, click on OK to return to the main pop-up window.
-
Then, upon clicking OK on the main pop-up window, the output should appear in the Session window:
95% Confidence IntervalsMethod CI for
StDevCI for
VarianceChi-Square (39.7, 62.3) (1578, 3878) Method Test
StatisticDF P-Value Chi-Square 57.34 39 0.059
Hypothesis Test for Two Variances
-
Under the Stat menu, select Basic Statistics, and then select 2 Variances...:
-
In the pop-up window that appears, in the box labeled Data, select Sample standard deviations (or alternatively Sample variances). In the box labeled Sample size, type in the size n of the First sample and m of the Second sample. In the box labeled Standard deviation, type in the sample standard deviations for the First and Second samples:
-
Click on the button labeled Options... In the pop-up window that appears, in the box labeled Value, type in the Hypothesized ratio of the standard deviations (or the Hypothesized ratio of the variances). For the box labeled Alternative, select either less than, greater than, or not equal depending on the direction of the alternative hypothesis:
Then, click on OK to return to the main pop-up window.
-
Then, upon clicking OK on the main pop-up window, the output should appear in the Session window:
Test and CI for Two Variances
Method
Null hypothesis Sigma(1) / Sigma(2) = 1
Alternative hypothesis Sigma(1) / Sigma(2) not = 1
Significance level Alpha = 0.05
StatisticsSample N StDev Variance 1 29 12.200 148.840 2 34 20.100 404.010 Ratio of standard deviations = 0.607
Ratio of variances = 0.368
95% Confidence IntervalsDistribution
of DataCI for StDev Ratio CI for
Variance RatioNormal (0.425, 0.877) (0.180, 0.770) Method DF1 DF2 Test
StatisticP-Value F Test (normal) 28 33 0.37 0.009
-
Lesson 13: One-Factor Analysis of Variance
Lesson 13: One-Factor Analysis of VarianceWe previously learned how to compare two population means using either the pooled two-sample t-test or Welch's t-test. What happens if we want to compare more than two means? In this lesson, we'll learn how to do just that. More specifically, we'll learn how to use the analysis of variance method to compare the equality of the (unknown) means
13.1 - The Basic Idea
13.1 - The Basic IdeaWe could take a top-down approach by first presenting the theory of analysis of variance and then following it up with an example. We're not going to do it that way though. We're going to take a bottom-up approach, in which we first develop the idea behind the analysis of variance on this page, and then present the results on the next page. Only after we've completed those two steps will we take a step back and look at the theory behind analysis of variance. That said, let's start with our first example of the lesson.
Example 13-1

A researcher for an automobile safety institute was interested in determining whether or not the distance that it takes to stop a car going 60 miles per hour depends on the brand of the tire. The researcher measured the stopping distance (in feet) of ten randomly selected cars for each of five different brands. So that he and his assistants would remain blinded, the researcher arbitrarily labeled the brands of the tires as Brand1, Brand2, Brand3, Brand4, and Brand5. Here are the data resulting from his experiment:
Brand1 | Brand2 | Brand3 | Brand4 | Brand5 |
---|---|---|---|---|
194 | 189 | 185 | 183 | 195 |
184 | 204 | 183 | 193 | 197 |
189 | 190 | 186 | 184 | 194 |
189 | 190 | 183 | 186 | 202 |
188 | 189 | 179 | 194 | 200 |
186 | 207 | 191 | 199 | 211 |
195 | 203 | 188 | 196 | 203 |
186 | 193 | 196 | 188 | 206 |
183 | 181 | 189 | 193 | 202 |
188 | 206 | 194 | 196 | 195 |
Do the data provide enough evidence to conclude that at least one of the brands is different from the others with respect to stopping distance?
Answer
The first thing we might want to do is to create some sort of summary plot of the data. Here is a box plot of the data:
Hmmm. It appears that the box plots for Brand1 and Brand5 have very little, if any, overlap at all. The same can be said for Brand3 and Brand5. Here are some summary statistics of the data:
Brand | N | MEAN | SD |
---|---|---|---|
1 | 10 | 188.20 | 3.88 |
2 | 10 | 195.20 | 9.02 |
3 | 10 | 187.40 | 5.27 |
4 | 10 | 191.20 | 5.55 |
5 | 10 | 200.50 | 5.44 |
It appears that the sample means differ quite a bit. For example, the average stopping distance of Brand3 is 187.4 feet (with a standard deviation of 5.27 feet), while the average stopping distance of Brand5 is 200.5 feet (with a standard deviation of 5.44 feet). A difference of 13 feet could mean the difference between getting into an accident or not. But, of course, we can't draw conclusions about the performance of the brands based on one sample. After all, a different random sample of cars could yield different results. Instead, we need to use the sample means to try to draw conclusions about the population means.
More specifically, the researcher needs to test the null hypothesis that the group population means are all the same against the alternative that at least one group population mean differs from the others. That is, the researcher needs to test this null hypothesis:
against this alternative hypothesis:
In this lesson, we are going to learn how to use a method called analysis of variance to answer the researcher's question. Jumping right to the punch line, with no development or theoretical justification whatsoever, we'll use an analysis of variance table, such as this one:
Analysis of Variance for comparing all 5 brands |
|||||
---|---|---|---|---|---|
Source | DF | SS | MS | F | P |
Brand | 4 | 1174.8 | 293.7 | 7.95 | 0.000 |
Error | 45 | 1661.7 | 36.9 | ||
Total | 49 | 2836.5 |
to draw conclusions about the equality of two or more population means. And, as we always do when performing hypothesis tests, we'll compare the P-value to
So far, we have seen a typical null and alternative hypothesis in the analysis of variance framework, as well as an analysis of variance table. Let's take a look at another example with the idea of continuing to work on developing the basic idea behind the analysis of variance method.
Example 13-2

Suppose an education researcher is interested in determining whether a learning method affects students' exam scores. Specifically, suppose she considers these three methods:
- standard
- osmosis
- shock therapy
Suppose she convinces 15 students to take part in her study, so she randomly assigns 5 students to each method. Then, after waiting eight weeks, she tests the students to get exam scores.
What would the researcher's data have to look like to be able to conclude that at least one of the methods yields different exam scores than the others?
Answer
Suppose a dot plot of the researcher's data looked like this:
What would we want to conclude? Well, there's a lot of separation in the data between the three methods. In this case, there is little variation in the data within each method, but a lot of variation in the data across the three methods. For these data, we would probably be willing to conclude that there is a difference between the three methods.
Now, suppose instead that a dot plot of the researcher's data looked like this:
What would we want to conclude? Well, there's less separation in the data between the three methods. In this case, there is a lot of variation in the data within each method, and still some variation in the data across the three methods, but not as much as in the previous dot plot. For these data, it is not as obvious that we can conclude that there is a difference between the three methods.
Let's consider one more possible dot plot:
What would we want to conclude here? Well, there's even less separation in the data between the three methods. In this case, there is a real lot of variation in the data within each method, and not much variation at all in the data across the three methods. For these data, we would probably want to conclude that there is no difference between the three methods.
If you go back and look at the three possible data sets, you'll see that we drew our conclusions by comparing the variation in the data within a method to the variation in the data across methods. Let's try to formalize that idea a bit more by revisiting the two most extreme examples. First, the example in which we concluded that the methods differ:
Let's quantify (or are we still just qualifying?) the amount of variation within a method by comparing the five data points within a method to the method's mean, as represented in the plot as a color-coded triangle. And, let's quantify (or qualify?) the amount of variation across the methods by comparing the method means, again represented in the plot as a color-coded triangle, to the overall grand mean, that is, the average of all fifteen data points (ignoring the method). In this case, the variation between the group means and the grand mean is larger than the variation within the groups.
Now, let's revisit the example in which we wanted to conclude that there was no difference in the three methods:
In this case, the variation between the group means and the grand mean is smaller than the variation within the groups.
Hmmm... these two examples suggest that our method should compare the variation between the groups to that of the variation within the groups. That's just what an analysis of variance does!
Let's see what conclusion we draw from an analysis of variance of these data. Here's the analysis of variance table for the first study, in which we wanted to conclude that there was a difference in the three methods:
Source | DF | SS | MS | F | P |
---|---|---|---|---|---|
Factor | 2 | 2510.5 | 1255.3 | 93.44 | 0.000 |
Error | 12 | 161.2 | 13.4 | ||
Total | 14 | 2671.7 |
In this case, the P-value is small (0.000, to three decimal places). We can reject the null hypothesis of equal means at the 0.05 level. That is, there is sufficient evidence at the 0.05 level to conclude that the mean exam scores of the three study methods are significantly different.
Here's the analysis of variance table for the third study, in which we wanted to conclude that there was no difference in the three methods:
Source | DF | SS | MS | F | P |
---|---|---|---|---|---|
Factor | 2 | 80.1 | 40.1 | 0.46 | 0.643 |
Error | 12 | 1050.8 | 87.6 | ||
Total | 14 | 1130.9 |
In this case, the P-value, 0.643, is large. We fail to reject the null hypothesis of equal means at the 0.05 level. That is, there is insufficient evidence at the 0.05 level to conclude that the mean exam scores of the three study methods are significantly different.
Hmmm. It seems like we're on to something! Let's summarize.
The Basic Idea Behind Analysis of Variance
Analysis of variance involves dividing the overall variability in observed data values so that we can draw conclusions about the equality, or lack thereof, of the means of the populations from where the data came. The overall (or "total") variability is divided into two components:
- the variability "between" groups
- the variability "within" groups
We summarize the division of the variability in an "analysis of variance table", which is often shortened and called an "ANOVA table." Without knowing what we were really looking at, we looked at a few examples of ANOVA tables here on this page. Let's now go take an in-depth look at the content of ANOVA tables.
13.2 - The ANOVA Table
13.2 - The ANOVA TableFor the sake of concreteness here, let's recall one of the analysis of variance tables from the previous page:
Source | DF | SS | MS | F | P |
---|---|---|---|---|---|
Factor | 2 | 2510.5 | 1255.3 | 93.44 | 0.000 |
Error | 12 | 161.2 | 13.4 | ||
Total | 14 | 2671.7 |
In working to digest what is all contained in an ANOVA table, let's start with the column headings:
- Source means "the source of the variation in the data." As we'll soon see, the possible choices for a one-factor study, such as the learning study, are Factor, Error, and Total. The factor is the characteristic that defines the populations being compared. In the tire study, the factor is the brand of tire. In the learning study, the factor is the learning method.
- DF means "the degrees of freedom in the source."
- SS means "the sum of squares due to the source."
- MS means "the mean sum of squares due to the source."
- F means "the F-statistic."
- P means "the P-value."
Now, let's consider the row headings:
- Factor means "the variability due to the factor of interest." In the tire example on the previous page, the factor was the brand of the tire. In the learning example on the previous page, the factor was the method of learning.
Sometimes, the factor is a treatment, and therefore the row heading is instead labeled as Treatment. And, sometimes the row heading is labeled as Between to make it clear that the row concerns the variation between the groups.
- Error means "the variability within the groups" or "unexplained random error." Sometimes, the row heading is labeled as Within to make it clear that the row concerns the variation within the groups.
- Total means "the total variation in the data from the grand mean" (that is, ignoring the factor of interest).
With the column headings and row headings now defined, let's take a look at the individual entries inside a general one-factor ANOVA table:
Hover over the lightbulb for further explanation.
Source | DF | SS | MS | F | P |
---|---|---|---|---|---|
Factor | m-1 | SS (Between) | MSB | MSB/MSE | 0.000 |
Error | n-m | SS (Error) | MSE | ||
Total | n-1 | SS (Total) |
Yikes, that looks overwhelming! Let's work our way through it entry by entry to see if we can make it all clear. Let's start with the degrees of freedom (DF) column:
- If there are n total data points collected, then there are n−1 total degrees of freedom.
- If there are m groups being compared, then there are m−1 degrees of freedom associated with the factor of interest.
- If there are n total data points collected and m groups being compared, then there are n−m error degrees of freedom.
Now, the sums of squares (SS) column:
- As we'll soon formalize below, SS(Between) is the sum of squares between the group means and the grand mean. As the name suggests, it quantifies the variability between the groups of interest.
- Again, as we'll formalize below, SS(Error) is the sum of squares between the data and the group means. It quantifies the variability within the groups of interest.
- SS(Total) is the sum of squares between the n data points and the grand mean. As the name suggests, it quantifies the total variability in the observed data. We'll soon see that the total sum of squares, SS(Total), can be obtained by adding the between sum of squares, SS(Between), to the error sum of squares, SS(Error). That is:
SS(Total) = SS(Between) + SS(Error)
The mean squares (MS) column, as the name suggests, contains the "average" sum of squares for the Factor and the Error:
- The Mean Sum of Squares between the groups, denoted MSB, is calculated by dividing the Sum of Squares between the groups by the between group degrees of freedom. That is, MSB = SS(Between)/(m−1).
- The Error Mean Sum of Squares, denoted MSE, is calculated by dividing the Sum of Squares within the groups by the error degrees of freedom. That is, MSE = SS(Error)/(n−m).
The F column, not surprisingly, contains the F-statistic. Because we want to compare the "average" variability between the groups to the "average" variability within the groups, we take the ratio of the Between Mean Sum of Squares to the Error Mean Sum of Squares. That is, the F-statistic is calculated as F = MSB/MSE.
When, on the next page, we delve into the theory behind the analysis of variance method, we'll see that the F-statistic follows an F-distribution with m−1 numerator degrees of freedom and n−m denominator degrees of freedom. Therefore, we'll calculate the P-value, as it appears in the column labeled P, by comparing the F-statistic to an F-distribution with m−1 numerator degrees of freedom and n−m denominator degrees of freedom.
Now, having defined the individual entries of a general ANOVA table, let's revisit and, in the process, dissect the ANOVA table for the first learning study on the previous page, in which n = 15 students were subjected to one of m = 3 methods of learning:
Hover over the lightbulb for further explanation.
Source | DF | SS | MS | F | P |
---|---|---|---|---|---|
Factor | 2 | 2510.5 | 1255.3 | 93.44 | 0.000 |
Error | 12 | 161.2 | 13.4 | ||
Total | 14 | 2671.7 |
- Because n = 15, there are n−1 = 15−1 = 14 total degrees of freedom.
- Because m = 3, there are m−1 = 3−1 = 2 degrees of freedom associated with the factor.
- The degrees of freedom add up, so we can get the error degrees of freedom by subtracting the degrees of freedom associated with the factor from the total degrees of freedom. That is, the error degrees of freedom is 14−2 = 12. Alternatively, we can calculate the error degrees of freedom directly from n−m = 15−3=12.
- We'll learn how to calculate the sum of squares in a minute. For now, take note that the total sum of squares, SS(Total), can be obtained by adding the between sum of squares, SS(Between), to the error sum of squares, SS(Error). That is:
2671.7 = 2510.5 + 161.2
- MSB is SS(Between) divided by the between group degrees of freedom. That is, 1255.3 = 2510.5 ÷ 2.
- MSE is SS(Error) divided by the error degrees of freedom. That is, 13.4 = 161.2 ÷ 12.
- The F-statistic is the ratio of MSB to MSE. That is, F = 1255.3 ÷ 13.4 = 93.44.
- The P-value is P(F(2,12) ≥ 93.44) < 0.001.
Okay, we slowly, but surely, keep on adding bit by bit to our knowledge of an analysis of variance table. Let's now work a bit on the sums of squares.
The Sums of Squares
In essence, we now know that we want to break down the TOTAL variation in the data into two components:
- a component that is due to the TREATMENT (or FACTOR), and
- a component that is due to just RANDOM ERROR.
Let's see what kind of formulas we can come up with for quantifying these components. But first, as always, we need to define some notation. Let's represent our data, the group means, and the grand mean as follows:
Group | Data | Means | |||
---|---|---|---|---|---|
1 | . . . | ||||
2 | . . . | ||||
. . . |
. . . |
. . . |
. . . |
. . . |
. . . |
. . . | |||||
Grand Mean |
That is, we'll let:
- m denotes the number of groups being compared
denote the observation in the group, where and . The important thing to note here... note that j goes from 1 to , not to . That is, the number of the data points in a group depends on the group i. That means that the number of data points in each group need not be the same. We could have 5 measurements in one group, and 6 measurements in another. denote the sample mean of the observed data for group i, where denote the grand mean of all n data observed data points
Okay, with the notation now defined, let's first consider the total sum of squares, which we'll denote here as SS(TO). Because we want the total sum of squares to quantify the variation in the data regardless of its source, it makes sense that SS(TO) would be the sum of the squared distances of the observations
With just a little bit of algebraic work, the total sum of squares can be alternatively calculated as:
Can you do the algebra?
Now, let's consider the treatment sum of squares, which we'll denote SS(T). Because we want the treatment sum of squares to quantify the variation between the treatment groups, it makes sense that SS(T) would be the sum of the squared distances of the treatment means
Again, with just a little bit of algebraic work, the treatment sum of squares can be alternatively calculated as:
Can you do the algebra?
Finally, let's consider the error sum of squares, which we'll denote SS(E). Because we want the error sum of squares to quantify the variation in the data, not otherwise explained by the treatment, it makes sense that SS(E) would be the sum of the squared distances of the observations
As we'll see in just one short minute why the easiest way to calculate the error sum of squares is by subtracting the treatment sum of squares from the total sum of squares. That is:
Okay, now, do you remember that part about wanting to break down the total variation SS(TO) into a component due to the treatment SS(T) and a component due to random error SS(E)? Well, some simple algebra leads us to this:
and hence why the simple way of calculating the error of the sum of squares. At any rate, here's the simple algebra:
Well, okay, so the proof does involve a little trick of adding 0 in a special way to the total sum of squares:
Then, squaring the term in parentheses, as well as distributing the summation signs, we get:
Now, it's just a matter of recognizing each of the terms:
That is, we've shown that:
as was to be proved.
13.3 - Theoretical Results
13.3 - Theoretical ResultsSo far, in an attempt to understand the analysis of variance method conceptually, we've been waving our hands at the theory behind the method. We can't procrastinate any further... we now need to address some of the theories behind the method. Specifically, we need to address the distribution of the error sum of squares (SSE), the distribution of the treatment sum of squares (SST), and the distribution of the all-important F-statistic.
The Error Sum of Squares (SSE)
Recall that the error sum of squares:
quantifies the error remaining after explaining some of the variation in the observations
If:
-
the
measurement of the group, that is, , is an independently and normally distributed random variable with mean and variance -
and
is the sample variance of the sample
Then:
follows a chi-square distribution with n−m degrees of freedom.
Proof
A theorem we learned (way) back in Stat 414 tells us that if the two conditions stated in the theorem hold, then:
follows a chi-square distribution with
Because we assume independence of the observations
degrees of freedom... as was to be proved.
Now, what can we say about the mean square error MSE? Well, one thing is...
Recall that to show that MSE is an unbiased estimator of
That said, here's the crux of the proof:
The first equality comes from the definition of MSE. The second equality comes from multiplying MSE by 1 in a special way. The third equality comes from taking the expected value of
Because
The Treatment Sum of Squares (SST)
Recall that the treatment sum of squares:
quantifies the distance of the treatment means from the grand mean. We'll just state the distribution of SST without proof.
If the null hypothesis:
is true, then:
follows a chi-square distribution with m−1 degrees of freedom.
When we investigated the mean square error MSE above, we were able to conclude that MSE was always an unbiased estimator of
The mean square due to treatment is an unbiased estimator of
Answer
Since MST is a function of the sum of squares due to treatment SST, let's start with finding the expected value of SST. We learned, on the previous page, that the definition of SST can be written as:
Therefore, the expected value of SST is:
Now, because, in general,
where:
because:
Simplifying our expectiation yet more, we get:
And, simplifying yet again, we get:
Okay, so we've simplified E(SST) as far as is probably necessary. Let's use it now to find E(MST).
Well, if the null hypothesis is true,
On the other hand, if the null hypothesis is not true, that is, if not all of the
So, in summary, we have shown that MST is an unbiased estimator of
Our work on finding the expected values of MST and MSE suggests a reasonable statistic for testing the null hypothesis:
against the alternative hypothesis:
is:
Now, why would this F be a reasonable statistic? Well, we showed above that
-
If the null hypothesis is true, that is, if all of the population means are equal, we'd expect the ratio MST/MSE to be close to 1.
-
If the alternative hypothesis is true, that is, if at least one of the population means differs from the others, we'd expect the ratio MST/MSE to be inflated above 1.
Now, just two questions remain:
- Why do you suppose we call MST/MSE an F-statistic?
- And, how inflated would MST/MSE have to be in order to reject the null hypothesis in favor of the alternative hypothesis?
Both of these questions are answered by knowing the distribution of MST/MSE.
The F-statistic
If
follows an F distribution with m−1 numerator degrees of freedom and n−m denominator degrees of freedom.
Answer
It can be shown (we won't) that SST and SSE are independent. Then, it's just a matter of recalling that an F random variable is defined to be the ratio of two independent chi-square random variables. That is:
as was to be proved.
Now this all suggests that we should reject the null hypothesis of equal population means:
if
If you go back and look at the assumptions that we made in deriving the analysis of variance F-test, you'll see that the F-test for the equality of means depends on three assumptions about the data:
- independence
- normality
- equal group variances
That means that you'll want to use the F-test only if there is evidence to believe that the assumptions are met. That said, as is the case with the two-sample t-test, the F-test works quite well even if the underlying measurements are not normally distributed unless the data are highly skewed or the variances are markedly different. If the data are highly skewed, or if there is evidence that the variances differ greatly, we have two analysis options at our disposal. We could attempt to transform the observations (take the natural log of each value, for example) to make the data more symmetric with more similar variances. Alternatively, we could use nonparametric methods (that are unfortunately not covered in this course).
13.4 - Another Example
13.4 - Another ExampleExample 13-3

A researcher was interested in investigating whether Holocaust survivors have more sleep problems than others. She evaluated
Is there sufficient evidence at the
Answer
We can use Minitab to obtain the analysis of variance table. Doing so, we get:
Source | DF | SS | MS | F | P |
---|---|---|---|---|---|
Factor | 2 | 1723.8 | 861.9 | 61.69 | 0.000 |
Error | 117 | 1634.8 | 14.0 | ||
Total | 119 | 3358.6 |
Since P < 0.001 ≤ 0.05, we reject the null hypothesis of equal means in favor of the alternative hypothesis of unequal means. There is sufficient evidence at the 0.05 level to conclude that the mean Pittsburgh Sleep Quality Index differs among the three groups.
Minitab®
Using Minitab
There is no doubt that you'll want to use Minitab when performing an analysis of variance. The commands necessary to perform a one-factor analysis of variance in Minitab depends on whether the data in your worksheet are "stacked" or "unstacked." Let's illustrate using the learning method study data. Here's what the data would look like unstacked:
std1 | osm1 | shk1 |
---|---|---|
51 | 58 | 77 |
45 | 68 | 72 |
40 | 64 | 78 |
41 | 63 | 73 |
41 | 62 | 75 |
That is, the data from each group resides in a different column in the worksheet. If your data are entered in this way, then follow these instructions for performing the one-factor analysis of variance:
- Under the Stat menu, select ANOVA.
- Select One-Way (Unstacked).
- In the box labeled Responses, specify the columns containing the data.
- If you want dot plots and/or boxplots of the data, select Graphs...
- Select OK.
- The output should appear in the Session Window.
Here's what the data would look like stacked:
Method | Score |
---|---|
1 | 51 |
1 | 45 |
1 | 40 |
1 | 41 |
1 | 41 |
2 | 58 |
2 | 68 |
2 | 64 |
2 | 63 |
2 | 62 |
3 | 77 |
3 | 72 |
3 | 78 |
3 | 73 |
3 | 75 |
That is, one column contains a grouping variable, and another column contains the responses. If your data are entered in this way, then follow these instructions for performing the one-factor analysis of variance:
- Under the Stat menu, select ANOVA.
- Select One-Way.
- In the box labeled Response, specify the column containing the responses.
- In the box labeled Factor, specify the column containing the grouping variable.
- If you want dot plots and/or boxplots of the data, select Graphs...
- Select OK.
- The output should appear in the Session Window.
Lesson 14: Two-Factor Analysis of Variance
Lesson 14: Two-Factor Analysis of VarianceOverview
In the previous lesson, we learned how to conduct an analysis of variance in an attempt to learn whether a (that's one!) factor played a role in the observed responses. For example, we investigated whether the learning method (the factor) influenced a student's exam score (the response). We also investigated whether tire brand (the factor) influenced a car's stopping distance (the response).
What happens if we're not interested in whether one factor is associated with the observed responses, but whether two or three or more factors are associated with the observed responses. For example, we might be interested in learning whether smoking history (one factor) and type of stress test (a second factor) are associated with the time until maximum oxygen uptake (the response). That's the kind of data that we'll learn to analyze in this lesson. Specifically, we'll learn how to conduct a two-factor analysis of variance, so that we can test whether either of the two factors or their interaction are associated with some continuous response.
The reality is this online lesson only contains an example of a two-factor analysis of variance. For the theoretical development, you are asked to refer to the textbook chapter on Two-Factor Analysis of Variance. Pedagogically, it is material that lends itself well to getting practice at learning a new statistical method solely from the formal presentation of a statistical textbook.
14.1 - An Example
14.1 - An ExampleExample 14-1
A physiologist was interested in learning whether smoking history and different types of stress tests influence the timing of a subject's maximum oxygen uptake, as measured in minutes. The researcher classified a subject's smoking history as either heavy smoking, moderate smoking, or non-smoking. He was interested in seeing the effects of three different types of stress tests — a test performed on a bicycle, a test on a treadmill, and a test on steps. The physiologist recruited 9 non-smokers, 9 moderate smokers, and 9 heavy smokers to participate in his experiment, for a total of n = 27 subjects. He then randomly assigned each of his recruited subjects to undergo one of the three types of stress tests. Here is his resulting data:
Smoking History | Test | ||
---|---|---|---|
Bicycle (1) | Treadmill (2) | Step Test (3) | |
Nonsmoker (1) | 12.8, 13.5, 11.2 | 16.2, 18.1, 17.8 | 22.6, 19.3, 18.9 |
Moderate (2) | 10.9, 11.1, 9.8 | 15.5, 13.8, 16.2 | 20.1, 21.0, 15.9 |
Heavy (3) | 8.7, 9.2, 7.5 | 14.7, 13.2, 8.1 | 16.2, 16.1, 17.8 |
Is there sufficient evidence at the
Answer
Let's start by stating our analysis of variance model, as well as any assumptions that we'll make. Let
subject to the following constraints:
In that case, testing whether or not there is an interaction between smoking history and the type of stress test involves testing the null hypothesis:
against all of the possible alternatives. We'll definitely want to engage Minitab in conducting the necessary analysis of variance! To do so, we first enter the data into a Minitab worksheet in an unstacked manner. We then do the following: [1]
-
Under the Stat menu, we select ANOVA, and then Balanced ANOVA... (our data are "balanced" because every cell contains the same number of measurements, 3).
-
In the pop-up window that appears, we specify the Response and the Model:
You might want to take particular note of the way we specify the interaction between smoking status and the type of test in Minitab, namely, as Smoker*Test.
-
We select OK, and the resulting output appears in the Session Window.
Here's what the output looks like with the row pertaining to the interaction term highlighted in yellow:
Factor | Type | Levels | Values |
---|---|---|---|
Smoker | fixed | 3 | 1, 2, 3 |
Test | fixed | 3 | 1, 2, 3 |
Source | DF | SS | MS | F | P |
---|---|---|---|---|---|
Smoker | 2 | 84.899 | 42.449 | 12.90 | 0.000 |
Test | 2 | 298.072 | 149.036 | 45.28 | 0.000 |
Smoker*Test | 4 | 2.815 | 0.704 | 0.21 | 0.927 |
Error | 18 | 59.247 | 3.291 | ||
Total | 26 | 445.032 |
S = 1.81424 R-Sq = 86.69% R-Sq (adj) = 80.77%
As you can see, the P-value, 0.927, is very large. We do not reject the null hypothesis that the interaction terms are all zero. That is, there is insufficient evidence at the 0.05 level to conclude that there is an interaction between smoking history and the type of stress test.
Now, testing whether or not smoking history has an effect on the timing of maximum oxygen uptake involves testing the null hypothesis:
against all of the possible alternatives. Here's what the output looks like with the row pertaining to the smoking history term highlighted in yellow:
Factor | Type | Levels | Values |
---|---|---|---|
Smoker | fixed | 3 | 1, 2, 3 |
Test | fixed | 3 | 1, 2, 3 |
Source | DF | SS | MS | F | P |
---|---|---|---|---|---|
Smoker | 2 | 84.899 | 42.449 | 12.90 | 0.000 |
Test | 2 | 298.072 | 149.036 | 45.28 | 0.000 |
Smoker*Test | 4 | 2.815 | 0.704 | 0.21 | 0.927 |
Error | 18 | 59.247 | 3.291 | ||
Total | 26 | 445.032 |
S = 1.81424 R-Sq = 86.69% R-Sq (adj) = 80.77%
As you can see, the P-value is very small (< 0.001). We reject the null hypothesis that the smoking history parameters are all zero. That is, there is sufficient evidence at the 0.05 level to conclude that smoking history has an effect on the timing of maximum oxygen uptake.
Now, testing whether or not the type of stress test has an effect on the timing of maximum oxygen uptake involves testing the null hypothesis:
against all of the possible alternatives. Here's what the output looks like with the row pertaining to the type of stress test term highlighted in yellow:
Factor | Type | Levels | Values |
---|---|---|---|
Smoker | fixed | 3 | 1, 2, 3 |
Test | fixed | 3 | 1, 2, 3 |
Source | DF | SS | MS | F | P |
---|---|---|---|---|---|
Smoker | 2 | 84.899 | 42.449 | 12.90 | 0.000 |
Test | 2 | 298.072 | 149.036 | 45.28 | 0.000 |
Smoker*Test | 4 | 2.815 | 0.704 | 0.21 | 0.927 |
Error | 18 | 59.247 | 3.291 | ||
Total | 26 | 445.032 |
S = 1.81424 R-Sq = 86.69% R-Sq (adj) = 80.77%
As you can see, again, the P-value is very small (< 0.001). We reject the null hypothesis that the stress test parameters are all zero. That is, there is sufficient evidence at the 0.05 level to conclude that the type of stress test has an effect on the timing of maximum oxygen uptake.
In summary, based on these data, the physiologist can conclude that there appears to be an effect due to smoking history and the type of stress test, but that the data do not suggest that the two factors interact in any way.
Note!
We were able to include an interaction term in our model in the previous example, because we had multiple observations (three, to be exact) falling in each of the cells. That is, if there is only one observation in each cell, we cannot include an interaction term in our model.
Lesson 15: Tests Concerning Regression and Correlation
Lesson 15: Tests Concerning Regression and CorrelationOverview
In lessons 35 and 36, we learned how to calculate point and interval estimates of the intercept and slope parameters,
with the random errors
Now, perhaps it is not a point that has been emphasized yet, but if you take a look at the form of the simple linear regression model, you'll notice that the response
15.1 - A Test for the Slope
15.1 - A Test for the SlopeOnce again we've already done the bulk of the theoretical work in developing a hypothesis test for the slope parameter
follows a
against any of the alternative hypotheses:
we can use the test statistic:
and follow the standard hypothesis testing procedures. Let's take a look at an example.
Example 15-1

In alligators' natural habitat, it is typically easier to observe the length of an alligator than it is the weight. This data set contains the log weight (
to the data. She is particularly interested in testing whether there is a relationship between the length and weight of alligators. At the
Answer
The easiest way to perform the hypothesis test is to let Minitab do the work for us! Under the Stat menu, selecting Regression, and then Regression, and specifying the response logW (for log weight) and the predictor logL (for log length), we get:
The regression equation is
logW = - 8.48 + 3.43 logL
Predictor | Coef | SE Coef | T | P |
---|---|---|---|---|
Constant | -8.4761 | 0.5007 | -16.93 | 0.000 |
logL | 3.4311 | 0.1330 | 25.80 | 0.000 |
Analysis of Variance
Source | DF | SS | MS | F | P |
---|---|---|---|---|---|
Regression | 1 | 10.064 | 10.064 | 665.81 | 0.000 |
Residual Error | 13 | 0.196 | 0.015 | ||
Total |
14 | 10.260 |
|
Easy as pie! Minitab tells us that the test statistic is
Of course, since we are learning this material for just the first time, perhaps we could go through the calculation of the test statistic at least once. Letting Minitab do some of the dirtier calculations for us, such as calculating:
as well as determining that
which is the test statistic that Minitab calculated... well, with just a bit of round-off error.
15.2 - Three Tests for Rho
15.2 - Three Tests for Rho
The hypothesis test for the slope
implies that the average moistness:
is a linear function of the temperature setting.
There are other situations, however, in which the variable
implies that the average age of a sardine, given its length is
is a linear function of the length. That is, the conditional mean of
must be of the form:
That is:
Now, for the case where
but rather simply knowing whether
A T-Test for Rho
Given our wordy prelude above, this test may be the simplest of all of the tests to develop. That's because we argued above that if
then:
That suggests, therefore, that testing for
to a
That is, the test statistic can be alternatively written as:
and because of its algebraic equivalence to the first test statistic, it too follows a
then simple algebra illustrates that the two test statistics are indeed algebraically equivalent:
Now, for the veracity of those two statements? Well, they are indeed true. The first one requires just some simple algebra. The second one requires a bit of trickier algebra that you'll soon be asked to work through for homework.
An R-Test for Rho
It would be nice to use the sample correlation coefficient
but the probability distribution of
Provided that
over the support
Proof
We'll use the distribution function technique, in which we first find the cumulative distribution function
The first equality is just the definition of the cumulative distribution function, while the second and third equalities come from the definition of the
Now, it's just a matter of taking the derivative of the c.d.f.
Focusing first on the derivative part of that equation, using the quotient rule, we get:
Simplifying, we get:
Now, if we multiply by 1 in a special way, that is, this way:
and then simplify, we get:
Now, looking back at
Canceling a few things out we get:
Now, because:
we finally get:
We're almost there! We just need to multiply the two parts together. Doing so, we get:
which simplifies to:
over the support
Now that we know the p.d.f. of
Yikes! Do you have any interest in integrating that function? Well, me neither! That's why we'll instead use an
An Approximate Z-Test for Rho
Okay, the derivation for this hypothesis test is going to be MUCH easier than the derivation for that last one. That's because we aren't going to derive it at all! We are going to simply state, without proof, the following theorem.
The statistic:
follows an approximate normal distribution with mean
The theorem, therefore, allows us to test the general null hypothesis
to a standard normal
What? We've looked at no examples yet on this page? Let's take care of that by closing with an example that utilizes each of the three hypothesis tests we derived above.
Example 15-2

An admissions counselor at a large public university was interested in learning whether freshmen calculus grades are independent of high school math achievement test scores. The sample correlation coefficient between the mathematics achievement test scores and calculus grades for a random sample of
Does this observed sample correlation coefficient suggest, at the
Answer
The admissions counselor is interested in testing:
Using the
We reject the null hypothesis if the test statistic is greater than 2.306 or less than −2.306.
Because
Using the R-statistic, with 8 degrees of freedom, Table IX in the back of the book tells us to reject the null hypothesis if the absolute value of
Using the approximate Z-statistic, we get:
In this case, we reject the null hypothesis if the absolute value of
15.3 - An Approximate Confidence Interval for Rho
15.3 - An Approximate Confidence Interval for RhoTo develop an approximate
Theorem
An approximate
and
Proof
We previously learned that:
follows at least approximately a standard normal
and manipulating the quantity inside the parentheses:
to get ..... can you fill in the details?! ..... the formula for a
where:
as was to be proved!
Example 15-2 (Continued)

An admissions counselor at a large public university was interested in learning whether freshmen calculus grades are independent of high school math achievement test scores. The sample correlation coefficient between the mathematics achievement test scores and calculus grades for a random sample of
Estimate the population correlation coefficient
Answer
Because we are interested in a 95% confidence interval, we use
and the upper limit of an approximate 95% confidence interval for
We can be (approximately) 95% confident that the correlation between the population of high school mathematics achievement test scores and freshmen calculus grades is between 0.447 and 0.961. (Not a particularly useful interval, I might say! It might behoove the admissions counselor to collect data on a larger sample, so that he or she can obtain a narrower confidence interval.)