What I understand from the inverse fitted line is ;
y = a + b⁄x
data <- data.frame("y"=mtcars$disp,"x"=mtcars$wt)
fit <- lm(data$y ~ data$x)
fit_inverse <- lm(data$y ~ I(1/data$x))
However, since the x axises are different (x and 1/x) , to put them on the same graph you must use different x axises. Otherwise, you need to plot them separately.
plot(data$x,data$y,col = "blue",bty="l",pch=20,ylab = "",xlab="")
lines(data$x,fitted(fit) ,type="l",lty = 29,col="blue")
par(new = TRUE)
plot(1/data$x,data$y, xaxt = "n", yaxt = "n",col = "red", lty =
2,bty="l",pch=10,ylab = "",xlab="")
lines(1/data$x,fitted(fit_inverse) ,type="l",lty = "29",col="red")
axis(side = 3)
legend("top", c("Fitted", "Inverse Fitted"),col = c("blue", "red"), lty
= c(29, 2))
