8. Testing for Differences in Means and Proportions: Paired Samples t-test
Confidence Interval for a Mean Difference
Confidence Interval for a Population Mean Difference
Assuming the sampling distribution of the sample mean difference is (approximately) normal, the general formula for computing a for a population mean difference , based on a random sample of difference scores, is:
Where is the critical value of the distribution such that .
Calculating t* with Statistical Software
Let be the confidence level in .
To calculate the critical value in Excel, make use of the function T.INV():
To calculate the critical value in R, make use of the function qt():
A researcher conducts an experiment in which randomly selected students are invited to eat dinner at a restaurant on two different evenings. On one evening each student receives a regular-size plate and on the other they receive a large-size plate.
On each occasion, the students are allowed to choose as much food as they want from a buffet. Once the students have made their selection, their plates are weighed.
The table below shows how much food (in grams) each student chose when they were a given a regular-size plate and when they were given a large-size plate :
Student | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
385 | 422 | 347 | 360 | 405 | 349 | 304 | 301 | 392 | |
422 | 406 | 384 | 330 | 421 | 328 | 359 | 404 | 482 |
You may assume that the amount of food eaten for either plate size is normally distributed.
Define and construct a confidence interval for the population mean difference . Round your answers to decimal places.
There are a number of different ways we can compute the confidence interval. Click on one of the panels to toggle a specific solution.
Compute the difference scores:
Student | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
385 | 422 | 347 | 360 | 405 | 349 | 304 | 301 | 392 | |
422 | 406 | 384 | 330 | 421 | 328 | 359 | 404 | 482 | |
37 | -16 | 37 | -30 | 16 | -21 | 55 | 103 | 90 |
Assuming the amount of food eaten for either plate size is normally distributed, we know that the sampling distribution of the sample mean difference is normally distributed as well.
If the sampling distribution of the sample mean difference is (approximately) normal, the general formula for computing a for a population mean difference , based on a random sample of size , is:
Compute the mean of the difference scores :
Compute the standard deviation of the difference scores :
For a given confidence level (in ), the critical value of the is the value such that .
To calculate this critical value in Excel, make use of the following function:
T.INV(probability, deg_freedom)
- probability: A probability corresponding to the normal distribution.
- deg_freedom: The mean of the distribution.
Here, we have . Thus, to calculate such that , run the following command:
This gives:
Calculate the lower bound of the confidence interval:
Calculate the lower bound of the confidence interval:
Thus, the confidence interval for the population mean difference is:
Compute the difference scores:
Student | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
385 | 422 | 347 | 360 | 405 | 349 | 304 | 301 | 392 | |
422 | 406 | 384 | 330 | 421 | 328 | 359 | 404 | 482 | |
37 | -16 | 37 | -30 | 16 | -21 | 55 | 103 | 90 |
Assuming the amount of food eaten for either plate size is normally distributed, we know that the sampling distribution of the sample mean difference is normally distributed as well.
If the sampling distribution of the sample mean difference is (approximately) normal, the general formula for computing a for a population mean difference , based on a random sample of size , is:
Compute the mean of the difference scores :
Compute the standard deviation of the difference scores :
For a given confidence level (in ), the critical value of the is the value such that .
To calculate this critical value in R, make use of the following function:
qt(p, df, lower.tail)
- p: A probability corresponding to the normal distribution.
- df: An integer indicating the number of degrees of freedom.
- lower.tail: If TRUE (default), probabilities are , otherwise, .
Here, we have . Thus, to calculate such that , run the following command:
This gives:
Calculate the lower bound of the confidence interval:
Calculate the lower bound of the confidence interval:
Thus, the confidence interval for the population mean difference is:
Connection to Hypothesis Testing
There exists a direct connection between a two-sided paired samples -test for and a confidence interval for :
- If falls inside the , then should not be rejected at the level of significance.
- If falls outside of the , then should be rejected at the level of significance.
Suppose you use the same sample of difference scores to test against at the level of significance.
What would be the conclusion?
Since the confidence interval does not contain the value , we would reject at the level of significance.