Get startedGet started for free

Testing a mean with a t-test

1. Testing for a mean with a t-test

In the last video of this chapter we discuss t-tests. The functionality in R will be familiar to you, it's the same t-dot-test function we've used previously and pretty much the same conditions for inference. The structure of a hypothesis test will also be familiar from the previous chapter where we did simulation based hypothesis tests. The only difference is that we use the t-distribution to approximate the sampling distribution of the sample mean and find the p-value as the tail area under the t-distribution curve.

2. Hypotheses

Using the same High School and Beyond survey data from the previous video, we answer the question "Do the data provide convincing evidence of a difference between the average reading and writing scores of students?" with a hypothesis test, at the 5% significance level. The null hypothesis, representing the status quo of "there is nothing going on", says the difference between the average reading and writing scores of all students in the population is 0. In other words mu diff is 0. and the alternative hypothesis, which follows from the research question, says that there is a difference. In other words mu diff is different than 0.

3. Testing for a mean with a t-test

We use the t-dot-test function again. The first argument is the variable of interest: the paired differences between reading and writing scores. We also specify a null value, which is 0, and an alternative hypothesis, which is two sided.

4. Testing for a mean with a t-test

The resulting output states a p-value of 0.3868. With such a large p-value we fail to reject the null hypothesis and conclude that the data do not provide convincing evidence of a difference between the average reading and writing scores of students.

5. Let's practice!

Now let's try some examples.