title: Linear regression on a log-log plot - plot lm() coefficients manually as abline() is producing a bad fit
body: <p>I apologise as I have asked a question along the same lines before but the answer was working well until now. I have produced six plots that looked good using this method, but now I've gotten two weird ones. You can see this "lack of fit" using this example:</p>
  
  <pre><code>x=c(9222,187720,42162,7005,3121,7534,21957,272901,109667,1394312,12230,69607471,79183,6389,64859,32479,3535,9414098,2464,67917,59178,2278,33064,357535,11876,21036,11018,12499632,5160,84574)
  y=c(0,4,1,0,1,0,0,1,5,13,0,322,0,0,1,1,1,32,0,0,0,0,0,0,0,0,0,33,1,1)
  lin=lm(y~x)
  plot(x, y, log="xy")
  abline(lin, col="blue", untf=TRUE)
  </code></pre>
  
  <p>This is a plot I have produced using real data (log-log on the left, normal on the right):</p>
  
  <p><img src="https://i.stack.imgur.com/CqKaF.png" alt="freaky slope"></p>
  
  <p>I wasn't too concerned about the missing 0 values as I assumed lin would still take these into account, however as you can see on the log plot the line does not start even near (1,1). From how it looks now I would expect to see points at around (1000,10).</p>
  
  <p>Anyone know what's going on? Will manually plotting the coefficients of lin help? If so, can anyone explain to me how I would do this? </p>