In hypothesis testing, the choice between a one-tailed and two-tailed test depends on the specific research question or claim being investigated.
One-tailed test
A one-tailed test (or directional test) is a hypothesis test in which the region of rejection is only on one side of the sampling distribution. This means you are testing for the possibility of the relationship in one direction.
You use a one-tailed test when you have a hypothesis that specifies the direction of the expected effect or difference. For example, you may be testing whether a new drug is better than an existing one, but you are not interested in the possibility that it might be worse.
Hypothesis:
Null hypothesis (H₀): The parameter is equal to a specific value (e.g., μ ≤ some value).
Alternative hypothesis (H₁): The parameter is greater than or less than the specific value (depending on the direction of the test).
Left-tailed test: H1: μ < some value
Right-tailed test: H1: μ > some value
For example, testing whether a pharmaceutical company produces cough syrup bottles with a volume of more than 100 ml.
- H0: μ ≤ 100 ml
- H1: μ > 100 ml (right-tailed test)
Two-tailed test
A two-tailed test is a hypothesis test where the region of rejection is on both sides of the sampling distribution. In this case, you are testing for the possibility of an effect in either direction (whether the sample mean is significantly greater than or less than a certain value).
You use a two-tailed test when you have a hypothesis that does not specify the direction of the effect or difference. For instance, you might be testing whether a drug has any effect, without specifying whether the effect is positive or negative.
Hypothesis:
Null hypothesis (H₀): The parameter is equal to a specific value.
H0: μ = some value
Alternative hypothesis (H₁): The parameter is not equal to the specific value.
H1: μ ≠ some value
For example, testing whether a coin is biased (whether it’s not equally likely to land heads or tails).
H0: p = 0.5
H1: p ≠ 0.5 (two-tailed test)
Key difference between one-tailed and two-tailed test
1. Direction
one-tailed – the alternative hypothesis specifies a direction (greater or less than).
two-tailed – the alternative hypothesis specifies no direction, only the parameter value is not equal to the null value.
2. Critical Region
one-tailed – the critical region is on only one side of the sampling distribution. For example, for a right-tailed test, the rejection area is on the upper side.
two-tailed – the critical regions are on both sides of the distribution, equally divided.
3. Critical Value
one-tailed – the critical value corresponds to the chosen significance level (α) on one side of the distribution.
Two-tailed – the critical values are split between two sides of the distribution. For example, if α=0.05, then each tail will have a critical value of α/2 = 0.025.
4. p-value
one-tailed – The p-value is computed as the area under the curve on one side (left or right) of the test statistic.
two-tailed – The p-value is computed as the total area under both tails of the distribution.
5. Critical Value Differences
Critical Value for One-Tailed Test:
- If α=0.05, for a one-tailed test, the critical value would correspond to 95% of the area under the curve on one side.
- For example, in a normal distribution, a right-tailed test at α = 0.05 has a critical value of 1.645 (z-score).
Critical Value for Two-Tailed Test:
- For a two-tailed test, if α = 0.05, then the critical region is divided equally between both tails. Therefore, each tail gets an area of α/2 = 0.025.
- In a normal distribution, the critical z-scores for a two-tailed test at α=0.05 are ±1.96.
Let us work on a problem using R.
A manufacturer claims that the mean lifetime of its light bulbs is 1000 hours. You suspect the claim is exaggerated and perform a test using a sample of 30 bulbs, whose lifetimes you record and you get 980 hours. Assume the population standard deviation is 50 hours. You want to test:
- One-tailed test: Test if the mean lifetime is less than 1000 hours.(left tailed)
- Two-tailed test: Test if the mean lifetime is different from 1000 hours.
Step1: Hypothesis
First step is to write the hypothesis.
One-tailed:
Null Hypothesis (H0): μ≥1000 hours (The mean lifetime of the bulbs is at least 1000 hours.)
Alternative Hypothesis (Ha): μ<1000 hours (The mean lifetime of the bulbs is less than 1000 hours.)
Two-tailed:
Null Hypothesis (H0): μ=1000 hours (The mean lifetime of the bulbs is exactly 1000 hours.)
Alternative Hypothesis (Ha): μ≠1000 hours (The mean lifetime of the bulbs is different from 1000 hours.)
Step 2: Getting Z-score & p-value
# Input data
> sample_size <- 30 # Sample size
> sample_mean <- 980 # Sample mean (observed)
> population_sd <- 50 # Population standard deviation
> hypothesized_mean <- 1000 # Null hypothesis mean
# Calculate standard error
> standard_error <- population_sd / sqrt(sample_size)
# One-tailed test (left-tailed)
> z_one_tailed <- (sample_mean – hypothesized_mean) / standard_error
> z_one_tailed
> p_one_tailed <- pnorm(z_one_tailed)
> p_one_tailed
# Two-tailed test
> z_two_tailed <- (sample_mean – hypothesized_mean) / standard_error
> z_two_tailed
> p_two_tailed <- 2 * pnorm(abs(z_two_tailed), lower.tail = FALSE)
> p_two_tailed
Step 3: Interpretation & Results
Interpretation: One-tailed test (left-tailed)
1. from Z-score:
The Z-score is -2.19 & the p-value is 0.0143. You can use a z-table to find the critical value(s) corresponding to your significance level (α). For a one-tailed test at α=0.05: Critical zα=1.645 (right/upper tail) or zα=−1.645 (left/lower tail).
If z>1.645, reject H0 (for Ha: μ>1000); right tail.
If z<−1.645, reject H0 (for Ha: μ<1000); left tail.
In a left-tailed test, for a significance level of 0.05, it means that 5% of the total area under the normal curve is in the left tail. If the z-score of the sample mean (z) falls in this critical region (i.e., z<−1.645), we reject the null hypothesis (H0). We are checking if the sample mean is significantly less than the hypothesized population mean (μ0).
Zstatistic = -2.19 < Zα = −1.645. So, we reject H0.
2. from p-value:
The P-value (0.0143) < α=0.05, so we reject the null hypothesis.
The hypothesis from Z-score & p-value indicates that the mean lifetime of the bulbs is likely less than 1000 hours.
Interpretation: Two-tailed test
A two-tailed test checks if the sample mean is significantly different from the hypothesized mean (μ0) in either direction (higher or lower). The rejection region is split between the two tails of the normal distribution.
1. from Z-score:
For a two-tailed test at α=0.05, divide the significance level equally between the two tails, i.e., α/2=0.025. The critical z-values are zα/2=±1.96 (from the z-table). If z>1.96 or z<−1.96, we reject H0.
Zstatistic = -2.19 < Zα = -1.96, we reject H0.
2. from p-value:
The p-value 0.0286 < α=0.05, so we reject the null hypothesis.
The hypothesis from z-score and p-value indicates that the mean lifetime of the bulbs is different from 1000 hours.
The p-value is widely used and if your infer your hypothesis using p-value that should be sufficient.
For the above problem, you can alternatively use t.test() if you have the data ‘bulbs’ with all 30 data points. Remember that t-test is not the same as one-tailed or two-tailed test.
> t.test(bulbs, mu = 1000, alternative = “less”)
> t.test(bulbs, mu = 1000, alternative = “two.sided”)
We can use the z-score for hypothesis testing if you know the population standard deviation (σ) or have a sufficiently large sample size (n>30) for the sample standard deviation (s) to approximate σ. In this case, the population standard deviation (σ) is not explicitly given and n < 30. In such cases, we should use the t-test instead of the z-test, unless n is large enough to approximate normality using s.