How can I get more digits for a p-value?

Viewed 15776

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.

5 Answers

Using the first example from the tobit command help file:

. 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

You can easily obtain any p-value from the returned results in 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

And then format it accordingly:

. matrix results = r(table)

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

Type help format from Stata's command prompt for more information.

Related