title: Exponential Regression Line in R
body: <p>I was plotting some data and was trying to plot exponential regression line through the data points. I have done quite a bit research on how to do that, and finally came across an instruction that I could understand and perform. However, when I continued to use the same method for other plots, the regression line did not seem to fit the data points. I could not figure out why. Can i get some help please?</p>
  
  <p><a href="http://www.theanalysisfactor.com/r-tutorial-5/" rel="nofollow noreferrer">This</a> link is where i found the instruction.</p>
  
  <p>Below are my codes and results:</p>
  
  <pre><code>exponential.model &lt;- lm(A~log(B), AB)
  bvalues &lt;- seq(0,180,0.1)
  exponential &lt;- predict(exponential.model, list(B = bvalues))
  plot(A~B, AB, log="y")
  lines(bvalues, exponential, lwd = 2, col = "red")
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/DOass.jpg" alt="Plot AB"></p>
  
  <pre><code>exponential.model &lt;- lm(C~log(D), CD)
  dvalues &lt;- seq(0,1380,0.1)
  exponential &lt;- predict(exponential.model, list(D = dvalues))
  plot(C~D, CD, log="y")
  lines(dvalues, exponential, lwd = 2, col = “red”)
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/fJqdd.jpg" alt="Plot AB"></p>