Manual t-test in R, Tail test

547 views Asked by At

I've been trying to make a manual t test of a statistic that I calculated in r. I've seen some people recommend to use the function dt but that had not worked. I know because I'm comparing my results of R with my results in STATA (the last ones I'm sure I've got them correct). This is the code with which I'm trying to do this

pvalue<-dt(3.141523, df=8)

Where 3.141523 is my calculated t statistic and df is degrees of freedom. Thank you for your help!

1

There are 1 answers

1
Andrew On

I think you want to use the pt() function instead of dt(). dt() is the density while pt() is the distribution.

> pt(3.141523, df = 8)
[1] 0.9931132