title: Linear regression in R (normal and logarithmic data)
body: <p>I want to carry out a linear regression in R for data in a normal and in a double logarithmic plot.</p>
  
  <p>For <strong>normal data</strong> the dataset might be the follwing:</p>
  
  <pre><code>lin &lt;- data.frame(x = c(0:6), y = c(0.3, 0.1, 0.9, 3.1, 5, 4.9, 6.2))
  plot (lin$x, lin$y)
  </code></pre>
  
  <p>There I want to calculate draw a line for the linear regression only of the datapoints 2, 3 and 4.</p>
  
  <p>For <strong>double logarithmic data</strong> the dataset might be the following:</p>
  
  <pre><code>data = data.frame(
      x=c(1:15),
      y=c(
          1.000, 0.742, 0.623, 0.550, 0.500, 0.462, 0.433,
          0.051, 0.043, 0.037, 0.032, 0.028, 0.025, 0.022, 0.020
        )
      )
  plot (data$x, data$y, log="xy")
  </code></pre>
  
  <p>Here I want to draw the regression line for the datasets 1:7 and for 8:15.</p>
  
  <p>Ho can I calculate the <em>slope</em> and the <em>y-offset</em> als well as parameters for the fit (<em>R^2</em>, <em>p-value</em>)?</p>
  
  <p>How is it done for normal and for logarithmic data?</p>
  
  <p>Thanks for you help,</p>
  
  <p>Sven</p>