title: Is this really the most practical way to return the p-value of a linear model (lm) object in R?
body: <p>What is the most practical way of extracting the global p-value of a linear model, <code>lm</code>? I usually end up taking the results from <code>summary</code> and plugging the F-test statistic and degrees of freedom into <code>pf</code>:</p>
  
  <pre><code>set.seed(1)
  n &lt;- 10
  x &lt;- 1:10
  y &lt;- 2*x+rnorm(n)
  fit &lt;- lm(y ~ x)
  summary(fit) # global p-value: 1.324e-08
  fstat &lt;- summary(fit)$fstat
  pval &lt;- pf(fstat[1], fstat[2], fstat[3], lower.tail = FALSE)
  pval
  </code></pre>