title: How to calculate the 'Coefficient of determination' for a linear model in R?
body: <p>I have the following set of <code>x</code> and <code>y</code> values:</p>
  
  <pre><code>x = c(1:150)
  y = x^-.5 * 155 + (runif(length(x), min=-3, max=3))
  </code></pre>
  
  <p>And run a linear regression on the data:</p>
  
  <pre><code>plot(x, y, log="xy", cex=.5)
  
  model = lm(log(y) ~ log(x))
  model
  </code></pre>
  
  <p>Now I'd like to have a measure for the quality of the regression and was told that people usually use R^2 ('Coefficient of determination'), which should be close to one.</p>
  
  <p>How can I easily calculate the value in R? I've seen that residuals etc. are already calculated.</p>