When you finish, you will have a two-tailed p-value for a one-sample t-test, built from four numbers: the sample mean, the sample standard deviation, the sample size and the mean you are testing against. It takes about ten minutes with a printed t-table, and seconds with software.
Before you start, decide whether your question is two-sided ("is the mean different from the claim?") or one-sided ("is it lower?"). That choice decides whether you double the tail area in the last step, and getting it wrong is the most common way to end up with the wrong number.
What you need
-
The sample mean (x̄)
The average of your measurements.
-
The sample standard deviation (s)
Calculated from the same sample. If you know the true population standard deviation instead, you need a z-test, not this one.
-
The sample size (n)
The number of measurements.
-
The hypothesized mean (μ)
The claimed or target value you are testing against.
-
A t-distribution table, or software
R or Minitab both work. A calculator with a square root key covers the rest.
Getting from the formula to the p-value
The worked example comes from Statology's walkthrough: someone wants to test the claim that a plant species averages 15 inches tall. They measure 20 plants and get a mean of 14 inches, with a standard deviation of 3 inches.
1. Write the two hypotheses. The null hypothesis, the claim being tested, is H0: μ = 15. The alternative is Ha: μ ≠ 15. You should see: a "not equal" sign, which means the test is two-tailed.
2. Compute the standard error. Divide s by the square root of n: 3 / √20 = 3 / 4.472 = 0.671. You should see: a number smaller than s, because averages vary less than single measurements.
3. Compute the t-statistic. Use t = (x̄ − μ) / (s/√n), which is the formula the NIST engineering handbook gives for the case where the population standard deviation is unknown. Here that is (14 − 15) / 0.671 = −1.49. You should see: a negative t, because the sample came in below the claim.
4. Find the degrees of freedom. For a one-sample t-test this is n − 1, so 20 − 1 = 19. You should see: one less than your sample size.
5. Locate the row for 19 degrees of freedom in the t-table. Read across it until you find the two values that 1.49 sits between. Use the absolute value, since the table lists positive numbers only. You should see: 1.49 falling between the columns headed 0.10 and 0.05 (one-tailed).
6. Read off the one-tailed p-value range. The column headers are tail areas, so the one-tailed p-value lies between 0.05 and 0.10. Statology estimates it at 0.075. You should see: a range, not an exact figure. Tables only bracket.
7. Double it for a two-tailed test. The range becomes 0.10 to 0.20, and the estimate becomes 0.15. As Minitab's documentation puts it, the two-sided p-value is 2 × (1 − cdf(|t|)): twice the area in one tail. You should see: a number twice the size of step 6.
8. Check it in software. In R, type 2*pt(1.49, df=19, lower=F), the same form used in David Hitchcock's worked examples at the University of South Carolina. In Minitab, use Calc > Probability Distributions. You should see: about 0.153. Statology reports the exact value as 0.15264, close to the table estimate of 0.15.
When the number looks wrong
You now have a p-value you can defend line by line: 0.15 in this example, or whatever your own four numbers produce. What that number permits you to conclude is a separate question, and it is where most mistakes happen. A p-value of 0.15 does not mean there is a 15 percent chance the claim is true. The page on what a p-value tells you takes those misreadings one at a time.
Next: reading the number you just calculated
What a p-value measures, what it does not, and the misreadings that turn a 0.15 into a false conclusion.
What a p-value tells you
Comments
No comments yet. Be the first to comment!
Leave a Comment