title: How can I compare regression coefficients across three (or more) groups using R?
body: <p>Sometimes your research may predict that the size of a regression coefficient may vary across groups. For example, you might believe that the regression coefficient of height predicting weight would differ across three age groups (young, middle age, senior citizen). Below, we have a data file with 3 fictional young people, 3 fictional middle age people, and 3 fictional senior citizens, along with their height and their weight. The variable age indicates the age group and is coded 1 for young people, 2 for middle aged, and 3 for senior citizens.</p>
  
  <p>So, how can I compare regression coefficients (slope mainly) across three (or more) groups using R? </p>
  
  <p>Sample data:</p>
  
  <pre><code>age height weight 
   1  56 140   
   1  60 155   
   1  64 143     
   2  56 117   
   2  60 125   
   2  64 133      
   3  74 245   
   3  75 241   
   3  82 269   
  </code></pre>