title: Scoring new data from many linear regressions that were grouped
body: <p>I created many different linear regression equations by Customer group using tidy, augment, and glance. This outputted the coefficients and fitted values. I want to now forecast a new set of data using these equations. How do I pipe predict into the code? Or, how can I move the coefficients to a new dataframe that has all the coefficients be in the same row as the model it represents? (not like tidy that lists the coeff estimates within one column) Within the df_glance dataset output there is a column named fit that contains a list of each equation could I utilize that somehow?
  Am I missing an easier way to get the predictions of the new dataset?</p>
  
  <pre><code>df_glance=data%&gt;%
  nest(-Customer)%&gt;%
  mutate(fit=map(data~lm(log(MOUs+1)~rank+x1+x2+trendx1+trendx2+Month,data=.)),
         results=map(fit, glance))%&gt;%
  unnest(results)
  
  df_tidy=data%&gt;%
  nest(-Customer)%&gt;%
  mutate(fit=map(data~lm(log(MOUs+1)~rank+x1+x2+trendx1+trendx2+Month,data=.)),
         results=map(fit, tidy))%&gt;%
  unnest(results)
  
  df_augment=data%&gt;%
   nest(-Customer)%&gt;%
  mutate(fit=map(data~lm(log(MOUs+1)~rank+x1+x2+trendx1+trendx2+Month,data=.)),
         results=map(fit, augment))%&gt;%
  unnest(results)
  </code></pre>