Skip to content

How to show the second abline ?

3 messages · Domokos Péter, Sarah Goslee, Jim Lemon

#
I have no idea where gap.plot() came from, so I can't reproduce this,
but you almost certainly need

y ~ x

in your formula.

abline(coef(lm(y ~ x)),col=1)

Sarah
On Fri, Nov 8, 2013 at 11:04 AM, Domokos P?ter <domszi at gmail.com> wrote:

  
    
#
On 11/09/2013 03:04 AM, Domokos P?ter wrote:
Hi Peter,
Perhaps because both of these numbers:

coef(lm(x~y))
  (Intercept)            y
-176.5047160    0.7425131

are off the scale of your plot. Do you really want:

lmcoef<-coef(lm(y~x))
abline(lmcoef[1]-210,lmcoef[2],col=1)

Jim