title: Regression in R with Groups
body: <p>I have imported a CSV with 3 columns , 2 columns for Y and X and the third column which identifies the category for X ( I have 20 groups/categories). I am able to run a regression at overall level but I want to run regression for the 20 categories separately and store the co-efs. </p>
  
  <p>I tried the following :</p>
  
  <pre><code>list2env(split(sample, sample$CATEGORY_DESC), envir = .GlobalEnv)
  </code></pre>
  
  <p>Now I have 20 files, how do I run a regression on these 20 files and store the co-effs somewhere. </p>