Comment on One-sided t confidence intervals continued:
Start with a sample of 25 observations from $\mathsf{Norm}(\mu = 100, \sigma=10):$
set.seed(505)
x = rnorm(25, 100, 10)
mean(x); sd(x)
## 97.0539 # sample mean
## 9.853215 # sample standard deviation
The sample mean is about $\bar X = 97.05,$ which
is smaller than $\mu_0 = 100.$
Is that sufficient evidence to reject $H_0: \mu = \mu_0 = 100$ against the one sided alternative $H_a: \mu < \mu_0?$
t.test(x, mu = 100, alte="less")
One Sample t-test
data: x
t = -1.495, df = 24, p-value = 0.07397
alternative hypothesis: true mean is less than 100
95 percent confidence interval:
-Inf 100.4254
sample estimates:
mean of x
97.0539
Because the P-value (about $7.4\%)$ exceeds 5%, we do not reject $H_0: \mu = \mu_0$ against the left-sided
alternative at the 5% level of significance.
The left-sided 95% confidence interval is $(-\infty, 100.4254).$ This indicates that data are consistent with a true mean below $100.4254.$
For example, in terms of possible null values $\mu_0:$ We would not have rejected with $\mu_0 = 100.4$ or with $\mu_0=99.2$
(or any other hypothetical mean below $100.4254.)$
Below we show just the P-values for the two values of $\mu_0$ mentioned above:
t.test(x, mu = 100.4, alte="less")$p.val
## 0.05122181 # barely avoids rejection at 5%
t.test(x, mu = 99.2, alte="less")$p.val
## 0.1434768 # not even close to rej at 5%
Note: A direct computation of the upper limit
of the left-sided 95% CI shown in R's output
for the t test above is as follows:
$$\bar X + t_U S/\sqrt{n},$$
where $\bar X$ and $S$ are the respective sample mean and standard deviation and $t_U$ cuts probability 5% from the upper tail of Student's t distribution with 24 degrees of freedom. This computes to $100.4254.$
t.u = qt(.95, 24); t.u
## 1.710882
mean(x) + t.u*sd(x)/sqrt(25)
## 100.4254