title: how to plot the linear regression in R?
body: <p>I want to make the following case of linear regression in R</p>
  
  <pre><code>year&lt;-rep(2008:2010,each=4)
  quarter&lt;-rep(1:4,3)
  cpi&lt;-c(162.2,164.6,166.5,166.0,166.4,167.0,168.6,169.5,170.0,172.0,173.3,174.0)
  plot(cpi,xaxt="n",ylab="CPI",xlab="")
  axis(1,labels=paste(year,quarter,sep="C"),at=1:12,las=3)
  fit&lt;-lm(cpi~year+quarter)
  </code></pre>
  
  <p>I want to plot the line that shows the linear regression of the data that I process. I have tried with:</p>
  
  <pre><code>abline(fit)
  abline(fit$coefficients[[1]],c(fit$coefficients[[2]],fit$coefficients[[3]]))
  </code></pre>
  
  <p>The problem is that my formula is of the form:</p>
  
  <pre><code>y=a+b*year+c*quarter
  </code></pre>
  
  <p>and not something simpler like:</p>
  
  <pre><code>y=a+b*year
  </code></pre>
  
  <p>so how I can draw that line that shows the linear regression?</p>
  
  <p>Is it possible to draw the line with abline?</p>