Hi,
Im struggling with finding best fitting function defined as "y = ax " for data (x, y) = {(1,5), (2,4), (3,3), (4,2), (5,1)}.
I only managed to draw the plot, What function should I use?
df = data.frame(x = c(1,2,3,4,5), y = c(5,4,3,2,1))
plot(df$y ~ df$x)
The other question is why I cant use R2 = 1 −
RSS/TSS?
Thank you for your time.