stargazer() LaTeX 输出中的优势比而不是 logits [英] Odds ratios instead of logits in stargazer() LaTeX output

查看:12
本文介绍了stargazer() LaTeX 输出中的优势比而不是 logits的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当使用 stargazer 在逻辑回归对象上创建 LaTeX 表时,标准行为是输出每个模型的 logit 值.是否有可能获得 exp(logit) 代替?也就是说,我可以得到赔率比吗?

When using stargazer to create a LaTeX table on a logistic regression object the standard behaviour is to output logit-values of each model. Is it possible to get exp(logit) instead? That is, can i get the Odds-ratios instead?

在 stargazer 文档中,以下提到了Coef"-argument,但我不明白这是否可以启用 exp(logits).

In the stargazer documentation the following mentions the "Coef"-argument, but I dont understand if this can enable the exp(logits).

Coef:将替换默认值的数值向量列表每个模型的系数值.元素名称将用于匹配系数与个别协变量,因此应匹配协变量名称.NULL 向量表示,对于给定的模型,应使用默认的一组系数.相比之下,NA 向量表示模型的所有系数都应留空.

Coef: a list of numerical vectors that will replace the default coefficient values for each model. Element names will be used to match coefficients to individual covariates, and should therefore match covariate names. A NULL vector indicates that, for a given model, the default set of coefficients should be used. By contrast, an NA vector means that all of the model’s coefficients should be left blank.

推荐答案

根据 2014 年的共生评论,最新版本的 ''stargazer'' 有选项 ''apply.*'' for ''coef'''se'' ''t'' ''p'' 和 ''ci'' 允许直接转换这些统计数据.

As per symbiotic comment in 2014, more recent versions of ''stargazer'' have the options ''apply.*'' for ''coef'' ''se'' ''t'' ''p'' and ''ci'' allowing the direct transformation of these statistics.

apply.coef a function that will be applied to the coefficients.
apply.se a function that will be applied to the standard errors.
apply.t a function that will be applied to the test statistics.
apply.p a function that will be applied to the p-values.
apply.ci a function that will be applied to the lower and upper bounds of the confidence intervals.

意思是可以直接使用...

Meaning you can directly use...

stargazer(model, 
          apply.coef = exp,
          apply.se   = exp)

但是我注意到,简单地对 CI 求幂并没有给出你所期望的结果.

EDIT : I have noticed however that simply exponentiating the CIs does not give what you would expect.

您可以使用描述的方法获得正确的 CI 这里.

EDIT : You can obtain the correct CIs using the method described here.

这篇关于stargazer() LaTeX 输出中的优势比而不是 logits的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