Single-sample t-tests allow us to test sample parameters (such as the sample mean) against population parameters (such as μ), using the null hypothesis that the sample parameter is an estimate of the population parameter. Restricting our discussion to sample means, we can determine the likelihood of a sample belonging to a statistical population by determining the p-value associated with a test of the null hypothesis:

Sound familiar? It should. This is exactly what we did last week (if this surprises you, a brief review might be in order). The only difference (apart from you now knowing that this is referred to as a single-sample t-test) is that we will denote the standardized deviate that we calculate as ts. This notation is not applied in your textbook, but we will use it in order to distinguish between the test-statistic that you calculate based on your data (ts) and the critical value that you find in the table summarizing the probability densities for the t-distribution, which we shall denote as tcrit. Thus, our test statistic for a single-sample t-test, is:

Remember that the standard deviation of sample means is the standard error, which is why it is in the denominator of the second equation. The value of ts is compared to tcrit at α = 0.05 (one- or two-tailed, depending on the question) and n - 1 degrees of freedom (v in the table in your text) and the null hypothesis rejected or accepted as appropriate.
Download this week's Excel workbook HERE. The first worksheet, cleverly titled as "Example7.1", contains the data from Example 7.1 in your textbook. Work it through to make certain that you remember the necessary steps. In reporting your answer to Question 1, and any other questions that require you to draw a conclusion regarding a null hypothesis, be sure to include in parentheses the relevant parameters from your analysis, including the value of ts, the degrees of freedom, and the p-value. For Example 7.1, the correct parenthetical report would read: (ts=2.704; df=24; p<0.05). This is the format that I have used for more than 20 years and, like the American Express Card, I have found that it is accepted everywhere. More importantly, this is the basic format that you will use to report the results of all of the analyses that you will conduct this semester. Make sure that you remember it! Degrees of freedom are denoted as v in your text, but this is not a universal usage, and so we will use "df" instead. For the purposes of this class, you will also include in all of your answers whether you applied a one-tailed or 2-tailed probability to arrive at your conclusion, and why you chose to do so. This will be your first and last reminder. Maybe.
Do not be alarmed by ts values that are much higher than the critical value. Remember that the critical value on the table is the maximum value of ts that would cause us to accept the null hypothesis of no difference. Larger values of ts should be expected when differences do occur.
Question 1: Do the crabs body temperatures listed in Exercise 7.1 differ significantly from that of the surrounding air?
The second worksheet, "coliform", contains data from a series of fecal coliform counts in a recreational lake after a particularly rainy spring.
Question 2: Is there evidence that the fecal coliform counts in the lake exceed the limit of 150 colony forming units (CFU) per 100 ml, requiring the closing of the lake to swimming?
The third worksheet, "fish", contains the results of mercury analysis done on the tissues of a sample of freshwater fish.
Question 3: Does this sample suggest that fish in this area exceed the health standard of 1.5 parts per million of mercury (ppm Hg)?
Remember that the answers to these questions, and all subsequent questions must include (parenthetically) the test statistic (ts for this week), the degrees of freedom (df), and the probability of the null hypothesis being true (p). Remember also that you must indicate whether you tested a 1-tailed or a 2-tailed hypothesis, and why.
The single-sample t-test is a parametric test, meaning that the veracity of the conclusion depends on underlying assumptions. First among these is the assumption that the samples were randomly selected. This is an assumption of all of the parametric analyses that we will conduct, and one (if you remember back a few weeks) that we can pretend to ignore if we have taken the necessary steps to make certain that our samples are representative. The other assumption is that the observations in our sample are normally distributed (yes, even though the t-distribution describes the approach to normality, it describes that approach for the sample means, not the observations). As has been mentioned previously, the Shapiro-Wilk test is one of the most suitable tests for normality. The null hypothesis for the test is that the data are, in fact, normally distributed, and so the distribution of the data can be considered normal when the null hypothesis is accepted. As promised earlier, I will provide you with the results of the Shapiro-Wilk test (the test statistic is W) when it is required. For the coliform data, the result of the Shapiro-Wilk test was: W = 0.978, p = 0.839. For the fish data, the result was: W = 0.942, p = 0.413. As you can see from the p-values (the probability of the null hypothesis being true), the null hypothesis is accepted in both cases.
Last week we also examined the distribution of the differences between 2 sample means drawn from the same population, demonstrating that:

Is distributed as t with (n1 + n2 - 2) degrees of freedom. This was demonstrated empirically through the use of a computer model, but there also is a theoretical basis for it. The equation shown above is actually derived from the following:

Which is essentially a single sample test, looking at the difference between a sample parameter (the difference between sample means) and a population parameter (μ1 - μ2), standardized by the standard deviation of that difference. Because our null hypothesis pertains to a single population, we can take μ1 - μ2 as equal to zero, and the equation simplifies to:

