Chalk−1

Math · Introductory statistics · Worked example

Run a one-sided t-test from raw data

Do students in this group sleep less than 7 hours on average? Use the sleep data 4, 8, 6, 5, 3, 7, 9 and 6 hours, a random sample, to test H0: μ=7 against Ha: μ<7 at α=0.05.

Try one — Chalk checks each line

State the hypotheses

The question asks only about less sleep, and it was asked before the data were collected. That makes Ha: μ<7 one-sided, with H0: μ=7 and α=0.05.

Find the mean

Start by summarizing the raw data, the mean first. The eight values add to 48.

488=6

Find s and check the conditions

The squared deviations from 6 add to 28, and the sample divides by n−1=7. The values run from 3 to 9 with no outliers, so a t-test is reasonable even for eight values.

288−1=2

Find the standard error

Divide s by n, not by n.

28≈0.707

Find t

The mean is 1 hour below the claim, about 1.41 standard errors.

6−70.707≈−1.41

Find the p-value

There are 8−1=7 degrees of freedom. For Ha: μ<7 the p-value is the area to the left of −1.41, about 0.100.

Decide

0.100>0.05, so fail to reject H0. The sample mean is below 7, but with only eight students the difference could be chance. The test does not show that the mean is 7.

Result

t≈−1.41 and p≈0.10, so fail to reject H0 at the 5⁢% level.

Your turn

1. One like the example

A gardener wants evidence that a new fertilizer gives mean growth above 5 cm a week, the old average. A random sample of five plants grows 4, 7, 8, 6 and 10 cm. Test H0: μ=5 against Ha: μ>5 at α=0.05.

Show the answer and explanation

t=2 with 4 degrees of freedom and a right-tail p≈0.058, so fail to reject H0.

The mean is 35⁢/5=7, and the squared deviations add to 20, so s=20⁢/4=5. Then SE=5/5=1 and t=(7−5)⁢/1=2. The right tail beyond 2 with 4 degrees of freedom is about 0.058, just above 0.05. Five plants are too few to settle it.

4,7,8,6,104+7+8+6+105=7204=555=17−51=2

2. A variation

Test the sleep data two-sided instead, H0: μ=7 against Ha: μ≠7. What happens to the p-value?

Show the answer and explanation

It doubles to about 0.20, so H0 is still not rejected.

t is still about −1.41 with 7 degrees of freedom. A two-sided test counts both tails, 2×0.1001≈0.20. For the same t, a two-sided test needs stronger evidence.

2⋅0.1001≈0.20

3. Somewhere new

Suppose 32 students had given the same mean, 6 hours, and the same s, 2 hours. Test H0: μ=7 against Ha: μ<7 again.

Show the answer and explanation

t≈−2.83 with 31 degrees of freedom and p≈0.004, so reject H0.

The standard error falls to 2⁢/32≈0.3536, so t≈−1⁢/0.3536≈−2.83, with a left tail of about 0.004. Four times the data halved the standard error. The eight-student test never showed the mean was 7. It was too small to tell.

t=6−72⁢/32t≈−2.83

Keep exploring

In Statistics, Distributions with t=−1.4142, 7 degrees of freedom and the left tail gives p≈0.1001.

Return to the concept →
Sources and scope

Authored study material. Tool results depend on the stated inputs and model assumptions.

After reading

Try it, then study it

Open the example in its tool to check steps or change values, then review the key terms as flashcards.

Find the p-value in Statistics Check t in Math Study the 8 key terms Open worked example on a board Confidence interval in Math Reference

Your existing work stays on this device. Examples open as editable copies.