Announcement

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

  • Interpretation of ttest command and p value

    Hello Statalist,

    My question is about the 'ttest' command. The data includes the returns of a stock (see dataex example below). I want to test whether the returns are > 0 with significance level of 0.05. My question is whether this can be done by using the following command:

    ttest returnBUYSELLMA8_0p5_2_0 == 0


    The results:
    Click image for larger version

Name:	Schermafbeelding 2022-01-28 om 2.01.46 PM.png
Views:	1
Size:	33.9 KB
ID:	1647119



    Then I will have to look at the Pr(T > t) = 0.0000 value. What is the reason it is exactly 0.0000? Coincidence or does Stata not give more values after four zero's?

    Thank you a lot in advance.

    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input float returnMA8_0p5_2_0
        .3430868
               0
       .18330643
    -.0006944396
      -.09748733
         .157546
        .3222847
       -.6935745
      -.20959064
        1.287822
        .3004651
      .020013265
      -.04793998
       .16305614
       -.1613806
        .6232174
       .00817757
     .0004640102
        .8821417
               0
       .06751802
     .0004664179
     -.064593524
       .02559367
       -.4879828
      -.27945906
        .0517562
      -.33261395
      -.07048872
        .1826529
        .4290987
       -.4988926
       .19883224
        .5680488
         .485252
         .255064
       .25186157
     -.003727866
     .0002330003
       .16162603
        .4853477
        .6341666
        .8092486
         .456621
         .491038
        .0912823
        .7490073
       .02282486
        .5351283
        .3565111
    .00022624434
       -.6785083
       .24813333
       .29475766
         .487984
        .4525862
        .4377828
        .8644269
        .1849917
        .7047205
        .5621571
       .17880316
       .24886924
        .6587124
       1.0664852
        .1548311
        .4454558
        .5343285
      -.08766777
        .2689541
       -.8963893
        -.664264
       -.0450633
      -.09366927
     .0004545423
      .023793284
        .0896731
      -.08135593
      -.04443387
        .4749024
       .41462195
     -.035368133
        .2261495
          -.3225
        .1685291
       .22739518
        .4570766
       .25022635
        .7950564
       .05629966
        .2616592
       .02434031
      .003409075
        .3001591
       -.0120399
      -.02431818
       -.6375854
     .0004587156
       .22791554
       .12557077
    end

  • #2
    The test is of whether the mean is zero. As the mean is more than 5 times its standard error, the null is overwhelmingly rejected. Stata uses 4 decimal places here for P-values and 0.0000 indicates less than 0.00005. If you want to see more decimal places just go

    Code:
    return list 
    display r(p)
    afterwards.

    Whether the test is what you need or want is a different question and -- in any case -- note that this t-test with returns, or any other time series, ignores serial dependence completely. But you're mixing in an approach using a fixed significance level of 0.05 and with that ritual it's sufficient to know that P << 0.05.

    Again, whether that has substantive or even statistical meaning is a bigger question. The main point about a significance test is, or used to be, to stop researchers making fools of themselves by over-interpreting results from very small samples, which is not your situation.

    Comment

    Working...
    X