One Sample t-test Help

Hi guys! I Need your help. I am really not good in statistics and to do some one sample t-Tests to analyze the Momentum-effect.

One of my codes is for example:

t.test(GPJ3H6$cumAR, alternative="greater", mu=0, conf.level=0.95)

my dataframe GPJ3H3 has 99 obs. (I checked the data for Import errors..)

So why is the result of my t-test "df=100"?! I think it should be 98? (N-1)?
image

I have to repeat this kind of test 30 times more with other data. So i want to be sure that I'm right…

PS: I want to test every Dataframe/Strategy independently. That's why I do so many t-Tests. After I want to find out the dependencies between the strategies or which strategy is the best one. What Kind of method woulf you recommend ?

Thank you!!

I too would expect df = 98. What exactly did you do to "check for import errors"? Without seeing your data, it is hard to say what is wrong. Below is a simple test to confirm your expectation about df = 98.

set.seed(67543)
df <- data.frame(A = rnorm(n = 99, mean = 0.07, sd = 1))
nrow(df)
#> [1] 99
t.test(df$A, alternative="greater", mu=0, conf.level=0.95)
#> 
#>  One Sample t-test
#> 
#> data:  df$A
#> t = -0.93734, df = 98, p-value = 0.8246
#> alternative hypothesis: true mean is greater than 0
#> 95 percent confidence interval:
#>  -0.2588302        Inf
#> sample estimates:
#>   mean of x 
#> -0.09338792

Created on 2019-04-21 by the reprex package (v0.2.1)
Are you sure nrow(GPJ3H6) is 99?

Thanks for reply. I don't know what's going wrong… I just restart everything and surprise surprise - there is df=98.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.