[R] plot regression line, log-transformation

Johannes Radinger JRadinger at gmx.at
Mon Sep 5 13:07:00 CEST 2011

Hello UseRs,

I've somehow general questions.
I've got a dataset which shows signs of heteroscedasticity and non-normality in errors if I do a normal linear regression of the form Y~X. So to things came into my mind, either transforming the variables (log or log10) or using robust regression. So my first question:

How can I decide what is the better method? Either: lm(log(Y)~log(X)) or rlm(Y~X)? Or is it even necessary to log transform for the robust regression?

Another question has to do with the plotting:
I can do a simple scatterplot with plot(Y~X) but that doesn't give a good picture as lot of the points are clumped in the left down corner. So I thought I could use either: plot(Y~X,log="xy") or plot(log(Y)~log(X)) but then I have problems if I want to plot also the abline from the robust regression (which is then probably not a straight line anymore). How do you deal with such cases where the plot uses different scaling (log) then the regression (and therefore the abline).

Thank you very much!

best regards,

More information about the R-help mailing list