This permits us to test the null hypothesis:

By calculating ts as:

Last week we determined the denominator as the standard deviation of the 5000 differences that we generated. Obviously this won't be possible when there are only two samples, and so we need another way to derive the denominator (the standard error of the difference between the sample means) to standardize the deviate. The formula that we will apply is:

Compare this to equation 8.4 (which we will not be using) in your textbook for pooled sum of squares (p. 133 in the 5th edition). The similarities may not be immediately obvious. Equation 8.4 has the sum of squares for both samples in the numerator (SS1 + SS2: Zar's notation). Remembering (or reviewing if remembering isn't working) that sample variance (s2) is the sum of squares (∑y2: our notation) divided by n - 1, we can see that:
s2(n - 1)
Returns ∑y2 (denoted as SS in your text). Thus, the numerator of the ratio in the square brackets of the equation shown above is equivalent to the numerator of equation 8.4.
Similarly, the denominators are identical, as v1 for equation 8.4 is equivalent to n1 - 1, and v2 for equation 8.4 is equivalent to n2 - 1, making their sum equivalent to n1 + n2 - 2 (as shown in equation 8.8 in your textbook if we are having trust issues). The ratio of the sum of sample sizes to their product that is multiplied by the pooled sum of squares, makes the part of the equation that is within the surd (that is the name for the root symbol) equivalent to equation 8.5, which makes the entire equation equivalent to equation 8.6.
Although the formula shown above for the standard deviation for the difference between sample means is equivalent to the equations from chapter 8, use the formula on the web page, not the formulas from the book! In our subsequent exercises, the formulas are not equivalent, and you will receive a grade of zero for using the wrong formula, so you might as well practice translating the formulas from the web page into your Excel spreadsheet now.
When sample sizes are equal, the equation for the standard deviation for the difference between sample means simplifies to equation 8.7b in your text, but the formula that I have provided above works regardless of whether the sample sizes are equal or not, and it seems to me that having a single formula that works in all cases is a useful thing.
So, in summary, we can test the null hypothesis:

By calculating ts as:

Where the value for the denominator is determined as:

And the result (ts) compared to the t-distribution for n1 + n2 - 2 degrees of freedom (v in your text) at a type I error rate of α = 0.05. Remember that the critical value for t in the table is the maximum value that you will accept for samples from a single statistical population, and so you will reject the null hypothesis for a ts that exceeds that value.
The determination of whether to use a one-tailed or a two-tailed α will be made (and explained) by you based on the information provided for each set of data.Remember that s2 is the symbol for sample variance, and that sample standard deviation (s) is the square root of sample variance. A shortcut for calculating s in Excel is to use the STDEV.S function (where you highlight the cells for which you want the standard deviation calculated, similar to the SUM and AVERAGE functions). Squaring the result [=STDEV.S(cellrange)^2] will return the sample variance, s2, as will the VAR.S function applied as: =VAR.S(cellrange). You may want to go back to some previous exercises where you calculated the variance by first calculating the deviates, to convince yourself that the shortcut works. Feel free to make use of these shortcuts from this point onward to save yourself some time and effort. And remember...because variance is calculated as the sum of squares divided by n-1, using the shortcut to get variance, and multiplying variance by n-1 will give you the sum of squares (∑y2) without having to calculate all of the deviates.
The fourth worksheet in this week's Excel workbook, "Example 8.1", contains the data from...wait for it... Example 8.1 in your textbook. Work it through to make sure that you get the same result as shown in the example. Remember to use the formula above, and not the approach used in the book!
Question 4: Do the data suggest that there is a significant difference in the clotting time for male rabbits treated with the two pharmaceuticals?
The fifth worksheet contains mercury levels (expressed as μg per gram wet weight) from tissues of two different species of shorebirds. The investigators wanted to know whether the differences in how shorebirds exploit their habitat would result in differences in their accumulation of mercury.
Question 5: Do the mercury data suggest that the different species exhibit significant differences in mercury accumulation?
The sixth worksheet (we definitely are making up for last week) contains data on clutch sizes of snow geese collected from their breeding grounds the year before a spill from an oil pipeline (as part of a routine survey) and the year following the survey, to determine whether the oil spill had negative effects on snow goose fecundity.
Question 6: Do the data suggest that snow goose clutch sizes decreased significantly following the oil spill?
Again, remember that the test statistic, degrees of freedom, and p-value need to be included in your answer, as well as an explanation of why you chose a one- or two-tailed test.
Now, let us examine the assumptions of the 2-sample t-test...
Send comments, suggestions, and corrections to: Derek Zelmer