Filter löschen
Filter löschen

Obtaining the p value from the t stat

49 Ansichten (letzte 30 Tage)
Lauren
Lauren am 20 Nov. 2014
Kommentiert: Star Strider am 20 Nov. 2014
I have a t-stat and am looking to calculate the p-value for it. I am looking for a function where I can input my t-stat and the degrees of freedom and the two-tailed p-value will be outputted. I am able to find an online calculator that does this (<http://www.danielsoper.com/statcalc3/calc.aspx?id=8)>, but I have not been able to find a Matlab function that will. Any help is greatly appreciated!
Thanks!

Akzeptierte Antwort

Star Strider
Star Strider am 20 Nov. 2014
If you have the Statistics Toolbox, the tcdf function will do what you want.
If not, the t-probability calculation is a one-line anonymous function:
tdist2T = @(t,v) (1-betainc(v/(v+t^2),v/2,0.5)); % 2-tailed t-distribution
tdist1T = @(t,v) 1-(1-tdist2T(t,v))/2; % 1-tailed t-distribution
where ‘t’ is the t-statistic and ‘v’ are the degrees-of-freedom. (Note that ‘tdist1T’ calls ‘tdist2T’.)
  2 Kommentare
Lauren
Lauren am 20 Nov. 2014
Thank you very much!
Star Strider
Star Strider am 20 Nov. 2014
My pleasure!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Matrices and Arrays finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by