有什么方法可以从 lme4 mer 模型拟合对象生成 LaTeX 表吗?
有谁知道如何从 lme4 mer
对象生成一个好的出版质量的 LaTeX 表? xtable
方法(包 xtable
)和 latex
方法(包 Hmisc
)都不知道如何处理 <代码>mer 对象。
例如,考虑到这种拟合:
library(lme4)
fm1 <- lmer(Reaction ~ Days + (Days|Subject), sleepstudy)
是否有任何选项可以为固定效应和随机效应生成一个漂亮的 LaTeX 系数估计表?
编辑:
因为这有点隐藏在下面的评论线程中,请注意社区 wiki 正在开发 R LaTeX 表: R 中制作乳胶表的工具
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
答案可能有点晚了,但也许有人会觉得很有趣:
要并排排版多个 lme4 或其他模型,请使用如下内容:
The answer may be a bit late, but perhaps somebody may find it interesting:
To typeset multiple lme4 or other models side by side, use something like this:
这是一篇似乎是为这种情况量身定制的博客文章
lme4 模型的 Latex 表
Here is a blog post that seems tailor made for this situation
Latex Tables for lme4 Models
我可能有一个 hacky 解决方案。我想要同样的东西,特别是 glmer 模型拟合的系数表(估计值、SE、z 和 p 值)。找到摘要输出的正确部分并将其输入 xtable 似乎已经成功了。对于不提供可重现的代码和内容深表歉意数据,但来自您最初的示例:
应该为您提供系数表、SE 等。请注意,它只提供值,而不是重要星星等的额外装扮。
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:
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.