Re: [R] Regression line limited by the rage of values

2006-05-25 Thread Karl Ove Hufthammer
Andreas Svensson wrote: So, how can I constrain the abline to the relevant region, i.e stop abline from extrapolating beyond the actual range of data. Or should I use a function line 'lines' to do this? One elegant way of doing this is using 'xyplot' from 'lattice' and adding a loess line

[R] Regression line limited by the rage of values

2006-05-24 Thread Andreas Svensson
Hi In R, using plot(x,y) followed by abline(lm(y~x)) produces a graph with a regression line spanning the whole plot . This means that the line extends beyond the swarm of data points to the defined of default plot region. With par(xpd=T) it will span the entire figure region. But how can

Re: [R] Regression line limited by the rage of values

2006-05-24 Thread Marc Schwartz (via MN)
On Wed, 2006-05-24 at 18:51 +0200, Andreas Svensson wrote: Hi In R, using plot(x,y) followed by abline(lm(y~x)) produces a graph with a regression line spanning the whole plot . This means that the line extends beyond the swarm of data points to the defined of default plot region.

Re: [R] Regression line limited by the rage of values

2006-05-24 Thread Greg Snow
Svensson Sent: Wednesday, May 24, 2006 10:52 AM To: r-help@stat.math.ethz.ch Subject: [R] Regression line limited by the rage of values Hi In R, using plot(x,y) followed by abline(lm(y~x)) produces a graph with a regression line spanning the whole plot . This means that the line extends beyond