title: How to get coefficients at once using lbreg in a simulation study
body: <p>I have 1000 datasets which I have run an analysis using the logbinomial package(lbreg) but my results are in a list and I am trying to convert it into a data frame. I have a code and will provide how the list is like because the list has 23 elements for each output for the 1000 datasets</p>
  
  <p>I have tried a lot of things but not converting so I have figured out how the coefficients are packed but now I need to get them once instead of doing 1000 times</p>
  
  <pre><code>library(lbreg)
  nsim = 1000
  for(k in 1:nsim){
    dat &lt;- mydata1[mydata1$Sim == k,]
    sp &lt;- split(mydata1, mydata1$Sim)
    model_list &lt;- lapply(sp, function(dat){
      tryCatch(model1 &lt;- lbreg(y ~ x1+x2, family = binomial(link = log), data = dat),
               error = function(e) e)
    })
  }
  ok &lt;- !sapply(model_list, inherits, 'error')
  fitlist &lt;- model_list[ok]
  </code></pre>
  
  <p>I have tried using </p>
  
  <pre><code>data.frame(matrix(unlist(fitlist), nrow=1000, byrow=T),stringsAsFactors=FALSE)
  </code></pre>
  
  <p>but it failed.</p>
  
  <p>If I do this I get the coefficients but I have to do it up to 1000 to get all the coefficients</p>
  
  <pre><code>data.frame(coef(fitlist$`1`), coef(fitlist$`2`), coef(fitlist$`3`), coef(fitlist$`4`), coef(fitlist$`4`), coef(fitlist$`5`))
  </code></pre>
  
  <p>For a dataset, if you want to check it out 
  <a href="https://github.com/Seanlove89/logitdata" rel="nofollow noreferrer">https://github.com/Seanlove89/logitdata</a></p>