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

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

问题描述

使用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?

在观星者文档中,以下内容提到"Coef"参数,但我不知道这是否可以启用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"的"coef"选项为"apply.*" "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)

但是我注意到,简单地对配置项求幂并不会给您期望的结果.

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

您可以使用

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

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

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