Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Number of decimals in F-test

    Hello,

    After estimating a regression equation, I am using the test statement to test patterns of coefficients. The F-test only reports two decimals, and I would like to report three. If I follow each test statement with "return list F", the F-test has 15 decimals, which I can round off. However, this approach is cumbersome, and I'd like to control how many decimals Stata reports for the initial test statement. I examined the format command, but it apparently applies to variables, not statistical tests.

    Stata also exhibits similar behavior in the regression output itself. For example, in the output I am currently examining, the t-tests and F-test have two decimals, the coefficients and sums of squares have six decimals, standard errors have seven decimals, and probability levels have three or four decimals. This formatting strikes me as oddly inconsistent, as it doesn't seem to follow any general principles about the number of significant digits that should be used when reporting results (and any such principles should be provisional, based on the variables and research questions being analyzed). Perhaps a more experienced Stata user can help me understand the rationale behind this and how to control the decimals in reported output.

    Thanks much,

    Jeff Edwards

  • #2
    see
    Code:
    help cformat

    Comment


    • #3
      Thanks for your help. I read the help file and the associated pdf, which describe the cformat, pformat, and sformat commands as follows:

      set cformat specifies the output format of coefficients, standard errors, and confidence limits in coefficient tables.
      set pformat specifies the output format of p-values in coefficient tables.
      set sformat specifies the output format of test statistics in coefficient tables.

      From this, it seemed that sformat would allow me to specify more digits for the F-test. Unfortunately, it didn't work. Here is some sample output without any formatting commands:

      . reg de se je

      . reg de se je

      Source | SS df MS Number of obs = 402
      -------------+---------------------------------- F(2, 399) = 50.50
      Model | 209.804339 2 104.902169 Prob > F = 0.0000
      Residual | 828.852377 399 2.07732425 R-squared = 0.2020
      -------------+---------------------------------- Adj R-squared = 0.1980
      Total | 1038.65672 401 2.59016638 Root MSE = 1.4413

      ------------------------------------------------------------------------------
      de | Coef. Std. Err. t P>|t| [95% Conf. Interval]
      -------------+----------------------------------------------------------------
      se | .3635512 .0590163 6.16 0.000 .2475294 .479573
      je | -.4525608 .0478995 -9.45 0.000 -.5467277 -.3583939
      _cons | .7478145 .3389796 2.21 0.028 .0814053 1.414224
      ------------------------------------------------------------------------------

      Here is the same output with formatting commands:

      . reg de se je, cformat(%9.3f) pformat(%5.3f) sformat(%8.3f)

      Source | SS df MS Number of obs = 402
      -------------+---------------------------------- F(2, 399) = 50.50
      Model | 209.804339 2 104.902169 Prob > F = 0.0000
      Residual | 828.852377 399 2.07732425 R-squared = 0.2020
      -------------+---------------------------------- Adj R-squared = 0.1980
      Total | 1038.65672 401 2.59016638 Root MSE = 1.4413

      ------------------------------------------------------------------------------
      de | Coef. Std. Err. t P>|t| [95% Conf. Interval]
      -------------+----------------------------------------------------------------
      se | 0.364 0.059 6.160 0.000 0.248 0.480
      je | -0.453 0.048 -9.448 0.000 -0.547 -0.358
      _cons | 0.748 0.339 2.206 0.028 0.081 1.414
      ------------------------------------------------------------------------------

      Note that only some of the results are affected (for my purposes, the F-test is the same). I get the same result when I use the sformat command with the test command (i.e., the F-test has two decimals regardless of how the sformat command is specified).

      I would welcome any additional ideas!

      Thanks,

      Jeff

      Comment


      • #4
        I do not think you can format the display of the anova table... only the coefficients table. But after regress, you can always access scalars in e()

        Code:
        di %6.3f e(F)
        or after the test command

        Code:
        di %6.3f r(F)
        Last edited by Andrew Musau; 25 Nov 2017, 16:48. Reason: additional info. to include the test command

        Comment

        Working...
        X