Two-Tailed Tests

  • For two-tailed tests, what is matters is whether the test-statistic lands in the left or right tail; i.e., whether it is negative or positive.
  • Note that the probability (i.e., \(p\)-value’s area under the curve) is mirrored in the case of two-tailed tests.

1. If your test-statistic is negative (e.g., \(T = -1.5\)), then you are going to use . . .

pt(-1.5, df = 4) * 2
## [1] 0.208


Confidence Interval Information


\(\begin{aligned} \text{Confidence Interval} &= \bar{x} \pm \text{(critical $t$-score)} \cdot \text{(standard error)} \\ &= [\text{ lower bound}, \text{ upper bound }] \end{aligned}\)

# Critical t-calculation
alpha <- 0.05
abs(qt(alpha / 2, df = 4))
## [1] 2.776445
  • The absolute value (abs()) is used because the confidence interval equation already accounts for the direction of each boundary through addition (+) and subtraction (-). This eliminates the need to compute separate critical \(t\)-scores for each side.



2. If your test-statistic is positive (e.g., \(T = 1.5\)), then you are going to use . . .

pt(1.5, df = 4, lower.tail = FALSE) * 2
## [1] 0.208


Confidence Interval Information


\(\begin{aligned} \text{Confidence Interval} &= \bar{x} \pm \text{(critical $t$-score)} \cdot \text{(standard error)} \\ &= [\text{ lower bound}, \text{ upper bound }] \end{aligned}\)

# Critical t-calculation
alpha <- 0.05
abs(qt(alpha / 2, df = 4))
## [1] 2.776445
  • The absolute value (abs()) is used because the confidence interval equation already accounts for the direction of each boundary through addition (+) and subtraction (-). This eliminates the need to compute separate critical \(t\)-scores for each side.



One-tailed tests

  • For one-tailed tests, what is matters is where the critical region (red) is located (left or right tail). This is determined by the null hypothesis.
  • Whether the test-statistic is positive or negative has no bearing on how the \(p\)-value is calculated.

3. If your critical region is in the left tail (e.g., \(H_0 : \mu \geq 1.5\)) then you are going to use . . .

pt(1.5, df = 4)
## [1] 0.896


Confidence Interval Information


\(\begin{aligned} \text{Confidence Interval} &= \bar{x} + \text{(critical $t$-score)} \cdot \text{(standard error)} \\ &= (-\infty, \text{ upper bound }] \end{aligned}\)

# Critical t-calculation
alpha <- 0.05
abs(qt(alpha, df = 4))
## [1] 2.131847
  • The confidence interval is expressed in terms of the alternative hypothesis \(H_1: \mu < 1.5\).
  • For one-tailed tests, the critical \(t\)-score is calculated using the entire significance level \(\alpha\).
  • The absolute value (abs()) is used because the direction of the boundary is already specified by the addition (+) in the confidence interval equation.



4. If your critical region is in the right tail (e.g., \(H_0 : \mu \leq 1.5\)) then you are going to use . . .

pt(1.5, df = 4, lower.tail = FALSE)
## [1] 0.104



Confidence Interval Information


\(\begin{aligned} \text{Confidence Interval} &= \bar{x} - \text{(critical $t$-score)} \cdot \text{(standard error)} \\ &= [\text{ lower bound}, \infty) \end{aligned}\)

# Critical t-calculation
alpha <- 0.05
abs(qt(alpha, df = 4))
## [1] 2.131847
  • The confidence interval is expressed in terms of the alternative hypothesis \(H_1: \mu > 1.5\).
  • For one-tailed tests, the critical \(t\)-score is calculated using the entire significance level \(\alpha\).
  • The absolute value (abs()) is used because the direction of the boundary is already specified by the subtraction (-) in the confidence interval equation.