Summary : I have fitted my data with a regression line constrained through the first point. This least-squares regression (red line) seems unreliable because of its low slope value.
Here are my data :
library(dplyr); library(stats); library(ggplot2)
data = data.frame(y = c(3.86, 5.22, 7.77, 8.62, 6.2, 4.39, 3.76, 3.31, 3.26), x = c(0:8))
I want to fit y on x with a linear regression through the first point.
intercept <- data$y[1]
lm_model = lm( y-intercept~ x + 0, data = data)
I plot the model (regression line in red) :
data_1 <- data %>% mutate(y_fitted = lm_model$fitted.values + intercept)
ggplot(data = data_1, aes(x = x)) +
geom_point(aes(y = y), color = "black") +
geom_path(aes(y = y_fitted), color = "red")
However, the linear regression seems unreliable with a too low slope.
If I multiply the slope by 2.5, I get this new regression that seems more reliable (in orange) :
data_1 <- data_1 %>% mutate(y_fitted_bis = lm_model$fitted.values*2.5 + intercept)
ggplot(data = data_1, aes(x = x)) +
geom_point(aes(y = y), color = "black") +
geom_path(aes(y = y_fitted), color = "red") +
geom_path(aes(y = y_fitted_bis), color = "orange")
Why does the red linear regression seem unreliable?