In this report, I will be demonstrating an understanding of normality, t-tests, and how this can determine the rejection or acceptation of a null hypothesis. I will using the difference in reaction time from before drinking 2 beers and after drinking 2 beers. Using this data I will be able to determine whether we reject or accept the null hypothesis.

Normality

A big part of running tests on data like this, is to ensure that they are normally distributed. This data sets sample size is not sufficiently large (n>=30), so we will have to create a histogram and qq plot to indicate that data is normal.

After creating this histogram, we can see that the data is approximately normally distributed. After playing around with the bins, I was able to find that even though this population looked like it was not normally distributed, once I found the right bin it was indeed normal. There is a much easier way to check this however using QQ-plots which will be shown below.

When looking at a QQ-plot, it gives a great look at whether a population is normally distributed. When examining these graphs, it is important to look that each data point lies within the envelope. In this scenario, each data point does indeed lie within the envelope meaning there is another example displaying that the population is normally distributed.

Before and After Beers Reaction Test

After joining our two data sets together (before and after) and adding the “AfterMinusBefore” column, I examined the data to see if there was an increase in average reaction time after drinking two beers. Stated below are the null and alternative hypotheses as well as the t-test for the given population. \[H_O:\mu=0\] \[H_a:\mu>0\]

## 
##  Paired t-test
## 
## data:  subjectJoin$After and subjectJoin$Before
## t = 2.6031, df = 19, p-value = 0.008734
## alternative hypothesis: true mean difference is greater than 0
## 95 percent confidence interval:
##  0.1690516       Inf
## sample estimates:
## mean difference 
##          0.5035

Decision

With a p-value of 0.008734, it is much smaller than the alpha value of 0.05. Since p is small, we are able to reject the null hypothesis.

Conclusion

At a 0.05 level of significance there is enough evidence in the population to support that, on average, reaction times do increase after drinking two beers.