Chapter 17 T-tests
Angus returned to the Uplands where he normally resides. He has been given a dataset by the Uplands council which contains the number of Haggises per burrow which limp. Each burrow contains 100 Haggises. That has been their unique family structure for ages. Angus has been asked to determine whether there is a statistically significant difference in the percentage of Haggises who limp per burrow after each Haggis family underwent 6 weeks of physiotherapy. It was widely believed that many Haggises limp because of an occupational injury.
Tensions are rising high – many are now blaming the Haggises’ employer. But are they justified in doing so? Hmmm….
Angus has decided to perform a paired t-test. Note that each row in the data is based on one unique Haggis household.
Try out the following code to investigate the matter. The first four lines create the data and the fifth line performs the paired t test. The “before” dataset denotes the percentage of Haggises who limp per Haggis household before undergoing physiotherapy. The “after” dataset denotes the percentage of Haggises who limp per Haggis household after undergoing physiotherapy.
What information does the 95% Confidence Interval provide in this example? What conclusion can Angus make based on the results of the t-test? Is there sufficient information to claim that the Haggises limp because of an occupational injury?
<- rnorm(100,70,1)
before <- rnorm(100,70,1)
after <- before[which(before>=0)]
before <- after[which(after>=0)]
after t.test(before,after,paired=TRUE)
##
## Paired t-test
##
## data: before and after
## t = -1.1645, df = 99, p-value = 0.247
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## -0.4245281 0.1105164
## sample estimates:
## mean of the differences
## -0.1570058
17.1 Some questions to think about
- Can you interpret the results that Angus obtained?
- Why do you think Angus did not consider using an ANOVA test instead?
- Does the test shed any light on whether or not the Haggisses were injured at work?
- What are the assumptions of the paired t-test? (do a search online to find out)