Original question: ~~I don't know how to intrepet the result I got from my OLS analysis. The issue is that I can fit a horizontal line within the 95% CI even though the overall p-value for the model was less than 0.05. I find this somewhat confusing since fitting a horizontal line within the 95% CI indicate that it satisfies the null hypothesis.~~
Revised question: Based on the linear regression output below, the overall p-value of the model is close to 0.05 (p-value < 0.05246). With such a low p-value, I expected the 95% CI band to be much smaller/ narrower. Am I right to have such assumption?
Below is the R script and data that I used for this analysis. The black line in the figure shows the fitted line; red-dashed shows the 95% CI of the linear model; blue-dashed line shows a reference horizontal line. Please correct me if I am doing something wrong.
# Data
x <- c(693.72, 723.44, 678.94, 385.28, 395.72, 665.89, 659.67, 680.28, 476.28, 657.56)
y <- c(14.220000, 12.073333, 22.106667, 9.746667, 10.553333, 20.256667, 17.270000, 13.246667, 8.346667, 21.760000)
df <- cbind(x,y) |>
as.data.frame()
# Linear model
lmm <- lm(formula = y~x, data = df)
summary(lmm)
# 95% confidence intervals of the linear model
ci <- predict(lmm, newdata = df, interval = "confidence") # default is 95% CI
ci_df <- cbind(ci, x = df$x) |>
as.data.frame()
ci_df <- ci_df[order(ci_df$x), ]
# Plot x vs y and its 95% CI
plot(df$x, df$y)
abline(lmm) # linear model
lines(ci_df$x, ci_df$lwr, lty = 2, col = "red") # lower CI
lines(ci_df$x, ci_df$upr, lty = 2, col = "red") # upper CI
abline(a = 14, b = 0, lty = 2, col = "blue") # reference line
Edit: As suggested by Geln_b and whuber, I expanded the 95% CI lines beyond the observed data points.The blue horizontal line is y = 14.75.
OLS output from R: