title: Extract estimated coefficients and the standard error using tidyverse
body: <p>I have a dataframe like so: </p>
  
  <pre><code>set.seed(560)
  df&lt;-data.frame(lag= rep(1:40, each=228), psit= rep(rnorm(228, 20, 
  10)),var=rnorm(9120, 50, 10))
  </code></pre>
  
  <p>For each subset of <code>lag</code> I would like to run a linear regression where <code>psit</code> is predicted by <code>var</code> (e.g. lm(psit~var, df)). I would like to output the coefficient information for each  value. Specifically, the beta <code>Estimate</code> and the <code>Std. error</code> into a datatframe. Then calculate the standardized effect size. The output should be:</p>
  
  <pre><code> output&lt;-data.frame(lag= rep(1:40, each=1), estimate= rep(rnorm(40, 
   .5, 0.01)),std.error=rnorm(40,0.01, 0.01))
   output$strd.effect &lt;- output$estimate /output$std.error
  </code></pre>
  
  <p>I have tried:</p>
  
  <pre><code>models &lt;- 
   df %&gt;%
   group_by(lag) %&gt;%
   do(model = lm(psit ~ var,data = .))
  
  
  coeff&lt;- 
    models %&gt;%
    ungroup()%&gt;%
    group_by(variable) %&gt;%
    do(glance(estimate=summary(model[i]$coeff[,1],
    std.error=summary(model[i]$coeff[,2])
  
  coeff&lt;-
      coeff %&gt;%
      group_by(variable) %&gt;%
      mutate(std.effect=estimate[[i]]/coeff[[i]]
  </code></pre>