6

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.

4

5 回答 5

8

跟进 tobit 命令

est tab, p(%12.10g)

(例如)。即使在相当旧的 Stata 版本中,这也应该可以工作。不太容易的是编写自己的输出过程。

于 2010-10-27T21:08:32.963 回答
5

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.

于 2010-10-27T17:41:00.247 回答
1

很多时候,如果您通过其内部名称知道您的 p 值,您可以获得最大的精度。我通常在我将认真使用的几乎每个命令之后键入return listereturn list,然后获取可能看起来像e(p)orr(p)e(p_chi2)或包含 p 值的标量可能是的结果。

于 2012-08-17T21:08:35.237 回答
0

在进行 tobit 回归后,您可以使用test命令从原假设 x1=0 中获取 p 值:

sysuse auto
tobit weight trunk length headroom, ll(1500)
test trunk

结果返回r(p)

return list
于 2012-08-24T12:20:13.403 回答
0

使用tobit命令帮助文件中的第一个示例:

. sysuse auto, clear
. generate wgt = weight / 1000

. tobit mpg wgt, ll(17)

Tobit regression                                Number of obs     =         74
                                                LR chi2(1)        =      72.85
                                                Prob > chi2       =     0.0000
Log likelihood = -164.25438                     Pseudo R2         =     0.1815

------------------------------------------------------------------------------
         mpg |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         wgt |   -6.87305   .7002559    -9.82   0.000    -8.268658   -5.477442
       _cons |   41.49856    2.05838    20.16   0.000     37.39621     45.6009
-------------+----------------------------------------------------------------
      /sigma |   3.845701   .3663309                      3.115605    4.575797
------------------------------------------------------------------------------
            18  left-censored observations at mpg <= 17
            56     uncensored observations
             0 right-censored observations

您可以轻松地从返回的结果中获取任何 p 值r()

. matrix list r(table)

r(table)[9,3]
             model:      model:      sigma:
               wgt       _cons       _cons
     b  -6.8730504   41.498557   3.8457011
    se   .70025591   2.0583803   .36633085
     t  -9.8150552   20.160782          .b
pvalue   5.610e-15   1.471e-31          .b
    ll  -8.2686584   37.396211   3.1156048
    ul  -5.4774424   45.600903   4.5757975
    df          73          73          73
  crit   1.9929971   1.9929971   1.9929971
 eform           0           0           0

然后相应地格式化它:

. matrix results = r(table)

. display %18.17f results[4,1]
0.00000000000000561

在 Stata 的命令提示符下键入help format以获取更多信息。

于 2018-05-31T12:38:09.847 回答