Skip to content
Prev 308359 / 398506 Next

Getting a table of coefficients from R

You have a list of models, the coef and confint functions only work on
a single model, so you need to use lapply or sapply to get the
information from each model.  Possibly something like (untested):

tableOfOddsRatios <- sapply( models, function(x) exp(c( coef(x)[2],
confint(x)[2,]) )

I included the [2] and [2,] to exclude the intercept from each model,
but this could be changed if you want that information as well.  You
may need to transpose the results of the above.
On Thu, Oct 18, 2012 at 9:06 AM, <danibelle at talk21.com> wrote: