How to plot a linear regression to a double logarithmic R plot?
Suppose we have following data
someFactor = 500
x = c(1:250)
y = x^-.25 * someFactor
Easiest way to add a regression line to plot
lines(log(x), exp(predict(model, newdata=list(x=log(x)))) ,col="red")
The range of values for x plotted on the log-scale and for log(x) being used as the independent variable are actually quite different. This will give us the full range
lines(x, exp(predict(model, newdata=list(x=x))) ,col="red")