Lab 22

Confidence Intervals with t


Confidence intervals with t are just like confidence intervals with z. Review Lab 15 if you need a full explanation of what a confidence interval is.

The previous formula for confidence intervals is:


In a 1-sample situation in which the standard error has to be estimated from the sample standard deviation (s), the critical z must be replaced with the critical t. Thus the formula becomes:


This same formula can be generalized to the other 2 types of t-tests. When you wish to estimate the difference between the means of 2 paired variables, the formula becomes:


When you wish to estimate the difference between the means of 2 independent variables, the formula becomes:


To look up the proper critical t, use the Excel function TINV like this
Critical t = TINV(1-%,df)

Thus, if you want to know the 99% confidence interval with 31 degrees of freedom (df), type this in any cell in Excel:
=TINV(1-.99,31)

The answer that is returned should be about: 2.744

Let try an example:
A sample of 57 people have a mean of 34 and sample standard deviation (s) of 12 on some variable. What is the 90% confidence interval of the population mean?
Because there is only a single sample and because we don't know the population standard deviation (σ), we must use the single-sample t formula. Had we known σ, we would not bother with t and would use the old z formula instead because it is more accurate.

We will need to fill in the missing information of this formula:



1. First we will estimate the standard error. You will recall that the formula is:


Thus the estimated standard error is 12/sqrt(57) which is roughly 1.589.

2. Now we will look up the critical t. The degrees of freedom is df = n - 1 = 57 - 1 = 56.
Critical t = TINV(1-.90,56) = 1.673

3. The margin of error is the critical t times the estimated standard error = 1.589 * 1.673 = 2.658

4. The lower bound of the confidence interval is 34 - 2.658 = 31.342

5. The upper bound of the confidence interval is 34 + 2.658 = 36.658

Thus, the 90% confidence interval of the population mean is 31.342  to 36.658.

Another example:
A researcher wishes to estimate the size of the sex difference in verbal fluency in children. She observes 60 three-year-old (36 months) girls and 57 three-year-old boys randomly selected from a larger cohort of children who are estimated to be representative of all U.S. 36 month-olds. Observing the children on several occasions and in a variety of settings, the researcher found that the girls emitted, on average, 32 words per minute (s = 5) and the boys emitted, on average, 24 words per minute (s = 4). What is the 99% confidence interval of the sex difference in verbal fluency?

Because there are 2 samples and they are not paired, we will use the independent samples formula:

1. First we will estimate the standard error. You will recall that the formula is:


Therefore we will need to calculate the pooled variance before proceeding. Here is the formula:

That is not much help, is it? I didn't give you the sums of squares for both samples. Fortunately, there is an alternate formula. Here it is:

This formula will be especially helpful when you need to calculate the pooled variance from SPSS output. SPSS will provide the estimated standard deviations and the sample sizes of both samples when you do an independent samples t-test. Just plug in the numbers to this alternate formula.
Remember that the dfA = nA - 1 and dfB = nB - 1

Therefore pooled variance = (5*5*(60 - 1) + 4*4*(57 - 1)) / (60 - 1 + 57 - 1) = 20.617

Plugging the pooled variance into the estimated standard error formula gives us = sqrt(20.617 / 60 + 20.617 / 57) = .840

2.Now we will look up the critical t. The degrees of freedom is df = dfA + dfB = nA - nB - 2 = 60 + 57 - 2 = 115
Critical t = TINV(1-.99,115) = 2.619

3. The margin of error is the critical t times the estimated standard error = .840 * 2.619 = 2.200

4. The lower bound of the confidence interval is (32 - 24) - 2.2 = 5.8

5. The upper bound of the confidence interval is (32 - 24) + 2.2 = 10.2

Thus, the 99% confidence interval of the sex difference in verbal fluency is 5.8 to 10.2 words per minute.


Lab Questions


Answer the questions in Lab 22 on Blackboard. Some of the questions will require that you use the same dataset as in lab 21. It represents the results of a study on the effects of psychotherapy on aggression and empathy. 38 participants filled out a questionnaire measuring their aggressiveness and empathy before and after therapy.