如何获得 p 值的更多位数?
有人知道一种简单的方法让 Stata 在运行 Tobit 回归时显示多于三位数字的 p 值吗?
通常,Stata 报告 p 值为 .001
或 .065
,但我希望看到更多数字,例如 .0011123
或.065320
。
需要明确的是,我不想(必要)改变回归表中数据的生成方式。
我只想让 Stata 为我感兴趣的 p 值显示更多数字。
Does someone know an easy way to get Stata to display more than just three digits for the p-value when running a Tobit regression?
Normally Stata reports that the p-value is .001
or .065
, but I would like to see more digits, for example, .0011123
or .065320
.
To be clear, I don't want to (necessarily) alter the way the data is produced in the regression table.
I only want to be able to get Stata to display more digits for those p-values I am interested in.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
执行 tobit 命令
使用
est tab, p(%12.10g)
(例如) 。即使在相当旧的 Stata 版本中,这也应该可以工作。稍微不太容易的是编写自己的输出过程。
Follow up the tobit command with
est tab, p(%12.10g)
(for example). This ought to work even in pretty old versions of Stata. A little less easy is to write your own output procedure.
Stata 11.1 引入了
set pformat
命令,指定系数表中 p 值的输出格式。 (我不知道 STATA 恐怕因为我认为它已经停产了20世纪80年代的某个时候)。顺便说一句,您可能最好在 Statalist 上提出此类完全针对 Stata 的问题,而不是在这里。
Stata 11.1 introduced a
set pformat
command that specifies the output format of p-values in coefficient tables. (I don't know about STATA I'm afraid as I think that was discontinued some time in the 1980s).By the way, you'd probably be better off asking such completely Stata-specific questions on Statalist rather than here.
很多时候,如果您通过内部名称了解 p 值,则可以获得最高的精度。我通常在几乎每个我会认真使用的命令之后输入
return list
或ereturn list
,然后获取可能类似于e(p)
的结果> 或r(p)
或e(p_chi2)
或包含 p 值的任何标量。A lot of times, you can get the utmost precision if you know your p-value by its internal name. I usually type
return list
orereturn list
after nearly every command that I will seriously use, and then grab results that may look likee(p)
orr(p)
ore(p_chi2)
or whatever the scalar that contains the p-value might be.经过 tobit 回归后,您可以使用
test
命令从原假设 x1=0 中获取 p 值:r(p)
返回的结果After a tobit regression, you can use the
test
command to get the p-value from the null hypothesis x1=0:The result returned in
r(p)
使用
tobit
命令帮助文件中的第一个示例:您可以轻松地从
r()
中返回的结果中获取任何 p 值:然后相应地格式化它:
键入 <从 Stata 的命令提示符中输入 code>help format 以获取更多信息。
Using the first example from the
tobit
command help file:You can easily obtain any p-value from the returned results in
r()
:And then format it accordingly:
Type
help format
from Stata's command prompt for more information.