Skip to content
Prev 313636 / 398513 Next

plotting log regression

Hello,

How can you expect to see the fit line if you are ploting x and y 
values, not their logarithms?
And your definitions of x and y are wrong, they should use c().

x <- c(1,2,3,4,5)
y <- c(6,7,8,9,10)

plot(log(x), log(y))

fit <- lm(log(y) ~ log(x))  # Same as glm
abline(fit)


Please read R-intro, in the doc folder of your installation of R.

Hope this helps,

Rui Barradas
Em 14-12-2012 13:58, mrkooper escreveu: