Remember that for sd (and var), R uses the sample standard deviation with its correction of n / n-1.
From these values, we can get the standard error of the mean, sem = sd(e)/ √n. Since n = 9, we calculate sem = 0.71/3 = 0.2374
If the sample size were not an issue, we would calculate a confidence interval for a two-sided test of:
And for the one-sided test, since we specified that the null hypothesis has μ >= 6, we multiply by the value (from the last post) using p = 95 %:
The small sample correction for the t test means that instead of using values from the standard normal distribution in the calculation above, we get them from the t-distribution, in this case for df (degrees of freedom) = n-1 = 9.
So, instead of using 1.96 (or 1.64) as the multiplier, we use 2.26 (two-sided test, df = 8).
or, for a one-sided test we multiply by the 95 % level of the t-distribution with df = 8 (1.85):
Since 5.36 is definitely < 6, we can say the result is significant at p = 0.05.
R gives this. Notice they find the p-value at which the distribution becomes > 6. I'm not sure this is kosher, but you see it a lot: