全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 LATEX论坛
1330 0
2016-10-18
By Will

There are now quite a few R packages to turn cross-tables and fitted models into nicely formatted latex. In a previous post I showed how to use one of them to display regression tables on the fly. In this post I summarise what types of R object each of the major packages can deal with.

Unsurprisingly, there’s quite some variation…

The packages I’m looking at here are: apsrtable (v0.8-8), xtable(v1.7-1), stargazer (v3.0.1), memisc (v0.96-3) and texreg (v1.22).

I should note that all of these packages also allow users to add their own latex representation for new R objects. For example, here’s an addition to memisc to cover mer objects from the lme4 package(now included in memisc). However, I couldn’t be bothered to track down all these additions, so this post only deals with what each package can do without any extra work.

Also, several of these packages can typeset data.frame and matrixobjects too. While that can be incredibly handy, it is outside the focus of this post so I’ve left it out. Cross-tables are only just processed enough to deserve a mention. And we won’t even talk about generating HTML (well, not until the notes anyway).

Finally, I haven’t checked all of this information. The table is filled on the basis of my experience and the package documentation. If something is wrong or incomplete then please let me know in the comments.

PACKAGEMODELXTABLEMEMISCTEXREGSTARGAZERAPSRTABLE
AERivregYY
tobitYYYY
basetableYY
ftableY
betaregbetaregYY
dynlmdynlmYY
ehaaftregY
phregY
weibregY
ergmergmYY
geegeeYYY (in ‘skeleton’ form)
gmmgmmY
lme4glmerModYY
lmerModYY
nlmerModYY
MASSpolrYYY
rlmYY
negbinYYY
mgcvgamY
nlmeglsYY
lmeY
nnetmultinomYY
ordinalclmYYY
sclmY
plmplmYY
pmgYY
psclhurdleYY
zeroinflYY
quantregrqY
releventrem.dyadY
rmslrmYY
robustbaselmrobYY
simexsimexYY
snalnamY
statsglmYYYYY
lmYYYYY
aovY
anovaY
prcompY
tsY
surveysvyglmYYY (in ‘skeleton’ form)
survivalcoxphYYYY
clogitYYY
survregYY
coxph.penalY
systemfitsystemfitY
termgmstergmY
ZeligzeroinflY
cloglog.netY
gamma.netY
probit.netY
logit.netY
RelogitY

Notes

In case you are curious, a first version of this table was generated using the print.xtable function of the xtable package with type=html before being adjusted in place. If these posts haven’t given you the idea yet: I detest doing this sort of thing by hand.

Liviu (in the comments) also mentions the estout package. I’ve never used it, but apparently it deals with lm and plm models and is modeled after a Stata command of the same name.


二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群