title: Linear Regression calculation several times in one dataframe
body: <p>I am using R to evaluate climate data and I have a data set that looks like the following miniaturized version... please forgive my crude posting etiquette, I hope this post is understandable.  </p>
  
  <pre><code>[0][STA.NAME] [YEAR] [SUM.CDD]  
  1 NAME1 1967    760  
  2 NAME1 1985    800  
  3 NAME1 1996    740  
  4 NAME1 2003    810  
  5 NAME1 2011    790  
  6 NAME2 1967    700  
  7 NAME2 1985    690  
  8 NAME2 1996    850  
  9 NAME2 2003    790  
  10 NAME3    1967    760  
  11 NAME3    1985    800  
  12 NAME3    1990    740  
  13 NAME3    1996    810  
  14 NAME3    2003    790  
  15 NAME3    2011    800  
  </code></pre>
  
  <p>I am trying to return a new DF with this</p>
  
  <pre><code>[STA.NAME] [Eq'n of trend]  
  NAME1  (y = mx + b)  
  NAME2  (y = mx + b)  
  </code></pre>
  
  <p>etc...</p>
  
  <p>Eventually I will need to calculate variance of the trends, as well as total variance of data and would like to eventually append those to this resulting data set for something like...</p>
  
  <pre><code>[STA.NAME] [TREND] [VAR.TREND] [VAR.DATA]   
  with values in rows, 1 for each STA.NAME...
  </code></pre>
  
  <p>Any help is greatly appreciated, If there is a better way than lm(), with which I am currently stumped, I would be interested as well.</p>
  
  <p>Thank you very much,</p>
  
  <p>Jesse</p>