Any way to produce a LaTeX table from an lme4 mer model fit object?

Does anyone know a way to produce a nice publication quality LaTeX table from an lme4 mer object? Neither the xtable method (package xtable ) nor the latex method (package Hmisc ) know how to deal with mer objects.

For example, given this fit:

library(lme4)    
fm1 <- lmer(Reaction ~ Days + (Days|Subject), sleepstudy)

Are there any options for producing a nice LaTeX table of the coefficient estimates for both the fixed and random effects?

EDIT:

Because this is somewhat buried in the comment threads below, note that a community wiki is in development for R LaTeX tables: Tools for making latex tables in R


这里是一篇博客文章,看起来就是针对这种情况而制作的,适用于lme4模型的乳胶表格


The answer may be a bit late, but perhaps somebody may find it interesting:

library("texreg")
texreg(fm1)

To typeset multiple lme4 or other models side by side, use something like this:

texreg(list(fm1, fm2))

I may have a hacky solution. I wanted the same thing, specifically the table of coefficients from a glmer model fit (the estimates, SEs, z, and p values). Finding the right part of the summary output and feeding that into xtable seems to have done the trick. Apologies for not supplying reproducible code & data, but from your original example:

fm1 <- lmer(Reaction ~ Days + (Days|Subject), sleepstudy)
xtable(summary(fm1)@coef)

Should give you the table of coefficients, SEs, etc. Note that it just gives the values, not the extra dressing-up of significance stars, etc.

链接地址: http://www.djcxy.com/p/24988.html

上一篇: R data.frame与xtable胶乳输出堆叠指定标题

下一篇: 任何方式从lme4 mer模型适合对象生成LaTeX表格?