To analyse a paired data set, we use the exact same tools that we developed in Chapter 2.6 except now we apply them to the differences in the paired observations.
73 | 12.76 | 14.26 |
---|
Set up and implement a hypothesis test to determine whether, on average, there is a difference between Amazon’s price for a book and the UCLA bookstore’s price.
Answer. There are two scenarios: there is no difference or there is some difference in average prices. The no difference scenario is always the null hypothesis:
. There is no difference in the average textbook price.
. There is a difference in average prices.
Can the normal model be used to describe the sampling distribution of ? We must check that the differences meet the conditions established in Chapter 2.6. The observations are based on a simple random sample from less than 10% of all books sold at the bookstore, so independence is reasonable; there are more than 30 differences; and the distribution of differences, shown in Figure LABEL:diffInTextbookPricesS10, is strongly skewed, but this amount of skew is reasonable for this sized data set (). Because all three conditions are reasonably satisfied, we can conclude the sampling distribution of is nearly normal and our estimate of the standard error will be reasonable.
We compute the standard error associated with using the standard deviation of the differences () and the number of differences ():
To visualize the p-value, the sampling distribution of is drawn as though is true, which is shown in Figure LABEL:textbooksS10HTTails. The p-value is represented by the two (very) small tails.
To find the tail areas, we compute the test statistic, which is the Z score of under the null condition that the actual mean difference is 0:
This Z score is very large and pnorm(7.59)=, which ensures the single tail area will be 0. Since the p-value corresponds to both tails in this case and the normal distribution is symmetric, the p-value can be estimated as twice the one-tail area:
Because the p-value is less than 0.05, we reject the null hypothesis. We have found convincing evidence that Amazon is, on average, cheaper than the UCLA bookstore for UCLA course textbooks.
Create a 95% confidence interval for the average price difference between books at the UCLA bookstore and books on Amazon.
Answer. Conditions have already verified and the standard error computed in Example 3.1.1. To find the interval, identify (1.96 for 95% confidence) and plug it, the point estimate, and the standard error into the confidence interval formula:
We are 95% confident that Amazon is, on average, between $9.49 and $16.03 cheaper than the UCLA bookstore for UCLA course books.